feat(ui5-test-writer): Generate tests for Contact Cards - #4872
feat(ui5-test-writer): Generate tests for Contact Cards#4872sap-sebelao wants to merge 30 commits into
Conversation
🦋 Changeset detectedLatest commit: 407d1e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
The PR introduces a substantive bug: extractFormFields pushes Contact-card entries (e.g. { property: "_Customer/Contact", targetAnnotation: "Contact" }) into the fields array, and the template's iCheckField loop iterates over all fields unconditionally — so each Contact-card entry generates both an invalid iCheckField({ property: "_Customer/Contact" }) call and the correct iClickLink call. The fix is to either exclude Contact-card entries from fields in extractFormFields, or guard against them in the template loop. The secondary comment about pickContactCardFields depending on the Contact entries being in fields would also need to be addressed if the extraction is fixed upstream. Please resolve these two coupled issues before merging.
dudajSAP
left a comment
There was a problem hiding this comment.
From my POV now the auto-gen header is missing on multiple places.
…y contact-card block
The expected fixture lagged behind the test-writer output by two iCheckField lines for _ReferencedSalesOrder/SalesOrder and _ReferencedSalesOrderItem/SalesOrderItem. Pull in the current fixture version that matches the generator.
SummaryThe following content is AI-generated and provides a summary of the pull request: DescriptionThis PR adds Contact Card OPA5 test generation to the
Additional bug fixes included in this PR:
Type of change
How have you tested?
Checklist:
PR Bot InformationVersion:
|
There was a problem hiding this comment.
Summary
The PR adds Contact Card OPA5 test generation across Object Page and List Report pages, plus handling for @UI.ConnectedFields and @UI.FieldGroup wrappers in body sub-section forms. The logic is generally sound and well-tested, but there are a few issues worth addressing:
-
Missing
navigationPropertyguard in both EJS templates (ObjectPageJourney.jsandObjectPageJourney.ts): The newcontactCardColumnsblock for body-level table sections emitsonTable({ property: "<%- section.navigationProperty %>" })without checking thatsection.navigationPropertyis defined first — unlike the adjacentiCheckColumnsblock which already has this guard. This will generate brokenonTable({ property: "undefined" })calls for table sections with no navigation property. (Comments posted with fix suggestions.) -
Duplicate test suite in
modelUtils.test.ts: Thedescribe('parseDataFieldForAnnotationName()')block appears twice (lines 257–286 and lines 405–436) with identical test cases. The duplication adds no coverage and produces confusing test output. (Comment posted.) -
Intentional dual-emit design deserves a code comment in
objectPageUtils.ts: Contact-card fields end up in bothfields(generating aniCheckFieldcall) andcontactCardFields(generatingiClickLink/iCheckContactDialog). Since this is intentional but non-obvious, a brief inline comment would prevent future maintainers from treating it as a bug and removing the duplicate.
heimwege
left a comment
There was a problem hiding this comment.
- changeset ok
- review comments addressed
- coverage is excellent
- did NOT test manually
Added one potential follow-up activity
…contact-cards-tests
…thub.com/SAP/open-ux-tools into feat/ui5-test-writer/contact-cards-tests
…contact-cards-tests
devinea
left a comment
There was a problem hiding this comment.
Code changes seem clear and well covered by tests.
did not test locally.
…contact-cards-tests # Conflicts: # packages/ui5-test-writer/test/test-input/constants.ts
…contact-cards-tests # Conflicts: # packages/ui5-test-writer/src/utils/objectPageUtils.ts
|



-- column availability is now evaluated
-- commented out test suggestion now suggests existing action
Internal issue
36742
Internal JIRAs
FXUBRQ34-12564
FXUBRQ34-12565
FXUBRQ34-12566
FXUBRQ34-12525
FXUBRQ34-12604