Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions test/e2e/integration/frontend-test/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,10 @@ describe('Options', () => {

cy.goto('changename');

// All options are fetched once at first (with 'undefined' in mapping, as no value for source has been set)
cy.get('@interceptOptions(references).all').should('have.length', 1);
cy.get('@interceptOptions(test).all').should('have.length', 1);

// This field uses preselectedOptionIndex to select 'Altinn'
cy.get(appFrontend.changeOfName.sources).should('have.value', 'Altinn');

// At that point our options have new mappings, so requests should have fired again
// At this point our options have new mappings, so requests should have fired again
cy.get('@interceptOptions(references).all').should('have.length', 2);
cy.get('@interceptOptions(test).all').should('have.length', 2);

Expand Down
8 changes: 8 additions & 0 deletions test/e2e/integration/frontend-test/tabbing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ const appFrontend = new AppFrontend();

describe('Tabbing', () => {
it('Tab through the fields in change name form', () => {
cy.intercept('GET', '**/api/options/references?language=nb&source=altinn').as('fetchReferences');
cy.goto('changename');

// Making extra sure we've finished waiting for the page to load. Sometimes, if we start too early (unrealistically
// early, compared to real users) the focus might have been reset before we get to simulate tabbing. This was
// somewhat flaky for a while.
cy.wait('@fetchReferences');
cy.waitUntilSaved();

cy.get(appFrontend.changeOfName.newFirstName).focus().tab();
cy.focused().should('have.text', 'Nytt mellomnavn');
cy.tab();
Expand Down