Skip to content

Commit

Permalink
Stabilizing tests (#254)
Browse files Browse the repository at this point in the history
Co-authored-by: Ole Martin Handeland <[email protected]>
  • Loading branch information
olemartinorg and Ole Martin Handeland authored Jun 27, 2022
1 parent 1ae84e4 commit 3a39055
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('fetchTextResourcesSagas', () => {
};
expectSaga(fetchTextResources)
.provide([
[select(appLanguageStateSelector), ''],
[select(appLanguageStateSelector), 'nb'],
[select(allowAnonymousSelector), true],
[call(get, textResourcesUrl('nb')), mockTextResource],
])
Expand Down
17 changes: 8 additions & 9 deletions test/cypress/e2e/integration/app-frontend/confirmation.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ describe('Confirm', () => {
.first()
.should('contain.text', `${Cypress.env('multiData2Stage')}.pdf`);

const getAttachments = () => (cy.get(appFrontend.confirm.uploadedAttachments)
cy.get(appFrontend.confirm.uploadedAttachments)
.last()
.find('a'));

getAttachments().should('have.length', 5);
getAttachments().eq(0).should('contain.text', `test.pdf`);
getAttachments().eq(1).should('contain.text', `attachment-in-single.pdf`);
getAttachments().eq(2).should('contain.text', `attachment-in-multi1.pdf`);
getAttachments().eq(3).should('contain.text', `attachment-in-multi2.pdf`);
getAttachments().eq(4).should('contain.text', `attachment-in-nested.pdf`);
.find('a')
.should('have.length', 5)
.should('contain.text', `test.pdf`)
.should('contain.text', `attachment-in-single.pdf`)
.should('contain.text', `attachment-in-multi1.pdf`)
.should('contain.text', `attachment-in-multi2.pdf`)
.should('contain.text', `attachment-in-nested.pdf`);

cy.get(appFrontend.confirm.sendIn).should('be.visible');
cy.url().then((url) => {
Expand Down
17 changes: 8 additions & 9 deletions test/cypress/e2e/integration/app-frontend/receipt.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ describe('Receipt', () => {
.first()
.should('contain.text', `${Cypress.env('multiData2Stage')}.pdf`);

const getAttachmentList = () => (cy.get(appFrontend.receipt.uploadedAttachments)
cy.get(appFrontend.receipt.uploadedAttachments)
.last()
.find('a'));

getAttachmentList().should('have.length', 5);
getAttachmentList().eq(0).should('contain.text', `test.pdf`);
getAttachmentList().eq(1).should('contain.text', `attachment-in-single.pdf`);
getAttachmentList().eq(2).should('contain.text', `attachment-in-multi1.pdf`);
getAttachmentList().eq(3).should('contain.text', `attachment-in-multi2.pdf`);
getAttachmentList().eq(4).should('contain.text', `attachment-in-nested.pdf`);
.find('a')
.should('have.length', 5)
.should('contain.text', `test.pdf`)
.should('contain.text', `attachment-in-single.pdf`)
.should('contain.text', `attachment-in-multi1.pdf`)
.should('contain.text', `attachment-in-multi2.pdf`)
.should('contain.text', `attachment-in-nested.pdf`);

cy.get('body').should('have.css', 'background-color', 'rgb(212, 249, 228)');
cy.get(appFrontend.header).should('contain.text', texts.ttd);
Expand Down

0 comments on commit 3a39055

Please sign in to comment.