239 lines
11 KiB
Plaintext
239 lines
11 KiB
Plaintext
|
|
> job-tracker-ui@0.1.0 test
|
|
> jest --runInBand job-import.test.tsx
|
|
|
|
FAIL src/job-import.test.tsx (11.145 s)
|
|
● en import feedback distinguishes one job from multiple jobs
|
|
|
|
Unable to find an element with the text: Imported 1 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>
|
|
Toggle import panel
|
|
</button>
|
|
<section
|
|
aria-labelledby="_r_0_"
|
|
class="MuiBox-root css-s8beop"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-163u82n"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h3
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-uf4832-MuiTypography-root"
|
|
id="_r_0_"
|
|
>
|
|
Import / Export
|
|
</h3>
|
|
<p
|
|
class="MuiTypography-root MuiTypography-pageDescription css-1sqgc3a-MuiTypography-root"
|
|
>
|
|
Import expects the JSON exported by this app (an array of job objects with embedded company).
|
|
</p>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<div
|
|
aria-busy="false"
|
|
aria-label="Import / Export"
|
|
class="MuiBox-root css-dtwbgt"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body2 css-1qf9eb3-MuiTypography-root"
|
|
>
|
|
Imports create new jobs from supported fields. IDs, owners, history, attachments and CV associations are not restored. Keep Settings open until the import finishes. If you leave, the import may be incomplete.
|
|
</p>
|
|
<div
|
|
class="MuiBox-root css-14qhqxr"
|
|
>
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-colorPrimary css-1g6yn02-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
>
|
|
Export JSON
|
|
</button>
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-colorPrimary css-1g6yn02-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
>
|
|
Export CSV
|
|
</button>
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-83fk99-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
>
|
|
Import JSON
|
|
</button>
|
|
<input
|
|
accept="application/json"
|
|
hidden=""
|
|
type="file"
|
|
/>
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-colorPrimary css-1g6yn02-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
>
|
|
Convert CSV to Import JSON
|
|
</button>
|
|
<input
|
|
accept=".csv,text/csv"
|
|
hidden=""
|
|
type="file"
|
|
/>
|
|
</div>
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body2 css-1qf9eb3-MuiTypography-root"
|
|
role="status"
|
|
>
|
|
Last import: 1
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</body>
|
|
|
|
60 | await select(selectedFile(Array.from({ length: count }, (_, i) => row(`Synthetic role ${i + 1}`))));
|
|
61 | const message = language === "en" ? `Imported ${count} ${count === 1 ? "job" : "jobs"}.` : `Importerte ${count} ${count === 1 ? "jobb" : "jobber"}.`;
|
|
> 62 | expect(await screen.findByText(message)).toBeVisible();
|
|
| ^
|
|
63 | }
|
|
64 | expect(mockedApi.post).toHaveBeenCalledTimes(6);
|
|
65 | });
|
|
|
|
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/job-import.test.tsx:62:25)
|
|
|
|
● nb import feedback distinguishes one job from multiple jobs
|
|
|
|
Unable to find an element with the text: Importerte 1 jobb.. 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>
|
|
Toggle import panel
|
|
</button>
|
|
<section
|
|
aria-labelledby="_r_6_"
|
|
class="MuiBox-root css-s8beop"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-163u82n"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h3
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-uf4832-MuiTypography-root"
|
|
id="_r_6_"
|
|
>
|
|
Import / eksport
|
|
</h3>
|
|
<p
|
|
class="MuiTypography-root MuiTypography-pageDescription css-1sqgc3a-MuiTypography-root"
|
|
>
|
|
Import forventer JSON eksportert av denne appen (en matrise med jobbobjekter med innebygd selskap).
|
|
</p>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<div
|
|
aria-busy="false"
|
|
aria-label="Import / eksport"
|
|
class="MuiBox-root css-dtwbgt"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body2 css-1qf9eb3-MuiTypography-root"
|
|
>
|
|
Import oppretter nye jobber fra støttede felt. ID-er, eiere, historikk, vedlegg og CV-koblinger gjenopprettes ikke. Hold Innstillinger åpent til importen er ferdig. Hvis du går ut, kan importen bli ufullstendig.
|
|
</p>
|
|
<div
|
|
class="MuiBox-root css-14qhqxr"
|
|
>
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-colorPrimary css-1g6yn02-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
>
|
|
Eksporter JSON
|
|
</button>
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-colorPrimary css-1g6yn02-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
>
|
|
Eksporter CSV
|
|
</button>
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-83fk99-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
>
|
|
Importer JSON
|
|
</button>
|
|
<input
|
|
accept="application/json"
|
|
hidden=""
|
|
type="file"
|
|
/>
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-outlined MuiButton-outlinedPrimary MuiButton-sizeMedium MuiButton-outlinedSizeMedium MuiButton-colorPrimary css-1g6yn02-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
>
|
|
Konverter CSV til import-JSON
|
|
</button>
|
|
<input
|
|
accept=".csv,text/csv"
|
|
hidden=""
|
|
type="file"
|
|
/>
|
|
</div>
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body2 css-1qf9eb3-MuiTypography-root"
|
|
role="status"
|
|
>
|
|
Siste import: 1
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</body>
|
|
|
|
60 | await select(selectedFile(Array.from({ length: count }, (_, i) => row(`Synthetic role ${i + 1}`))));
|
|
61 | const message = language === "en" ? `Imported ${count} ${count === 1 ? "job" : "jobs"}.` : `Importerte ${count} ${count === 1 ? "jobb" : "jobber"}.`;
|
|
> 62 | expect(await screen.findByText(message)).toBeVisible();
|
|
| ^
|
|
63 | }
|
|
64 | expect(mockedApi.post).toHaveBeenCalledTimes(6);
|
|
65 | });
|
|
|
|
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/job-import.test.tsx:62:25)
|
|
|
|
Test Suites: 1 failed, 1 total
|
|
Tests: 2 failed, 11 passed, 13 total
|
|
Snapshots: 0 total
|
|
Time: 11.99 s
|
|
Ran all test suites matching job-import.test.tsx.
|