845 lines
85 KiB
Plaintext
845 lines
85 KiB
Plaintext
|
||
> job-tracker-ui@0.1.0 test
|
||
> jest --runInBand --runTestsByPath src/jobs-view-integration.test.tsx -t localised matching count
|
||
|
||
node.exe : FAIL src/jobs-view-integration.test.tsx (21.676 s)
|
||
At line:1 char:1
|
||
+ & "C:\Program Files\nodejs/node.exe" "C:\Program Files\nodejs/node_mo ...
|
||
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
+ CategoryInfo : NotSpecified: (FAIL src/jobs-v....tsx (21.676 s):String) [], RemoteException
|
||
+ FullyQualifiedErrorId : NativeCommandError
|
||
|
||
● localised matching count: en table 0 retains membership and changes language without job reads
|
||
|
||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||
|
||
Expected number of calls: 2
|
||
Received number of calls: 3
|
||
|
||
52 | fireEvent.click(screen.getByRole('button', { name: 'Change language' }));
|
||
53 | await screen.findByText(label(language === 'en' ? 'nb' : 'en'));
|
||
> 54 | expect(mockedApi.get).toHaveBeenCalledTimes(calls);
|
||
| ^
|
||
55 | expect(ids(view === 'board' ? '[data-kanban-card-id]' : '[data-job-row-id]', view === 'board' ?
|
||
'data-kanban-card-id' : 'data-job-row-id')).toEqual(jobs.slice(0, count).map(job => job.id));
|
||
56 | });
|
||
57 |
|
||
|
||
at toHaveBeenCalledTimes (src/jobs-view-integration.test.tsx:54:25)
|
||
|
||
● localised matching count: en table 1 retains membership and changes language without job reads
|
||
|
||
Unable to find an element with the text: 1 matching job. This could be because the text is broken up by multiple
|
||
elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
|
||
|
||
Ignored nodes: comments, script, style
|
||
[36m<body>[39m
|
||
[36m<div>[39m
|
||
[36m<button>[39m
|
||
[0mChange language[0m
|
||
[36m</button>[39m
|
||
[36m<output[39m
|
||
[33maria-label[39m=[32m"Route"[39m
|
||
[36m>[39m
|
||
[0m/jobs[0m
|
||
[0m?view=table[0m
|
||
[36m</output>[39m
|
||
[36m<button>[39m
|
||
[0mHistory back[0m
|
||
[36m</button>[39m
|
||
[36m<button>[39m
|
||
[0mHistory forward[0m
|
||
[36m</button>[39m
|
||
[36m<button>[39m
|
||
[0mJob created[0m
|
||
[36m</button>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-0"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-1g1pux1"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33maria-label[39m=[32m"Jobs view"[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-1utx3w7"[39m
|
||
[33mrole[39m=[32m"group"[39m
|
||
[36m>[39m
|
||
[36m<a[39m
|
||
[33maria-current[39m=[32m"page"[39m
|
||
[33mclass[39m=[32m"MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary
|
||
MuiButton-sizeSmall MuiButton-containedSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-contained
|
||
MuiButton-containedPrimary MuiButton-sizeSmall MuiButton-containedSizeSmall MuiButton-colorPrimary
|
||
css-tm237w-MuiButtonBase-root-MuiButton-root"[39m
|
||
[33mdata-discover[39m=[32m"true"[39m
|
||
[33mhref[39m=[32m"/jobs?view=table"[39m
|
||
[33mtabindex[39m=[32m"0"[39m
|
||
[36m>[39m
|
||
[0mTable[0m
|
||
[36m</a>[39m
|
||
[36m<a[39m
|
||
[33mclass[39m=[32m"MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary
|
||
MuiButton-sizeSmall MuiButton-outlinedSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-outlined
|
||
MuiButton-outlinedPrimary MuiButton-sizeSmall MuiButton-outlinedSizeSmall MuiButton-colorPrimary
|
||
css-74b9is-MuiButtonBase-root-MuiButton-root"[39m
|
||
[33mdata-discover[39m=[32m"true"[39m
|
||
[33mhref[39m=[32m"/jobs?view=board"[39m
|
||
[33mtabindex[39m=[32m"0"[39m
|
||
[36m>[39m
|
||
[0mBoard[0m
|
||
[36m</a>[39m
|
||
[36m</div>[39m
|
||
[36m<p[39m
|
||
[33mclass[39m=[32m"MuiTypography-root MuiTypography-body2 css-1qf9eb3-MuiTypography-root"[39m
|
||
[33mrole[39m=[32m"status"[39m
|
||
[36m>[39m
|
||
[0m1 matching jobs[0m
|
||
[36m</p>[39m
|
||
[36m</div>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-1eini8u"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiFormControl-root MuiTextField-root
|
||
css-1lssrpz-MuiFormControl-root-MuiTextField-root"[39m
|
||
[36m>[39m
|
||
[36m<label[39m
|
||
[33mclass[39m=[32m"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl
|
||
MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary
|
||
MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeSmall
|
||
MuiInputLabel-outlined css-fluw5i-MuiFormLabel-root-MuiInputLabel-root"[39m
|
||
[33mdata-shrink[39m=[32m"true"[39m
|
||
[33mfor[39m=[32m"_r_s_"[39m
|
||
[33mid[39m=[32m"_r_s_-label"[39m
|
||
[36m>[39m
|
||
[0mSearch[0m
|
||
[36m</label>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary
|
||
MuiInputBase-formControl MuiInputBase-sizeSmall MuiInputBase-adornedStart
|
||
css-71sp51-MuiInputBase-root-MuiOutlinedInput-root"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiInputAdornment-root MuiInputAdornment-positionStart
|
||
MuiInputAdornment-outlined MuiInputAdornment-sizeSmall css-1nowbqt-MuiInputAdornment-root"[39m
|
||
[36m>[39m
|
||
[36m<span[39m
|
||
[33maria-hidden[39m=[32m"true"[39m
|
||
[33mclass[39m=[32m"notranslate"[39m
|
||
[36m>[39m
|
||
[0m[0m
|
||
[36m</span>[39m
|
||
[36m<svg[39m
|
||
[33maria-hidden[39m=[32m"true"[39m
|
||
[33mclass[39m=[32m"MuiSvgIcon-root MuiSvgIcon-fontSizeSmall css-120dh41-MuiSvgIcon-root"[39m
|
||
[33mdata-testid[39m=[32m"SearchIcon"[39m
|
||
[33mfocusable[39m=[32m"false"[39m
|
||
[33mviewBox[39m=[32m"0 0 24 24"[39m
|
||
[36m>[39m
|
||
[36m<path[39m
|
||
[33md[39m=[32m"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3
|
||
5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5
|
||
5 14 7.01 14 9.5 11.99 14 9.5 14"[39m
|
||
[36m/>[39m
|
||
[36m</svg>[39m
|
||
[36m</div>[39m
|
||
[36m<input[39m
|
||
[33maria-invalid[39m=[32m"false"[39m
|
||
[33mclass[39m=[32m"MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall
|
||
MuiInputBase-inputAdornedStart css-14mk4rm-MuiInputBase-input-MuiOutlinedInput-input"[39m
|
||
[33mid[39m=[32m"_r_s_"[39m
|
||
[33mplaceholder[39m=[32m"Title, company, notes, messages"[39m
|
||
[33mtype[39m=[32m"text"[39m
|
||
[33mvalue[39m=[32m""[39m
|
||
[36m/>[39m
|
||
[36m<fieldset[39m
|
||
[33maria-hidden[39m=[32m"true"[39m
|
||
[33mclass[39m=[32m"MuiOutlinedInput-notchedOutline
|
||
css-18p5xg2-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"[39m
|
||
[36m>[39m
|
||
[36m<legend[39m
|
||
[33mclass[39m=[32m"css-ex8a5f-MuiNotchedOutlined-root"[39m
|
||
[36m>[39m
|
||
[36m<span>[39m
|
||
[0mSearch[0m
|
||
[36m</span>[39m
|
||
[36m</legend>[39m
|
||
[36m</fieldset>[39m
|
||
[36m</div>[39m
|
||
[36m</div>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiFormControl-root css-1f2y67v-MuiFormControl-root"[39m
|
||
[36m>[39m
|
||
[36m<label[39m
|
||
[33mclass[39m=[32m"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl
|
||
MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary
|
||
MuiFormLabel-filled MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink
|
||
MuiInputLabel-sizeSmall MuiInputLabel-outlined css-fluw5i-MuiFormLabel-root-MuiInputLabel-root"[39m
|
||
[33mdata-shrink[39m=[32m"true"[39m
|
||
[33mid[39m=[32m"job-table-status-label"[39m
|
||
[36m>[39m
|
||
[0mStatus[0m
|
||
[36m</label>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary
|
||
MuiInputBase-formControl MuiInputBase-sizeSmall MuiSelect-root cs...
|
||
|
||
48 | render(<MemoryRouter initialEntries={[`/jobs?view=${view}`]}><I18nProvider><LanguageSwitch
|
||
/><ToastProvider><ConfirmProvider><PromptProvider><Consumer
|
||
/></PromptProvider></ConfirmProvider></ToastProvider></I18nProvider></MemoryRouter>);
|
||
49 | const label = (locale: 'en' | 'nb') => locale === 'en' ? `${count} matching ${count === 1 ? 'job' :
|
||
'jobs'}` : `${count} ${count === 1 ? 'jobb' : 'jobber'} samsvarer`;
|
||
> 50 | await screen.findByText(label(language));
|
||
| ^
|
||
51 | const calls = mockedApi.get.mock.calls.length;
|
||
52 | fireEvent.click(screen.getByRole('button', { name: 'Change language' }));
|
||
53 | await screen.findByText(label(language === 'en' ? 'nb' : 'en'));
|
||
|
||
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:163:27)
|
||
at node_modules/@testing-library/dom/dist/query-helpers.js:86:33
|
||
at findByText (src/jobs-view-integration.test.tsx:50:16)
|
||
|
||
● localised matching count: en table 2 retains membership and changes language without job reads
|
||
|
||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||
|
||
Expected number of calls: 1
|
||
Received number of calls: 2
|
||
|
||
52 | fireEvent.click(screen.getByRole('button', { name: 'Change language' }));
|
||
53 | await screen.findByText(label(language === 'en' ? 'nb' : 'en'));
|
||
> 54 | expect(mockedApi.get).toHaveBeenCalledTimes(calls);
|
||
| ^
|
||
55 | expect(ids(view === 'board' ? '[data-kanban-card-id]' : '[data-job-row-id]', view === 'board' ?
|
||
'data-kanban-card-id' : 'data-job-row-id')).toEqual(jobs.slice(0, count).map(job => job.id));
|
||
56 | });
|
||
57 |
|
||
|
||
at toHaveBeenCalledTimes (src/jobs-view-integration.test.tsx:54:25)
|
||
|
||
● localised matching count: en board 0 retains membership and changes language without job reads
|
||
|
||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||
|
||
Expected number of calls: 1
|
||
Received number of calls: 2
|
||
|
||
52 | fireEvent.click(screen.getByRole('button', { name: 'Change language' }));
|
||
53 | await screen.findByText(label(language === 'en' ? 'nb' : 'en'));
|
||
> 54 | expect(mockedApi.get).toHaveBeenCalledTimes(calls);
|
||
| ^
|
||
55 | expect(ids(view === 'board' ? '[data-kanban-card-id]' : '[data-job-row-id]', view === 'board' ?
|
||
'data-kanban-card-id' : 'data-job-row-id')).toEqual(jobs.slice(0, count).map(job => job.id));
|
||
56 | });
|
||
57 |
|
||
|
||
at toHaveBeenCalledTimes (src/jobs-view-integration.test.tsx:54:25)
|
||
|
||
● localised matching count: en board 1 retains membership and changes language without job reads
|
||
|
||
Unable to find an element with the text: 1 matching job. This could be because the text is broken up by multiple
|
||
elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
|
||
|
||
Ignored nodes: comments, script, style
|
||
[36m<body>[39m
|
||
[36m<div>[39m
|
||
[36m<button>[39m
|
||
[0mChange language[0m
|
||
[36m</button>[39m
|
||
[36m<output[39m
|
||
[33maria-label[39m=[32m"Route"[39m
|
||
[36m>[39m
|
||
[0m/jobs[0m
|
||
[0m?view=board[0m
|
||
[36m</output>[39m
|
||
[36m<button>[39m
|
||
[0mHistory back[0m
|
||
[36m</button>[39m
|
||
[36m<button>[39m
|
||
[0mHistory forward[0m
|
||
[36m</button>[39m
|
||
[36m<button>[39m
|
||
[0mJob created[0m
|
||
[36m</button>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-0"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-1g1pux1"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33maria-label[39m=[32m"Jobs view"[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-1utx3w7"[39m
|
||
[33mrole[39m=[32m"group"[39m
|
||
[36m>[39m
|
||
[36m<a[39m
|
||
[33mclass[39m=[32m"MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary
|
||
MuiButton-sizeSmall MuiButton-outlinedSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-outlined
|
||
MuiButton-outlinedPrimary MuiButton-sizeSmall MuiButton-outlinedSizeSmall MuiButton-colorPrimary
|
||
css-74b9is-MuiButtonBase-root-MuiButton-root"[39m
|
||
[33mdata-discover[39m=[32m"true"[39m
|
||
[33mhref[39m=[32m"/jobs?view=table"[39m
|
||
[33mtabindex[39m=[32m"0"[39m
|
||
[36m>[39m
|
||
[0mTable[0m
|
||
[36m</a>[39m
|
||
[36m<a[39m
|
||
[33maria-current[39m=[32m"page"[39m
|
||
[33mclass[39m=[32m"MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary
|
||
MuiButton-sizeSmall MuiButton-containedSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-contained
|
||
MuiButton-containedPrimary MuiButton-sizeSmall MuiButton-containedSizeSmall MuiButton-colorPrimary
|
||
css-tm237w-MuiButtonBase-root-MuiButton-root"[39m
|
||
[33mdata-discover[39m=[32m"true"[39m
|
||
[33mhref[39m=[32m"/jobs?view=board"[39m
|
||
[33mtabindex[39m=[32m"0"[39m
|
||
[36m>[39m
|
||
[0mBoard[0m
|
||
[36m</a>[39m
|
||
[36m</div>[39m
|
||
[36m<p[39m
|
||
[33mclass[39m=[32m"MuiTypography-root MuiTypography-body2 css-1qf9eb3-MuiTypography-root"[39m
|
||
[33mrole[39m=[32m"status"[39m
|
||
[36m>[39m
|
||
[0m1 matching jobs[0m
|
||
[36m</p>[39m
|
||
[36m</div>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-1eini8u"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiFormControl-root MuiTextField-root
|
||
css-1lssrpz-MuiFormControl-root-MuiTextField-root"[39m
|
||
[36m>[39m
|
||
[36m<label[39m
|
||
[33mclass[39m=[32m"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl
|
||
MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary
|
||
MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeSmall
|
||
MuiInputLabel-outlined css-fluw5i-MuiFormLabel-root-MuiInputLabel-root"[39m
|
||
[33mdata-shrink[39m=[32m"true"[39m
|
||
[33mfor[39m=[32m"_r_3a_"[39m
|
||
[33mid[39m=[32m"_r_3a_-label"[39m
|
||
[36m>[39m
|
||
[0mSearch[0m
|
||
[36m</label>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary
|
||
MuiInputBase-formControl MuiInputBase-sizeSmall MuiInputBase-adornedStart
|
||
css-71sp51-MuiInputBase-root-MuiOutlinedInput-root"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiInputAdornment-root MuiInputAdornment-positionStart
|
||
MuiInputAdornment-outlined MuiInputAdornment-sizeSmall css-1nowbqt-MuiInputAdornment-root"[39m
|
||
[36m>[39m
|
||
[36m<span[39m
|
||
[33maria-hidden[39m=[32m"true"[39m
|
||
[33mclass[39m=[32m"notranslate"[39m
|
||
[36m>[39m
|
||
[0m[0m
|
||
[36m</span>[39m
|
||
[36m<svg[39m
|
||
[33maria-hidden[39m=[32m"true"[39m
|
||
[33mclass[39m=[32m"MuiSvgIcon-root MuiSvgIcon-fontSizeSmall css-120dh41-MuiSvgIcon-root"[39m
|
||
[33mdata-testid[39m=[32m"SearchIcon"[39m
|
||
[33mfocusable[39m=[32m"false"[39m
|
||
[33mviewBox[39m=[32m"0 0 24 24"[39m
|
||
[36m>[39m
|
||
[36m<path[39m
|
||
[33md[39m=[32m"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3
|
||
5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5
|
||
5 14 7.01 14 9.5 11.99 14 9.5 14"[39m
|
||
[36m/>[39m
|
||
[36m</svg>[39m
|
||
[36m</div>[39m
|
||
[36m<input[39m
|
||
[33maria-invalid[39m=[32m"false"[39m
|
||
[33mclass[39m=[32m"MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall
|
||
MuiInputBase-inputAdornedStart css-14mk4rm-MuiInputBase-input-MuiOutlinedInput-input"[39m
|
||
[33mid[39m=[32m"_r_3a_"[39m
|
||
[33mplaceholder[39m=[32m"Title, company, notes, messages"[39m
|
||
[33mtype[39m=[32m"text"[39m
|
||
[33mvalue[39m=[32m""[39m
|
||
[36m/>[39m
|
||
[36m<fieldset[39m
|
||
[33maria-hidden[39m=[32m"true"[39m
|
||
[33mclass[39m=[32m"MuiOutlinedInput-notchedOutline
|
||
css-18p5xg2-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"[39m
|
||
[36m>[39m
|
||
[36m<legend[39m
|
||
[33mclass[39m=[32m"css-ex8a5f-MuiNotchedOutlined-root"[39m
|
||
[36m>[39m
|
||
[36m<span>[39m
|
||
[0mSearch[0m
|
||
[36m</span>[39m
|
||
[36m</legend>[39m
|
||
[36m</fieldset>[39m
|
||
[36m</div>[39m
|
||
[36m</div>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiFormControl-root css-1f2y67v-MuiFormControl-root"[39m
|
||
[36m>[39m
|
||
[36m<label[39m
|
||
[33mclass[39m=[32m"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl
|
||
MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary
|
||
MuiFormLabel-filled MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink
|
||
MuiInputLabel-sizeSmall MuiInputLabel-outlined css-fluw5i-MuiFormLabel-root-MuiInputLabel-root"[39m
|
||
[33mdata-shrink[39m=[32m"true"[39m
|
||
[33mid[39m=[32m"job-table-status-label"[39m
|
||
[36m>[39m
|
||
[0mStatus[0m
|
||
[36m</label>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary
|
||
MuiInputBase-formControl MuiInputBase-sizeSmall MuiSelect-root...
|
||
|
||
48 | render(<MemoryRouter initialEntries={[`/jobs?view=${view}`]}><I18nProvider><LanguageSwitch
|
||
/><ToastProvider><ConfirmProvider><PromptProvider><Consumer
|
||
/></PromptProvider></ConfirmProvider></ToastProvider></I18nProvider></MemoryRouter>);
|
||
49 | const label = (locale: 'en' | 'nb') => locale === 'en' ? `${count} matching ${count === 1 ? 'job' :
|
||
'jobs'}` : `${count} ${count === 1 ? 'jobb' : 'jobber'} samsvarer`;
|
||
> 50 | await screen.findByText(label(language));
|
||
| ^
|
||
51 | const calls = mockedApi.get.mock.calls.length;
|
||
52 | fireEvent.click(screen.getByRole('button', { name: 'Change language' }));
|
||
53 | await screen.findByText(label(language === 'en' ? 'nb' : 'en'));
|
||
|
||
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:163:27)
|
||
at node_modules/@testing-library/dom/dist/query-helpers.js:86:33
|
||
at findByText (src/jobs-view-integration.test.tsx:50:16)
|
||
|
||
● localised matching count: en board 2 retains membership and changes language without job reads
|
||
|
||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||
|
||
Expected number of calls: 1
|
||
Received number of calls: 2
|
||
|
||
52 | fireEvent.click(screen.getByRole('button', { name: 'Change language' }));
|
||
53 | await screen.findByText(label(language === 'en' ? 'nb' : 'en'));
|
||
> 54 | expect(mockedApi.get).toHaveBeenCalledTimes(calls);
|
||
| ^
|
||
55 | expect(ids(view === 'board' ? '[data-kanban-card-id]' : '[data-job-row-id]', view === 'board' ?
|
||
'data-kanban-card-id' : 'data-job-row-id')).toEqual(jobs.slice(0, count).map(job => job.id));
|
||
56 | });
|
||
57 |
|
||
|
||
at toHaveBeenCalledTimes (src/jobs-view-integration.test.tsx:54:25)
|
||
|
||
● localised matching count: nb table 0 retains membership and changes language without job reads
|
||
|
||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||
|
||
Expected number of calls: 1
|
||
Received number of calls: 2
|
||
|
||
52 | fireEvent.click(screen.getByRole('button', { name: 'Change language' }));
|
||
53 | await screen.findByText(label(language === 'en' ? 'nb' : 'en'));
|
||
> 54 | expect(mockedApi.get).toHaveBeenCalledTimes(calls);
|
||
| ^
|
||
55 | expect(ids(view === 'board' ? '[data-kanban-card-id]' : '[data-job-row-id]', view === 'board' ?
|
||
'data-kanban-card-id' : 'data-job-row-id')).toEqual(jobs.slice(0, count).map(job => job.id));
|
||
56 | });
|
||
57 |
|
||
|
||
at toHaveBeenCalledTimes (src/jobs-view-integration.test.tsx:54:25)
|
||
|
||
● localised matching count: nb table 1 retains membership and changes language without job reads
|
||
|
||
Unable to find an element with the text: 1 jobb samsvarer. This could be because the text is broken up by multiple
|
||
elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
|
||
|
||
Ignored nodes: comments, script, style
|
||
[36m<body>[39m
|
||
[36m<div>[39m
|
||
[36m<button>[39m
|
||
[0mChange language[0m
|
||
[36m</button>[39m
|
||
[36m<output[39m
|
||
[33maria-label[39m=[32m"Route"[39m
|
||
[36m>[39m
|
||
[0m/jobs[0m
|
||
[0m?view=table[0m
|
||
[36m</output>[39m
|
||
[36m<button>[39m
|
||
[0mHistory back[0m
|
||
[36m</button>[39m
|
||
[36m<button>[39m
|
||
[0mHistory forward[0m
|
||
[36m</button>[39m
|
||
[36m<button>[39m
|
||
[0mJob created[0m
|
||
[36m</button>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-0"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-1g1pux1"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33maria-label[39m=[32m"Jobbvisning"[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-1utx3w7"[39m
|
||
[33mrole[39m=[32m"group"[39m
|
||
[36m>[39m
|
||
[36m<a[39m
|
||
[33maria-current[39m=[32m"page"[39m
|
||
[33mclass[39m=[32m"MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary
|
||
MuiButton-sizeSmall MuiButton-containedSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-contained
|
||
MuiButton-containedPrimary MuiButton-sizeSmall MuiButton-containedSizeSmall MuiButton-colorPrimary
|
||
css-tm237w-MuiButtonBase-root-MuiButton-root"[39m
|
||
[33mdata-discover[39m=[32m"true"[39m
|
||
[33mhref[39m=[32m"/jobs?view=table"[39m
|
||
[33mtabindex[39m=[32m"0"[39m
|
||
[36m>[39m
|
||
[0mTabell[0m
|
||
[36m</a>[39m
|
||
[36m<a[39m
|
||
[33mclass[39m=[32m"MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary
|
||
MuiButton-sizeSmall MuiButton-outlinedSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-outlined
|
||
MuiButton-outlinedPrimary MuiButton-sizeSmall MuiButton-outlinedSizeSmall MuiButton-colorPrimary
|
||
css-74b9is-MuiButtonBase-root-MuiButton-root"[39m
|
||
[33mdata-discover[39m=[32m"true"[39m
|
||
[33mhref[39m=[32m"/jobs?view=board"[39m
|
||
[33mtabindex[39m=[32m"0"[39m
|
||
[36m>[39m
|
||
[0mTavle[0m
|
||
[36m</a>[39m
|
||
[36m</div>[39m
|
||
[36m<p[39m
|
||
[33mclass[39m=[32m"MuiTypography-root MuiTypography-body2 css-1qf9eb3-MuiTypography-root"[39m
|
||
[33mrole[39m=[32m"status"[39m
|
||
[36m>[39m
|
||
[0m1 jobber samsvarer[0m
|
||
[36m</p>[39m
|
||
[36m</div>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-1eini8u"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiFormControl-root MuiTextField-root
|
||
css-1lssrpz-MuiFormControl-root-MuiTextField-root"[39m
|
||
[36m>[39m
|
||
[36m<label[39m
|
||
[33mclass[39m=[32m"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl
|
||
MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary
|
||
MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeSmall
|
||
MuiInputLabel-outlined css-fluw5i-MuiFormLabel-root-MuiInputLabel-root"[39m
|
||
[33mdata-shrink[39m=[32m"true"[39m
|
||
[33mfor[39m=[32m"_r_52_"[39m
|
||
[33mid[39m=[32m"_r_52_-label"[39m
|
||
[36m>[39m
|
||
[0mSøk[0m
|
||
[36m</label>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary
|
||
MuiInputBase-formControl MuiInputBase-sizeSmall MuiInputBase-adornedStart
|
||
css-71sp51-MuiInputBase-root-MuiOutlinedInput-root"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiInputAdornment-root MuiInputAdornment-positionStart
|
||
MuiInputAdornment-outlined MuiInputAdornment-sizeSmall css-1nowbqt-MuiInputAdornment-root"[39m
|
||
[36m>[39m
|
||
[36m<span[39m
|
||
[33maria-hidden[39m=[32m"true"[39m
|
||
[33mclass[39m=[32m"notranslate"[39m
|
||
[36m>[39m
|
||
[0m[0m
|
||
[36m</span>[39m
|
||
[36m<svg[39m
|
||
[33maria-hidden[39m=[32m"true"[39m
|
||
[33mclass[39m=[32m"MuiSvgIcon-root MuiSvgIcon-fontSizeSmall css-120dh41-MuiSvgIcon-root"[39m
|
||
[33mdata-testid[39m=[32m"SearchIcon"[39m
|
||
[33mfocusable[39m=[32m"false"[39m
|
||
[33mviewBox[39m=[32m"0 0 24 24"[39m
|
||
[36m>[39m
|
||
[36m<path[39m
|
||
[33md[39m=[32m"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3
|
||
5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5
|
||
5 14 7.01 14 9.5 11.99 14 9.5 14"[39m
|
||
[36m/>[39m
|
||
[36m</svg>[39m
|
||
[36m</div>[39m
|
||
[36m<input[39m
|
||
[33maria-invalid[39m=[32m"false"[39m
|
||
[33mclass[39m=[32m"MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall
|
||
MuiInputBase-inputAdornedStart css-14mk4rm-MuiInputBase-input-MuiOutlinedInput-input"[39m
|
||
[33mid[39m=[32m"_r_52_"[39m
|
||
[33mplaceholder[39m=[32m"Tittel, selskap, notater, meldinger"[39m
|
||
[33mtype[39m=[32m"text"[39m
|
||
[33mvalue[39m=[32m""[39m
|
||
[36m/>[39m
|
||
[36m<fieldset[39m
|
||
[33maria-hidden[39m=[32m"true"[39m
|
||
[33mclass[39m=[32m"MuiOutlinedInput-notchedOutline
|
||
css-18p5xg2-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"[39m
|
||
[36m>[39m
|
||
[36m<legend[39m
|
||
[33mclass[39m=[32m"css-ex8a5f-MuiNotchedOutlined-root"[39m
|
||
[36m>[39m
|
||
[36m<span>[39m
|
||
[0mSøk[0m
|
||
[36m</span>[39m
|
||
[36m</legend>[39m
|
||
[36m</fieldset>[39m
|
||
[36m</div>[39m
|
||
[36m</div>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiFormControl-root css-1f2y67v-MuiFormControl-root"[39m
|
||
[36m>[39m
|
||
[36m<label[39m
|
||
[33mclass[39m=[32m"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl
|
||
MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary
|
||
MuiFormLabel-filled MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink
|
||
MuiInputLabel-sizeSmall MuiInputLabel-outlined css-fluw5i-MuiFormLabel-root-MuiInputLabel-root"[39m
|
||
[33mdata-shrink[39m=[32m"true"[39m
|
||
[33mid[39m=[32m"job-table-status-label"[39m
|
||
[36m>[39m
|
||
[0mStatus[0m
|
||
[36m</label>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary
|
||
MuiInputBase-formControl MuiInputBase-sizeSmall MuiSelect-...
|
||
|
||
48 | render(<MemoryRouter initialEntries={[`/jobs?view=${view}`]}><I18nProvider><LanguageSwitch
|
||
/><ToastProvider><ConfirmProvider><PromptProvider><Consumer
|
||
/></PromptProvider></ConfirmProvider></ToastProvider></I18nProvider></MemoryRouter>);
|
||
49 | const label = (locale: 'en' | 'nb') => locale === 'en' ? `${count} matching ${count === 1 ? 'job' :
|
||
'jobs'}` : `${count} ${count === 1 ? 'jobb' : 'jobber'} samsvarer`;
|
||
> 50 | await screen.findByText(label(language));
|
||
| ^
|
||
51 | const calls = mockedApi.get.mock.calls.length;
|
||
52 | fireEvent.click(screen.getByRole('button', { name: 'Change language' }));
|
||
53 | await screen.findByText(label(language === 'en' ? 'nb' : 'en'));
|
||
|
||
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:163:27)
|
||
at node_modules/@testing-library/dom/dist/query-helpers.js:86:33
|
||
at findByText (src/jobs-view-integration.test.tsx:50:16)
|
||
|
||
● localised matching count: nb table 2 retains membership and changes language without job reads
|
||
|
||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||
|
||
Expected number of calls: 1
|
||
Received number of calls: 2
|
||
|
||
52 | fireEvent.click(screen.getByRole('button', { name: 'Change language' }));
|
||
53 | await screen.findByText(label(language === 'en' ? 'nb' : 'en'));
|
||
> 54 | expect(mockedApi.get).toHaveBeenCalledTimes(calls);
|
||
| ^
|
||
55 | expect(ids(view === 'board' ? '[data-kanban-card-id]' : '[data-job-row-id]', view === 'board' ?
|
||
'data-kanban-card-id' : 'data-job-row-id')).toEqual(jobs.slice(0, count).map(job => job.id));
|
||
56 | });
|
||
57 |
|
||
|
||
at toHaveBeenCalledTimes (src/jobs-view-integration.test.tsx:54:25)
|
||
|
||
● localised matching count: nb board 0 retains membership and changes language without job reads
|
||
|
||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||
|
||
Expected number of calls: 1
|
||
Received number of calls: 2
|
||
|
||
52 | fireEvent.click(screen.getByRole('button', { name: 'Change language' }));
|
||
53 | await screen.findByText(label(language === 'en' ? 'nb' : 'en'));
|
||
> 54 | expect(mockedApi.get).toHaveBeenCalledTimes(calls);
|
||
| ^
|
||
55 | expect(ids(view === 'board' ? '[data-kanban-card-id]' : '[data-job-row-id]', view === 'board' ?
|
||
'data-kanban-card-id' : 'data-job-row-id')).toEqual(jobs.slice(0, count).map(job => job.id));
|
||
56 | });
|
||
57 |
|
||
|
||
at toHaveBeenCalledTimes (src/jobs-view-integration.test.tsx:54:25)
|
||
|
||
● localised matching count: nb board 1 retains membership and changes language without job reads
|
||
|
||
Unable to find an element with the text: 1 jobb samsvarer. This could be because the text is broken up by multiple
|
||
elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
|
||
|
||
Ignored nodes: comments, script, style
|
||
[36m<body>[39m
|
||
[36m<div>[39m
|
||
[36m<button>[39m
|
||
[0mChange language[0m
|
||
[36m</button>[39m
|
||
[36m<output[39m
|
||
[33maria-label[39m=[32m"Route"[39m
|
||
[36m>[39m
|
||
[0m/jobs[0m
|
||
[0m?view=board[0m
|
||
[36m</output>[39m
|
||
[36m<button>[39m
|
||
[0mHistory back[0m
|
||
[36m</button>[39m
|
||
[36m<button>[39m
|
||
[0mHistory forward[0m
|
||
[36m</button>[39m
|
||
[36m<button>[39m
|
||
[0mJob created[0m
|
||
[36m</button>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-0"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-1g1pux1"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33maria-label[39m=[32m"Jobbvisning"[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-1utx3w7"[39m
|
||
[33mrole[39m=[32m"group"[39m
|
||
[36m>[39m
|
||
[36m<a[39m
|
||
[33mclass[39m=[32m"MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary
|
||
MuiButton-sizeSmall MuiButton-outlinedSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-outlined
|
||
MuiButton-outlinedPrimary MuiButton-sizeSmall MuiButton-outlinedSizeSmall MuiButton-colorPrimary
|
||
css-74b9is-MuiButtonBase-root-MuiButton-root"[39m
|
||
[33mdata-discover[39m=[32m"true"[39m
|
||
[33mhref[39m=[32m"/jobs?view=table"[39m
|
||
[33mtabindex[39m=[32m"0"[39m
|
||
[36m>[39m
|
||
[0mTabell[0m
|
||
[36m</a>[39m
|
||
[36m<a[39m
|
||
[33maria-current[39m=[32m"page"[39m
|
||
[33mclass[39m=[32m"MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary
|
||
MuiButton-sizeSmall MuiButton-containedSizeSmall MuiButton-colorPrimary MuiButton-root MuiButton-contained
|
||
MuiButton-containedPrimary MuiButton-sizeSmall MuiButton-containedSizeSmall MuiButton-colorPrimary
|
||
css-tm237w-MuiButtonBase-root-MuiButton-root"[39m
|
||
[33mdata-discover[39m=[32m"true"[39m
|
||
[33mhref[39m=[32m"/jobs?view=board"[39m
|
||
[33mtabindex[39m=[32m"0"[39m
|
||
[36m>[39m
|
||
[0mTavle[0m
|
||
[36m</a>[39m
|
||
[36m</div>[39m
|
||
[36m<p[39m
|
||
[33mclass[39m=[32m"MuiTypography-root MuiTypography-body2 css-1qf9eb3-MuiTypography-root"[39m
|
||
[33mrole[39m=[32m"status"[39m
|
||
[36m>[39m
|
||
[0m1 jobber samsvarer[0m
|
||
[36m</p>[39m
|
||
[36m</div>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiBox-root css-1eini8u"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiFormControl-root MuiTextField-root
|
||
css-1lssrpz-MuiFormControl-root-MuiTextField-root"[39m
|
||
[36m>[39m
|
||
[36m<label[39m
|
||
[33mclass[39m=[32m"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl
|
||
MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary
|
||
MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeSmall
|
||
MuiInputLabel-outlined css-fluw5i-MuiFormLabel-root-MuiInputLabel-root"[39m
|
||
[33mdata-shrink[39m=[32m"true"[39m
|
||
[33mfor[39m=[32m"_r_7g_"[39m
|
||
[33mid[39m=[32m"_r_7g_-label"[39m
|
||
[36m>[39m
|
||
[0mSøk[0m
|
||
[36m</label>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary
|
||
MuiInputBase-formControl MuiInputBase-sizeSmall MuiInputBase-adornedStart
|
||
css-71sp51-MuiInputBase-root-MuiOutlinedInput-root"[39m
|
||
[36m>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiInputAdornment-root MuiInputAdornment-positionStart
|
||
MuiInputAdornment-outlined MuiInputAdornment-sizeSmall css-1nowbqt-MuiInputAdornment-root"[39m
|
||
[36m>[39m
|
||
[36m<span[39m
|
||
[33maria-hidden[39m=[32m"true"[39m
|
||
[33mclass[39m=[32m"notranslate"[39m
|
||
[36m>[39m
|
||
[0m[0m
|
||
[36m</span>[39m
|
||
[36m<svg[39m
|
||
[33maria-hidden[39m=[32m"true"[39m
|
||
[33mclass[39m=[32m"MuiSvgIcon-root MuiSvgIcon-fontSizeSmall css-120dh41-MuiSvgIcon-root"[39m
|
||
[33mdata-testid[39m=[32m"SearchIcon"[39m
|
||
[33mfocusable[39m=[32m"false"[39m
|
||
[33mviewBox[39m=[32m"0 0 24 24"[39m
|
||
[36m>[39m
|
||
[36m<path[39m
|
||
[33md[39m=[32m"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3
|
||
5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5
|
||
5 14 7.01 14 9.5 11.99 14 9.5 14"[39m
|
||
[36m/>[39m
|
||
[36m</svg>[39m
|
||
[36m</div>[39m
|
||
[36m<input[39m
|
||
[33maria-invalid[39m=[32m"false"[39m
|
||
[33mclass[39m=[32m"MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall
|
||
MuiInputBase-inputAdornedStart css-14mk4rm-MuiInputBase-input-MuiOutlinedInput-input"[39m
|
||
[33mid[39m=[32m"_r_7g_"[39m
|
||
[33mplaceholder[39m=[32m"Tittel, selskap, notater, meldinger"[39m
|
||
[33mtype[39m=[32m"text"[39m
|
||
[33mvalue[39m=[32m""[39m
|
||
[36m/>[39m
|
||
[36m<fieldset[39m
|
||
[33maria-hidden[39m=[32m"true"[39m
|
||
[33mclass[39m=[32m"MuiOutlinedInput-notchedOutline
|
||
css-18p5xg2-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"[39m
|
||
[36m>[39m
|
||
[36m<legend[39m
|
||
[33mclass[39m=[32m"css-ex8a5f-MuiNotchedOutlined-root"[39m
|
||
[36m>[39m
|
||
[36m<span>[39m
|
||
[0mSøk[0m
|
||
[36m</span>[39m
|
||
[36m</legend>[39m
|
||
[36m</fieldset>[39m
|
||
[36m</div>[39m
|
||
[36m</div>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiFormControl-root css-1f2y67v-MuiFormControl-root"[39m
|
||
[36m>[39m
|
||
[36m<label[39m
|
||
[33mclass[39m=[32m"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl
|
||
MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary
|
||
MuiFormLabel-filled MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink
|
||
MuiInputLabel-sizeSmall MuiInputLabel-outlined css-fluw5i-MuiFormLabel-root-MuiInputLabel-root"[39m
|
||
[33mdata-shrink[39m=[32m"true"[39m
|
||
[33mid[39m=[32m"job-table-status-label"[39m
|
||
[36m>[39m
|
||
[0mStatus[0m
|
||
[36m</label>[39m
|
||
[36m<div[39m
|
||
[33mclass[39m=[32m"MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary
|
||
MuiInputBase-formControl MuiInputBase-sizeSmall MuiSelect-...
|
||
|
||
48 | render(<MemoryRouter initialEntries={[`/jobs?view=${view}`]}><I18nProvider><LanguageSwitch
|
||
/><ToastProvider><ConfirmProvider><PromptProvider><Consumer
|
||
/></PromptProvider></ConfirmProvider></ToastProvider></I18nProvider></MemoryRouter>);
|
||
49 | const label = (locale: 'en' | 'nb') => locale === 'en' ? `${count} matching ${count === 1 ? 'job' :
|
||
'jobs'}` : `${count} ${count === 1 ? 'jobb' : 'jobber'} samsvarer`;
|
||
> 50 | await screen.findByText(label(language));
|
||
| ^
|
||
51 | const calls = mockedApi.get.mock.calls.length;
|
||
52 | fireEvent.click(screen.getByRole('button', { name: 'Change language' }));
|
||
53 | await screen.findByText(label(language === 'en' ? 'nb' : 'en'));
|
||
|
||
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:163:27)
|
||
at node_modules/@testing-library/dom/dist/query-helpers.js:86:33
|
||
at findByText (src/jobs-view-integration.test.tsx:50:16)
|
||
|
||
● localised matching count: nb board 2 retains membership and changes language without job reads
|
||
|
||
expect(jest.fn()).toHaveBeenCalledTimes(expected)
|
||
|
||
Expected number of calls: 1
|
||
Received number of calls: 2
|
||
|
||
52 | fireEvent.click(screen.getByRole('button', { name: 'Change language' }));
|
||
53 | await screen.findByText(label(language === 'en' ? 'nb' : 'en'));
|
||
> 54 | expect(mockedApi.get).toHaveBeenCalledTimes(calls);
|
||
| ^
|
||
55 | expect(ids(view === 'board' ? '[data-kanban-card-id]' : '[data-job-row-id]', view === 'board' ?
|
||
'data-kanban-card-id' : 'data-job-row-id')).toEqual(jobs.slice(0, count).map(job => job.id));
|
||
56 | });
|
||
57 |
|
||
|
||
at toHaveBeenCalledTimes (src/jobs-view-integration.test.tsx:54:25)
|
||
|
||
Test Suites: 1 failed, 1 total
|
||
Tests: 12 failed, 6 skipped, 18 total
|
||
Snapshots: 0 total
|
||
Time: 22.791 s
|
||
Ran all test suites within paths "src/jobs-view-integration.test.tsx".
|