Skip to content

Commit 361f55c

Browse files
committed
Fix tests
1 parent 33fdf03 commit 361f55c

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

mocks/mocks/data/formio-api/custom-components.json

-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@
204204
"tableView": false,
205205
"modalEdit": false,
206206
"data": {
207-
"resource": "",
208207
"url": "http://127.0.0.1:3001/fyllut/api/common-codes/currencies?lang=nb"
209208
},
210209
"valueProperty": "",

packages/fyllut-backend/src/routers/api/common-codes.ts

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const commonCodes = {
3535

3636
try {
3737
const response = await fetchCommonCodeDescriptions(req, 'ValutaBetaling', languageCode);
38+
3839
for (const [key, values] of Object.entries(response.betydninger)) {
3940
const currencyName = (values as any)[0]?.beskrivelser?.[languageCode]?.term;
4041
const newObj = { label: `${currencyName} (${key})`, value: key };

packages/fyllut/cypress/e2e/components/currency-and-account.cy.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
2-
* Tests that various components behaves as expected
3-
* - Penger og konto
2+
* Tests that "penger og konto" component works as expected
43
*/
54
describe('Components', () => {
65
describe('Penger og konto', () => {

packages/fyllut/cypress/e2e/components/general.ts packages/fyllut/cypress/e2e/components/general.cy.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*
2-
* General tests for custom react components
2+
* General tests for react components
33
*/
44

55
import { TEXTS } from '@navikt/skjemadigitalisering-shared-domain';
66

7-
describe('Custom react components', () => {
7+
describe('React components', () => {
88
beforeEach(() => {
99
Cypress.automation('remote:debugger:protocol', {
1010
command: 'Network.clearBrowserCache',
@@ -15,11 +15,13 @@ describe('Custom react components', () => {
1515
describe('General', () => {
1616
describe('Fill in form and view summary, paper', () => {
1717
beforeEach(() => {
18+
cy.intercept('GET', 'https://www.nav.no/fyllut/countries*').as('getCountrySelect');
1819
cy.visit('/fyllut/customcomps/dineopplysninger?sub=paper');
1920
cy.defaultWaits();
20-
cy.wait('@getGlobalTranslations');
21-
cy.wait('@getCountries');
2221
cy.wait('@getCurrencies');
22+
cy.wait('@getCountries');
23+
cy.wait('@getGlobalTranslations');
24+
cy.wait('@getCountrySelect');
2325
});
2426

2527
it('reflects changes on summary page when editing data', () => {
@@ -117,8 +119,6 @@ describe('Custom react components', () => {
117119
beforeEach(() => {
118120
cy.visit('/fyllut/customcomps/dineopplysninger?sub=digital');
119121
cy.defaultWaits();
120-
cy.wait('@getGlobalTranslations');
121-
cy.wait('@getCountries');
122122
cy.wait('@getCurrencies');
123123
});
124124

0 commit comments

Comments
 (0)