221 lines
10 KiB
Plaintext
221 lines
10 KiB
Plaintext
|
|
> job-tracker-ui@0.1.0 test
|
|
> jest --runInBand job-export-lifetime.test.tsx
|
|
|
|
FAIL src/job-export-lifetime.test.tsx (10.566 s)
|
|
● en conversion distinguishes zero, one and multiple rows
|
|
|
|
Unable to find an element with the text: Converted 1 row to import JSON.. 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>
|
|
<section
|
|
aria-labelledby="_r_2b_"
|
|
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_2b_"
|
|
>
|
|
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>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</body>
|
|
|
|
104 | await act(async () => fireEvent.change(document.querySelector('input[accept=".csv,text/csv"]')!, { target: { files: [file] } }));
|
|
105 | const message = language === "en" ? `Converted ${count} ${count === 1 ? "row" : "rows"} to import JSON.` : `Konverterte ${count} ${count === 1 ? "rad" : "rader"} til import-JSON.`;
|
|
> 106 | expect(await screen.findByText(message)).toBeVisible();
|
|
| ^
|
|
107 | }
|
|
108 | expect(download).toHaveBeenCalledTimes(3); expect(client.post).not.toHaveBeenCalled();
|
|
109 | });
|
|
|
|
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-export-lifetime.test.tsx:106:25)
|
|
|
|
● nb conversion distinguishes zero, one and multiple rows
|
|
|
|
Unable to find an element with the text: Konverterte 1 rad til import-JSON.. 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>
|
|
<section
|
|
aria-labelledby="_r_2h_"
|
|
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_2h_"
|
|
>
|
|
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>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</body>
|
|
|
|
104 | await act(async () => fireEvent.change(document.querySelector('input[accept=".csv,text/csv"]')!, { target: { files: [file] } }));
|
|
105 | const message = language === "en" ? `Converted ${count} ${count === 1 ? "row" : "rows"} to import JSON.` : `Konverterte ${count} ${count === 1 ? "rad" : "rader"} til import-JSON.`;
|
|
> 106 | expect(await screen.findByText(message)).toBeVisible();
|
|
| ^
|
|
107 | }
|
|
108 | expect(download).toHaveBeenCalledTimes(3); expect(client.post).not.toHaveBeenCalled();
|
|
109 | });
|
|
|
|
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-export-lifetime.test.tsx:106:25)
|
|
|
|
Test Suites: 1 failed, 1 total
|
|
Tests: 2 failed, 14 passed, 16 total
|
|
Snapshots: 0 total
|
|
Time: 11.391 s
|
|
Ran all test suites matching job-export-lifetime.test.tsx.
|