Skip to content

Commit a6d6b85

Browse files
committed
cypress update
1 parent 81be2d5 commit a6d6b85

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

web-app/cypress/e2e/addFeedForm.cy.ts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ describe('Add Feed Form', () => {
3333
cy.get('body').then($body => {
3434
if ($body.find('[data-cy="emptyLicenseUsage"]').length) {
3535
cy.get('[data-cy="emptyLicenseUsage"]').click();
36+
cy.get('li').should('have.length.at.least', 1);
37+
cy.get('li').then($lis => {
38+
const texts = $lis.map((i, el) => el.textContent).get();
39+
cy.log('Dropdown options:', texts.join(', '));
40+
expect(texts).to.include('Unsure');
41+
});
3642
cy.contains('li', 'Unsure').click();
3743
}
3844
});
@@ -94,6 +100,12 @@ describe('Add Feed Form', () => {
94100
cy.get('body').then($body => {
95101
if ($body.find('[data-cy="emptyLicenseUsage"]').length) {
96102
cy.get('[data-cy="emptyLicenseUsage"]').click();
103+
cy.get('li').should('have.length.at.least', 1);
104+
cy.get('li').then($lis => {
105+
const texts = $lis.map((i, el) => el.textContent).get();
106+
cy.log('Dropdown options:', texts.join(', '));
107+
expect(texts).to.include('Unsure');
108+
});
97109
cy.contains('li', 'Unsure').click();
98110
}
99111
});
@@ -150,17 +162,15 @@ describe('Add Feed Form', () => {
150162
// step 3: should see emptyLicenseUsage select
151163
cy.get('[data-cy="emptyLicenseUsage"]').should('exist');
152164
cy.get('[data-cy="emptyLicenseUsageLabel"]').should('contain', 'available for trip planners and other third parties to use');
153-
// Open dropdown and check options
154-
cy.get('[data-cy="emptyLicenseUsage"]').click();
155-
cy.get('li').should('contain', 'Yes');
156-
cy.get('li').should('contain', 'No');
157-
cy.get('li').should('contain', 'Unsure');
158-
cy.get('body').type('{esc}'); // close dropdown
159-
// Try submitting without selecting
160-
cy.get('[data-cy="thirdStepSubmit"]').click();
161-
cy.get('[data-cy="emptyLicenseUsageLabel"]').should('have.css', 'color').and('match', /rgb\(.*\)/);
162-
// Select Unsure and submit
165+
// Open dropdown and check options with debug output
163166
cy.get('[data-cy="emptyLicenseUsage"]').click();
167+
cy.get('li').should('have.length.at.least', 1);
168+
cy.get('li').then($lis => {
169+
const texts = $lis.map((i, el) => el.textContent).get();
170+
// Debug output
171+
cy.log('Dropdown options:', texts.join(', '));
172+
expect(texts).to.include('Unsure');
173+
});
164174
cy.contains('li', 'Unsure').click();
165175
cy.get('[data-cy="thirdStepSubmit"]').click();
166176
cy.url().should('include', '/contribute?step=4');

0 commit comments

Comments
 (0)