Skip to content

Commit

Permalink
Update cypress tests to reflect changes in Aksel's ErrorSummary
Browse files Browse the repository at this point in the history
  • Loading branch information
magnurh-cx committed Oct 8, 2024
1 parent 71d0fb9 commit 8870860
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/digitalLospost.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Digital løspost', () => {
it('validates and submits løspost application', () => {
cy.visit('/lospost-default');
cy.findByRole('button', { name: 'Send til NAV' }).should('exist').click();
cy.findByRole('region', { name: 'Du må fikse disse feilene før du kan sende inn søknad.' })
cy.get('[data-cy=valideringsfeil]')
.should('exist')
.within(() => {
cy.findByRole('link', { name: `Last opp ${vedlegg.label}` })
Expand Down
18 changes: 8 additions & 10 deletions cypress/e2e/validering.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ describe('Tester validering', () => {
cy.injectAxe();
cy.get('[data-cy="nesteStegKnapp"]').click();

cy.focused()
.should('have.attr', 'data-cy', 'valideringsfeil')
.within(() => {
cy.get('li').should('have.length', 1);
});
cy.get('[data-cy=valideringsfeil]').within(() => {
cy.get('h2').should('have.focus');
cy.get('li').should('have.length', 1);
});

cy.checkA11y('#__next');

Expand All @@ -41,11 +40,10 @@ describe('Tester validering', () => {

cy.get('[data-cy="sendTilNAVKnapp"]').click();

cy.focused()
.should('have.attr', 'data-cy', 'valideringsfeil')
.within(() => {
cy.get('li').should('have.length', 4);
});
cy.get('[data-cy=valideringsfeil]').within(() => {
cy.get('h2').should('have.focus');
cy.get('li').should('have.length', 4);
});

cy.checkA11y('#__next');

Expand Down
9 changes: 4 additions & 5 deletions cypress/e2e/vedleggsvalg.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ describe('Tester validering', () => {

cy.get('[data-cy="sendTilNAVKnapp"]').click();

cy.focused()
.should('have.attr', 'data-cy', 'valideringsfeil')
.within(() => {
cy.get('li').should('have.length', 5);
});
cy.get('[data-cy=valideringsfeil]').within(() => {
cy.get('h2').should('have.focus');
cy.get('li').should('have.length', 5);
});

cy.checkA11y('#__next');

Expand Down

0 comments on commit 8870860

Please sign in to comment.