Files
jobtrackingapp/docs/ui-modernisation/visual-correction/evidence/matching-count/RED-initial-test-scope.txt
T

845 lines
85 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

> 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
<body>
<div>
<button>
Change language
</button>
<output
aria-label="Route"
>
/jobs
?view=table
</output>
<button>
History back
</button>
<button>
History forward
</button>
<button>
Job created
</button>
<div
class="MuiBox-root css-0"
>
<div
class="MuiBox-root css-1g1pux1"
>
<div
aria-label="Jobs view"
class="MuiBox-root css-1utx3w7"
role="group"
>
<a
aria-current="page"
class="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"
data-discover="true"
href="/jobs?view=table"
tabindex="0"
>
Table
</a>
<a
class="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"
data-discover="true"
href="/jobs?view=board"
tabindex="0"
>
Board
</a>
</div>
<p
class="MuiTypography-root MuiTypography-body2 css-1qf9eb3-MuiTypography-root"
role="status"
>
1 matching jobs
</p>
</div>
<div
class="MuiBox-root css-1eini8u"
>
<div
class="MuiFormControl-root MuiTextField-root
css-1lssrpz-MuiFormControl-root-MuiTextField-root"
>
<label
class="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"
data-shrink="true"
for="_r_s_"
id="_r_s_-label"
>
Search
</label>
<div
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary
MuiInputBase-formControl MuiInputBase-sizeSmall MuiInputBase-adornedStart
css-71sp51-MuiInputBase-root-MuiOutlinedInput-root"
>
<div
class="MuiInputAdornment-root MuiInputAdornment-positionStart
MuiInputAdornment-outlined MuiInputAdornment-sizeSmall css-1nowbqt-MuiInputAdornment-root"
>
<span
aria-hidden="true"
class="notranslate"
>
​
</span>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeSmall css-120dh41-MuiSvgIcon-root"
data-testid="SearchIcon"
focusable="false"
viewBox="0 0 24 24"
>
<path
d="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"
/>
</svg>
</div>
<input
aria-invalid="false"
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall
MuiInputBase-inputAdornedStart css-14mk4rm-MuiInputBase-input-MuiOutlinedInput-input"
id="_r_s_"
placeholder="Title, company, notes, messages"
type="text"
value=""
/>
<fieldset
aria-hidden="true"
class="MuiOutlinedInput-notchedOutline
css-18p5xg2-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-ex8a5f-MuiNotchedOutlined-root"
>
<span>
Search
</span>
</legend>
</fieldset>
</div>
</div>
<div
class="MuiFormControl-root css-1f2y67v-MuiFormControl-root"
>
<label
class="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"
data-shrink="true"
id="job-table-status-label"
>
Status
</label>
<div
class="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
<body>
<div>
<button>
Change language
</button>
<output
aria-label="Route"
>
/jobs
?view=board
</output>
<button>
History back
</button>
<button>
History forward
</button>
<button>
Job created
</button>
<div
class="MuiBox-root css-0"
>
<div
class="MuiBox-root css-1g1pux1"
>
<div
aria-label="Jobs view"
class="MuiBox-root css-1utx3w7"
role="group"
>
<a
class="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"
data-discover="true"
href="/jobs?view=table"
tabindex="0"
>
Table
</a>
<a
aria-current="page"
class="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"
data-discover="true"
href="/jobs?view=board"
tabindex="0"
>
Board
</a>
</div>
<p
class="MuiTypography-root MuiTypography-body2 css-1qf9eb3-MuiTypography-root"
role="status"
>
1 matching jobs
</p>
</div>
<div
class="MuiBox-root css-1eini8u"
>
<div
class="MuiFormControl-root MuiTextField-root
css-1lssrpz-MuiFormControl-root-MuiTextField-root"
>
<label
class="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"
data-shrink="true"
for="_r_3a_"
id="_r_3a_-label"
>
Search
</label>
<div
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary
MuiInputBase-formControl MuiInputBase-sizeSmall MuiInputBase-adornedStart
css-71sp51-MuiInputBase-root-MuiOutlinedInput-root"
>
<div
class="MuiInputAdornment-root MuiInputAdornment-positionStart
MuiInputAdornment-outlined MuiInputAdornment-sizeSmall css-1nowbqt-MuiInputAdornment-root"
>
<span
aria-hidden="true"
class="notranslate"
>
​
</span>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeSmall css-120dh41-MuiSvgIcon-root"
data-testid="SearchIcon"
focusable="false"
viewBox="0 0 24 24"
>
<path
d="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"
/>
</svg>
</div>
<input
aria-invalid="false"
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall
MuiInputBase-inputAdornedStart css-14mk4rm-MuiInputBase-input-MuiOutlinedInput-input"
id="_r_3a_"
placeholder="Title, company, notes, messages"
type="text"
value=""
/>
<fieldset
aria-hidden="true"
class="MuiOutlinedInput-notchedOutline
css-18p5xg2-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-ex8a5f-MuiNotchedOutlined-root"
>
<span>
Search
</span>
</legend>
</fieldset>
</div>
</div>
<div
class="MuiFormControl-root css-1f2y67v-MuiFormControl-root"
>
<label
class="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"
data-shrink="true"
id="job-table-status-label"
>
Status
</label>
<div
class="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
<body>
<div>
<button>
Change language
</button>
<output
aria-label="Route"
>
/jobs
?view=table
</output>
<button>
History back
</button>
<button>
History forward
</button>
<button>
Job created
</button>
<div
class="MuiBox-root css-0"
>
<div
class="MuiBox-root css-1g1pux1"
>
<div
aria-label="Jobbvisning"
class="MuiBox-root css-1utx3w7"
role="group"
>
<a
aria-current="page"
class="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"
data-discover="true"
href="/jobs?view=table"
tabindex="0"
>
Tabell
</a>
<a
class="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"
data-discover="true"
href="/jobs?view=board"
tabindex="0"
>
Tavle
</a>
</div>
<p
class="MuiTypography-root MuiTypography-body2 css-1qf9eb3-MuiTypography-root"
role="status"
>
1 jobber samsvarer
</p>
</div>
<div
class="MuiBox-root css-1eini8u"
>
<div
class="MuiFormControl-root MuiTextField-root
css-1lssrpz-MuiFormControl-root-MuiTextField-root"
>
<label
class="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"
data-shrink="true"
for="_r_52_"
id="_r_52_-label"
>
Søk
</label>
<div
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary
MuiInputBase-formControl MuiInputBase-sizeSmall MuiInputBase-adornedStart
css-71sp51-MuiInputBase-root-MuiOutlinedInput-root"
>
<div
class="MuiInputAdornment-root MuiInputAdornment-positionStart
MuiInputAdornment-outlined MuiInputAdornment-sizeSmall css-1nowbqt-MuiInputAdornment-root"
>
<span
aria-hidden="true"
class="notranslate"
>
​
</span>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeSmall css-120dh41-MuiSvgIcon-root"
data-testid="SearchIcon"
focusable="false"
viewBox="0 0 24 24"
>
<path
d="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"
/>
</svg>
</div>
<input
aria-invalid="false"
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall
MuiInputBase-inputAdornedStart css-14mk4rm-MuiInputBase-input-MuiOutlinedInput-input"
id="_r_52_"
placeholder="Tittel, selskap, notater, meldinger"
type="text"
value=""
/>
<fieldset
aria-hidden="true"
class="MuiOutlinedInput-notchedOutline
css-18p5xg2-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-ex8a5f-MuiNotchedOutlined-root"
>
<span>
Søk
</span>
</legend>
</fieldset>
</div>
</div>
<div
class="MuiFormControl-root css-1f2y67v-MuiFormControl-root"
>
<label
class="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"
data-shrink="true"
id="job-table-status-label"
>
Status
</label>
<div
class="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
<body>
<div>
<button>
Change language
</button>
<output
aria-label="Route"
>
/jobs
?view=board
</output>
<button>
History back
</button>
<button>
History forward
</button>
<button>
Job created
</button>
<div
class="MuiBox-root css-0"
>
<div
class="MuiBox-root css-1g1pux1"
>
<div
aria-label="Jobbvisning"
class="MuiBox-root css-1utx3w7"
role="group"
>
<a
class="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"
data-discover="true"
href="/jobs?view=table"
tabindex="0"
>
Tabell
</a>
<a
aria-current="page"
class="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"
data-discover="true"
href="/jobs?view=board"
tabindex="0"
>
Tavle
</a>
</div>
<p
class="MuiTypography-root MuiTypography-body2 css-1qf9eb3-MuiTypography-root"
role="status"
>
1 jobber samsvarer
</p>
</div>
<div
class="MuiBox-root css-1eini8u"
>
<div
class="MuiFormControl-root MuiTextField-root
css-1lssrpz-MuiFormControl-root-MuiTextField-root"
>
<label
class="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"
data-shrink="true"
for="_r_7g_"
id="_r_7g_-label"
>
Søk
</label>
<div
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary
MuiInputBase-formControl MuiInputBase-sizeSmall MuiInputBase-adornedStart
css-71sp51-MuiInputBase-root-MuiOutlinedInput-root"
>
<div
class="MuiInputAdornment-root MuiInputAdornment-positionStart
MuiInputAdornment-outlined MuiInputAdornment-sizeSmall css-1nowbqt-MuiInputAdornment-root"
>
<span
aria-hidden="true"
class="notranslate"
>
​
</span>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeSmall css-120dh41-MuiSvgIcon-root"
data-testid="SearchIcon"
focusable="false"
viewBox="0 0 24 24"
>
<path
d="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"
/>
</svg>
</div>
<input
aria-invalid="false"
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall
MuiInputBase-inputAdornedStart css-14mk4rm-MuiInputBase-input-MuiOutlinedInput-input"
id="_r_7g_"
placeholder="Tittel, selskap, notater, meldinger"
type="text"
value=""
/>
<fieldset
aria-hidden="true"
class="MuiOutlinedInput-notchedOutline
css-18p5xg2-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-ex8a5f-MuiNotchedOutlined-root"
>
<span>
Søk
</span>
</legend>
</fieldset>
</div>
</div>
<div
class="MuiFormControl-root css-1f2y67v-MuiFormControl-root"
>
<label
class="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"
data-shrink="true"
id="job-table-status-label"
>
Status
</label>
<div
class="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".