Files
jobtrackingapp/docs/i18n/evidence/shared-widgets/RED.txt
T

282 lines
11 KiB
Plaintext

> job-tracker-ui@0.1.0 test
> jest --runInBand date-picker-localisation.test.tsx
FAIL src/date-picker-localisation.test.tsx
● shared widget controls follow live UI language without losing selection or dark theme
TestingLibraryElementError: Unable to find an accessible element with the role "button" and name "Åpne"
Here are the accessible roles:
textbox:
Name "Unsaved title":
<input
aria-label="Unsaved title"
value="Teacher draft"
/>
--------------------------------------------------
button:
Name "Bokmål":
<button />
Name "English":
<button />
Name "Velg dato, valgt dato er 23. nov. 2026":
<button
aria-label="Velg dato, valgt dato er 23. nov. 2026"
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-edgeEnd MuiIconButton-sizeMedium css-bspctt-MuiButtonBase-root-MuiIconButton-root"
tabindex="0"
type="button"
/>
Name "Open":
<button
aria-label="Open"
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeMedium MuiAutocomplete-popupIndicator css-2z5gju-MuiButtonBase-root-MuiIconButton-root-MuiAutocomplete-popupIndicator"
tabindex="-1"
title="Open"
type="button"
/>
--------------------------------------------------
group:
Name "Deadline":
<div
aria-invalid="false"
aria-labelledby="_r_8_-label"
class="MuiPickersInputBase-root MuiPickersOutlinedInput-root MuiPickersInputBase-colorPrimary MuiPickersInputBase-adornedEnd css-18u0f3-MuiPickersInputBase-root-MuiPickersOutlinedInput-root"
role="group"
/>
--------------------------------------------------
spinbutton:
Name "Dag":
<span
aria-disabled="false"
aria-label="Dag"
aria-readonly="false"
aria-valuemax="30"
aria-valuemin="1"
aria-valuenow="23"
aria-valuetext="23."
autocapitalize="none"
autocorrect="off"
class="MuiPickersSectionList-sectionContent MuiPickersInputBase-sectionContent css-15k54eh-MuiPickersSectionList-sectionContent-MuiPickersInputBase-sectionContent"
contenteditable="true"
inputmode="numeric"
role="spinbutton"
spellcheck="false"
tabindex="0"
/>
Name "Måned":
<span
aria-disabled="false"
aria-label="Måned"
aria-readonly="false"
aria-valuemax="12"
aria-valuemin="1"
aria-valuenow="11"
aria-valuetext="november"
autocapitalize="none"
autocorrect="off"
class="MuiPickersSectionList-sectionContent MuiPickersInputBase-sectionContent css-15k54eh-MuiPickersSectionList-sectionContent-MuiPickersInputBase-sectionContent"
contenteditable="true"
inputmode="numeric"
role="spinbutton"
spellcheck="false"
tabindex="-1"
/>
Name "År":
<span
aria-disabled="false"
aria-label="År"
aria-readonly="false"
aria-valuemax="9999"
aria-valuemin="0"
aria-valuenow="2026"
autocapitalize="none"
autocorrect="off"
class="MuiPickersSectionList-sectionContent MuiPickersInputBase-sectionContent css-15k54eh-MuiPickersSectionList-sectionContent-MuiPickersInputBase-sectionContent"
contenteditable="true"
inputmode="numeric"
role="spinbutton"
spellcheck="false"
tabindex="-1"
/>
--------------------------------------------------
combobox:
Name "Occupation":
<input
aria-autocomplete="list"
aria-expanded="false"
aria-invalid="false"
autocapitalize="none"
autocomplete="off"
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall MuiInputBase-inputAdornedEnd MuiAutocomplete-input MuiAutocomplete-inputFocused css-mf5los-MuiInputBase-input-MuiOutlinedInput-input"
id="_r_b_"
role="combobox"
spellcheck="false"
type="text"
value="Teacher"
/>
--------------------------------------------------
Ignored nodes: comments, script, style
<body>
<div>
<input
aria-label="Unsaved title"
value="Teacher draft"
/>
<button>
Bokmål
</button>
<button>
English
</button>
<div
class="MuiFormControl-root MuiPickersTextField-root css-eqc3kq-MuiFormControl-root-MuiPickersTextField-root"
>
<label
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiFormLabel-filled MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-outlined css-1rpfqai-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="true"
for="_r_8_"
id="_r_8_-label"
>
Deadline
</label>
<div
aria-invalid="false"
aria-labelledby="_r_8_-label"
class="MuiPickersInputBase-root MuiPickersOutlinedInput-root MuiPickersInputBase-colorPrimary MuiPickersInputBase-adornedEnd css-18u0f3-MuiPickersInputBase-root-MuiPickersOutlinedInput-root"
role="group"
>
<div
class="MuiPickersSectionList-root MuiPickersInputBase-sectionsContainer css-1pzdbd7-MuiPickersSectionList-root-MuiPickersInputBase-sectionsContainer-MuiPickersOutlinedInput-sectionsContainer"
contenteditable="false"
tabindex="0"
>
<span
class="MuiPickersSectionList-section css-efy5wg-MuiPickersSectionList-section-MuiPickersInputBase-section"
data-sectionindex="0"
>
<span
class="MuiPickersInputBase-sectionBefore css-w1q93y-MuiPickersSectionList-sectionSeparator-MuiPickersInputBase-separator"
/>
<span
aria-disabled="false"
aria-label="Dag"
aria-readonly="false"
aria-valuemax="30"
aria-valuemin="1"
aria-valuenow="23"
aria-valuetext="23."
autocapitalize="none"
autocorrect="off"
class="MuiPickersSectionList-sectionContent MuiPickersInputBase-sectionContent css-15k54eh-MuiPickersSectionList-sectionContent-MuiPickersInputBase-sectionContent"
contenteditable="true"
inputmode="numeric"
role="spinbutton"
spellcheck="false"
tabindex="0"
>
23
</span>
<span
class="MuiPickersInputBase-sectionAfter css-w1q93y-MuiPickersSectionList-sectionSeparator-MuiPickersInputBase-separator"
>
.
</span>
</span>
<span
class="MuiPickersSectionList-section css-efy5wg-MuiPickersSectionList-section-MuiPickersInputBase-section"
data-sectionindex="1"
>
<span
class="MuiPickersInputBase-sectionBefore css-w1q93y-MuiPickersSectionList-sectionSeparator-MuiPickersInputBase-separator"
/>
<span
aria-disabled="false"
aria-label="Måned"
aria-readonly="false"
aria-valuemax="12"
aria-valuemin="1"
aria-valuenow="11"
aria-valuetext="november"
autocapitalize="none"
autocorrect="off"
class="MuiPickersSectionList-sectionContent MuiPickersInputBase-sectionContent css-15k54eh-MuiPickersSectionList-sectionContent-MuiPickersInputBase-sectionContent"
contenteditable="true"
inputmode="numeric"
role="spinbutton"
spellcheck="false"
tabindex="-1"
>
11
</span>
<span
class="MuiPickersInputBase-sectionAfter css-w1q93y-MuiPickersSectionList-sectionSeparator-MuiPickersInputBase-separator"
>
.
</span>
</span>
<span
class="MuiPickersSectionList-section css-efy5wg-MuiPickersSectionList-section-MuiPickersInputBase-section"
data-sectionindex="2"
>
<span
class="MuiPickersInputBase-sectionBefore css-w1q93y-MuiPickersSectionList-sectionSeparator-MuiPickersInputBase-separator"
/>
<span
aria-disabled="false"
aria-label="År"
aria-readonly="false"
aria-valuemax="9999"
aria-valuemin="0"
aria-valuenow="2026"
autocapitalize="none"
autocorrect="off"
class="MuiPickersSectionList-sectionContent MuiPickersInputBase-sectionContent css-15k54eh-MuiPickersSectionList-sectionContent-MuiPickersInputBase-sectionContent"
contenteditable="true"
inputmode="numeric"
role="spinbutton"
spellcheck="false"
tabindex="-1"
>
2026
</span>
<span
class="MuiPickersInputBase-sectionAfter css-w1q93y-MuiP...
35 | localStorage.setItem("uiLanguage", "nb");
36 | render(<JobTrackerThemeProvider preference="dark" systemPrefersDark={false}><I18nProvider><DateLocalizationProvider><Form /></DateLocalizationProvider></I18nProvider></JobTrackerThemeProvider>);
> 37 | expect(screen.getByRole("button", { name: "Åpne" })).toBeInTheDocument();
| ^
38 | expect(screen.getByRole("button", { name: "Tøm" })).toBeInTheDocument();
39 | const occupation = screen.getByRole("combobox", { name: "Occupation" });
40 | expect(occupation).toHaveValue("Teacher");
at Object.getElementError (node_modules/@testing-library/dom/dist/config.js:37:19)
at node_modules/@testing-library/dom/dist/query-helpers.js:76:38
at node_modules/@testing-library/dom/dist/query-helpers.js:52:17
at node_modules/@testing-library/dom/dist/query-helpers.js:95:19
at Object.getByRole (src/date-picker-localisation.test.tsx:37:17)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 2 passed, 3 total
Snapshots: 0 total
Time: 4.698 s
Ran all test suites matching date-picker-localisation.test.tsx.