Skip to content

Commit 5f16046

Browse files
Port #1292 to dtq-dev-9-base: UFAL/Separate CLARIN license payload from sections.license (#1497)
TESTS-ONLY completion of the #1292 port. The runtime hunk (the CLARIN license section PATCHes /sections/clarin-license/select instead of sections.license) arrived with the v9 squash, and the karma spec that pins the PATCH path arrived with #1396 (card FE-25) - section-license.component.spec.ts already asserts body[0].path === '/sections/clarin-license/select'. Nothing to add there. What was still missing is the e2e half. #1292 also hardened cypress/e2e/submission-ui.cy.ts so that the CLARIN licence section's card header is asserted to carry the green status icon (.fa-check-circle.text-success, 15 s timeout) when no file has been uploaded. That file does not exist on the v9 base - the fork's submission-ui.cy.ts was replaced by the vanilla submission.cy.ts - so the step is adapted into submission.cy.ts instead. v9 notes: - The step is conditional on div[id="section_clarin-license"] existing (decision D-03). CI e2e runs against a vanilla backend image, which does not ship the clarin-license submission step, so an unconditional step would fail there. On a CLARIN backend the section is present and the assertions run. - It is placed in the first test ("should create a new submission when using /submit path"), which uploads no file - the same precondition as the fork's "should not show validation warnings when no file is uploaded (metadata-only)" test the hunk came from. - The fork's cy.wait(1000) settle and the 15 s retry timeout are kept verbatim. - No cy./expect() step is removed or weakened (guard X6). Card PB-08 (tranche T3). Source: 0645e7e (dtq-dev PR #1292) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 6ff55c2 commit 5f16046

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

cypress/e2e/submission.cy.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,42 @@ describe('New Submission page', () => {
4646
} as Options,
4747
);
4848

49+
// CLARIN: the CLARIN licence section (section_clarin-license) only exists when the backend
50+
// ships the clarin-license submission step, which the vanilla backend used by CI e2e does not,
51+
// so this step is conditional (decision D-03). No file has been uploaded in this test, which
52+
// makes the section valid straight away: its card header must show the green status icon
53+
// without a reload, and neither the warning nor the error icon may be present.
54+
// Adapted from cypress/e2e/submission-ui.cy.ts on dtq-dev (PR #1292).
55+
cy.get('body').then((body) => {
56+
if (body.find('div[id="section_clarin-license"]').length === 0) {
57+
cy.log('CLARIN licence section not configured on this backend - skipping status icon check');
58+
return;
59+
}
60+
61+
// Allow frontend to propagate the initial section status (no file => valid)
62+
// before asserting the header icon.
63+
cy.wait(1000);
64+
cy.get('div[id="section_clarin-license"]').find('.card-header').should('be.visible');
65+
66+
// Verify warning and error icons do NOT exist
67+
cy.get('div[id="section_clarin-license"]')
68+
.find('.card-header')
69+
.find('.fa-exclamation-circle.text-warning')
70+
.should('not.exist');
71+
72+
cy.get('div[id="section_clarin-license"]')
73+
.find('.card-header')
74+
.find('.fa-exclamation-circle.text-danger')
75+
.should('not.exist');
76+
77+
// Green check must eventually appear (retry-ability with a longer timeout
78+
// handles any remaining async settle of the section status observable).
79+
cy.get('div[id="section_clarin-license"]')
80+
.find('.card-header')
81+
.find('.fa-check-circle.text-success', { timeout: 15000 })
82+
.should('be.visible');
83+
});
84+
4985
// Discard button should work
5086
// Clicking it will display a confirmation, which we will confirm with another click
5187
cy.get('button#discard').click();

0 commit comments

Comments
 (0)