3736 lines
160 KiB
Plaintext
3736 lines
160 KiB
Plaintext
FAIL src/admin-users-page.test.tsx (20.002 s)
|
|
● pending admin confirmation mobile=true demote self follows en to nb without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Fjern din egen administratortilgang?"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Remove your own administrator access?":
|
|
<div
|
|
aria-describedby="_r_1_"
|
|
aria-labelledby="_r_2_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Remove your own administrator access?":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_2_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Remove your own administrator access?":
|
|
<div
|
|
aria-labelledby="_r_2_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_1_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Avbryt":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Remove admin":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Brukere"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
Den siste administratoren er beskyttet. Fjerning av din egen administratorrolle krever uttrykkelig bekreftelse.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_4_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_4_"
|
|
>
|
|
Opprett bruker
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_5_"
|
|
id="_r_5_-label"
|
|
>
|
|
E-post
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_5_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
E-post
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_6_"
|
|
id="_r_6_-label"
|
|
>
|
|
Nytt passord
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_6_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=true demote self follows nb to en without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Remove your own administrator access?"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Fjern din egen administratortilgang?":
|
|
<div
|
|
aria-describedby="_r_f_"
|
|
aria-labelledby="_r_g_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Fjern din egen administratortilgang?":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_g_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Fjern din egen administratortilgang?":
|
|
<div
|
|
aria-labelledby="_r_g_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_f_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Cancel":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Fjern admin":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Users"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
The final administrator is protected. Removing your own administrator role requires explicit confirmation.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_i_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_i_"
|
|
>
|
|
Create user
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_j_"
|
|
id="_r_j_-label"
|
|
>
|
|
Email
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_j_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
Email
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_k_"
|
|
id="_r_k_-label"
|
|
>
|
|
New password
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_k_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
ari...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=true demote other follows en to nb without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Fjern administratortilgang"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Remove administrator access":
|
|
<div
|
|
aria-describedby="_r_t_"
|
|
aria-labelledby="_r_u_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Remove administrator access":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_u_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Remove administrator access":
|
|
<div
|
|
aria-labelledby="_r_u_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_t_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Avbryt":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Remove admin":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Brukere"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
Den siste administratoren er beskyttet. Fjerning av din egen administratorrolle krever uttrykkelig bekreftelse.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_10_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_10_"
|
|
>
|
|
Opprett bruker
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_11_"
|
|
id="_r_11_-label"
|
|
>
|
|
E-post
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_11_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
E-post
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_12_"
|
|
id="_r_12_-label"
|
|
>
|
|
Nytt passord
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_12_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=true demote other follows nb to en without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Remove administrator access"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Fjern administratortilgang":
|
|
<div
|
|
aria-describedby="_r_1b_"
|
|
aria-labelledby="_r_1c_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Fjern administratortilgang":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_1c_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Fjern administratortilgang":
|
|
<div
|
|
aria-labelledby="_r_1c_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_1b_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Cancel":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Fjern admin":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Users"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
The final administrator is protected. Removing your own administrator role requires explicit confirmation.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_1e_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_1e_"
|
|
>
|
|
Create user
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_1f_"
|
|
id="_r_1f_-label"
|
|
>
|
|
Email
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_1f_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
Email
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_1g_"
|
|
id="_r_1g_-label"
|
|
>
|
|
New password
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_1g_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=true delete self follows en to nb without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Slett bruker"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Delete user":
|
|
<div
|
|
aria-describedby="_r_1p_"
|
|
aria-labelledby="_r_1q_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Delete user":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_1q_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Delete user":
|
|
<div
|
|
aria-labelledby="_r_1q_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_1p_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Avbryt":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Delete":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Brukere"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
Den siste administratoren er beskyttet. Fjerning av din egen administratorrolle krever uttrykkelig bekreftelse.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_1s_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_1s_"
|
|
>
|
|
Opprett bruker
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_1t_"
|
|
id="_r_1t_-label"
|
|
>
|
|
E-post
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_1t_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
E-post
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_1u_"
|
|
id="_r_1u_-label"
|
|
>
|
|
Nytt passord
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_1u_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=true delete self follows nb to en without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Delete user"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Slett bruker":
|
|
<div
|
|
aria-describedby="_r_27_"
|
|
aria-labelledby="_r_28_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Slett bruker":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_28_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Slett bruker":
|
|
<div
|
|
aria-labelledby="_r_28_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_27_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Cancel":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Slett":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Users"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
The final administrator is protected. Removing your own administrator role requires explicit confirmation.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_2a_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_2a_"
|
|
>
|
|
Create user
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_2b_"
|
|
id="_r_2b_-label"
|
|
>
|
|
Email
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_2b_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
Email
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_2c_"
|
|
id="_r_2c_-label"
|
|
>
|
|
New password
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_2c_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=true delete other follows en to nb without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Slett bruker"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Delete user":
|
|
<div
|
|
aria-describedby="_r_2l_"
|
|
aria-labelledby="_r_2m_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Delete user":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_2m_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Delete user":
|
|
<div
|
|
aria-labelledby="_r_2m_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_2l_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Avbryt":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Delete":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Brukere"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
Den siste administratoren er beskyttet. Fjerning av din egen administratorrolle krever uttrykkelig bekreftelse.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_2o_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_2o_"
|
|
>
|
|
Opprett bruker
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_2p_"
|
|
id="_r_2p_-label"
|
|
>
|
|
E-post
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_2p_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
E-post
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_2q_"
|
|
id="_r_2q_-label"
|
|
>
|
|
Nytt passord
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_2q_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=true delete other follows nb to en without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Delete user"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Slett bruker":
|
|
<div
|
|
aria-describedby="_r_33_"
|
|
aria-labelledby="_r_34_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Slett bruker":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_34_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Slett bruker":
|
|
<div
|
|
aria-labelledby="_r_34_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_33_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Cancel":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Slett":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Users"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
The final administrator is protected. Removing your own administrator role requires explicit confirmation.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_36_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_36_"
|
|
>
|
|
Create user
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_37_"
|
|
id="_r_37_-label"
|
|
>
|
|
Email
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_37_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
Email
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_38_"
|
|
id="_r_38_-label"
|
|
>
|
|
New password
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_38_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=false demote self follows en to nb without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Fjern din egen administratortilgang?"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Remove your own administrator access?":
|
|
<div
|
|
aria-describedby="_r_3h_"
|
|
aria-labelledby="_r_3i_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Remove your own administrator access?":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_3i_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Remove your own administrator access?":
|
|
<div
|
|
aria-labelledby="_r_3i_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_3h_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Avbryt":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Remove admin":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Brukere"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
Den siste administratoren er beskyttet. Fjerning av din egen administratorrolle krever uttrykkelig bekreftelse.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_3k_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_3k_"
|
|
>
|
|
Opprett bruker
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_3l_"
|
|
id="_r_3l_-label"
|
|
>
|
|
E-post
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_3l_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
E-post
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_3m_"
|
|
id="_r_3m_-label"
|
|
>
|
|
Nytt passord
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_3m_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=false demote self follows nb to en without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Remove your own administrator access?"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Fjern din egen administratortilgang?":
|
|
<div
|
|
aria-describedby="_r_53_"
|
|
aria-labelledby="_r_54_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Fjern din egen administratortilgang?":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_54_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Fjern din egen administratortilgang?":
|
|
<div
|
|
aria-labelledby="_r_54_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_53_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Cancel":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Fjern admin":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Users"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
The final administrator is protected. Removing your own administrator role requires explicit confirmation.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_56_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_56_"
|
|
>
|
|
Create user
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_57_"
|
|
id="_r_57_-label"
|
|
>
|
|
Email
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_57_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
Email
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_58_"
|
|
id="_r_58_-label"
|
|
>
|
|
New password
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_58_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=false demote other follows en to nb without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Fjern administratortilgang"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Remove administrator access":
|
|
<div
|
|
aria-describedby="_r_6l_"
|
|
aria-labelledby="_r_6m_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Remove administrator access":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_6m_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Remove administrator access":
|
|
<div
|
|
aria-labelledby="_r_6m_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_6l_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Avbryt":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Remove admin":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Brukere"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
Den siste administratoren er beskyttet. Fjerning av din egen administratorrolle krever uttrykkelig bekreftelse.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_6o_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_6o_"
|
|
>
|
|
Opprett bruker
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_6p_"
|
|
id="_r_6p_-label"
|
|
>
|
|
E-post
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_6p_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
E-post
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_6q_"
|
|
id="_r_6q_-label"
|
|
>
|
|
Nytt passord
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_6q_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=false demote other follows nb to en without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Remove administrator access"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Fjern administratortilgang":
|
|
<div
|
|
aria-describedby="_r_87_"
|
|
aria-labelledby="_r_88_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Fjern administratortilgang":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_88_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Fjern administratortilgang":
|
|
<div
|
|
aria-labelledby="_r_88_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_87_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Cancel":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Fjern admin":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Users"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
The final administrator is protected. Removing your own administrator role requires explicit confirmation.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_8a_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_8a_"
|
|
>
|
|
Create user
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_8b_"
|
|
id="_r_8b_-label"
|
|
>
|
|
Email
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_8b_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
Email
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_8c_"
|
|
id="_r_8c_-label"
|
|
>
|
|
New password
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_8c_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=false delete self follows en to nb without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Slett bruker"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Delete user":
|
|
<div
|
|
aria-describedby="_r_9p_"
|
|
aria-labelledby="_r_9q_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Delete user":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_9q_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Delete user":
|
|
<div
|
|
aria-labelledby="_r_9q_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_9p_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Avbryt":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Delete":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Brukere"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
Den siste administratoren er beskyttet. Fjerning av din egen administratorrolle krever uttrykkelig bekreftelse.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_9s_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_9s_"
|
|
>
|
|
Opprett bruker
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_9t_"
|
|
id="_r_9t_-label"
|
|
>
|
|
E-post
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_9t_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
E-post
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_9u_"
|
|
id="_r_9u_-label"
|
|
>
|
|
Nytt passord
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_9u_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=false delete self follows nb to en without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Delete user"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Slett bruker":
|
|
<div
|
|
aria-describedby="_r_bb_"
|
|
aria-labelledby="_r_bc_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Slett bruker":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_bc_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Slett bruker":
|
|
<div
|
|
aria-labelledby="_r_bc_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_bb_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Cancel":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Slett":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Users"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
The final administrator is protected. Removing your own administrator role requires explicit confirmation.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_be_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_be_"
|
|
>
|
|
Create user
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_bf_"
|
|
id="_r_bf_-label"
|
|
>
|
|
Email
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_bf_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
Email
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_bg_"
|
|
id="_r_bg_-label"
|
|
>
|
|
New password
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_bg_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=false delete other follows en to nb without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Slett bruker"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Delete user":
|
|
<div
|
|
aria-describedby="_r_ct_"
|
|
aria-labelledby="_r_cu_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Delete user":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_cu_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Delete user":
|
|
<div
|
|
aria-labelledby="_r_cu_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_ct_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Avbryt":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Delete":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Brukere"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
Den siste administratoren er beskyttet. Fjerning av din egen administratorrolle krever uttrykkelig bekreftelse.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_d0_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_d0_"
|
|
>
|
|
Opprett bruker
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_d1_"
|
|
id="_r_d1_-label"
|
|
>
|
|
E-post
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_d1_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
E-post
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_d2_"
|
|
id="_r_d2_-label"
|
|
>
|
|
Nytt passord
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_d2_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
● pending admin confirmation mobile=false delete other follows nb to en without applying it
|
|
|
|
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Delete user"
|
|
|
|
Here are the accessible roles:
|
|
|
|
presentation:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-root MuiModal-root css-5d7h14-MuiModal-root-MuiDialog-root"
|
|
role="presentation"
|
|
/>
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiDialog-container MuiDialog-scrollPaper css-45uc01-MuiDialog-container"
|
|
role="presentation"
|
|
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
|
|
tabindex="-1"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
dialog:
|
|
|
|
Name "Slett bruker":
|
|
<div
|
|
aria-describedby="_r_ef_"
|
|
aria-labelledby="_r_eg_"
|
|
aria-modal="true"
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-1slaqm0-MuiPaper-root-MuiDialog-paper"
|
|
role="dialog"
|
|
style="--Paper-shadow: var(--shadows-24); --Paper-overlay: var(--overlays-24);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
heading:
|
|
|
|
Name "Slett bruker":
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-13kidcb-MuiTypography-root-MuiDialogTitle-root"
|
|
id="_r_eg_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
region:
|
|
|
|
Name "Slett bruker":
|
|
<div
|
|
aria-labelledby="_r_eg_"
|
|
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
|
|
role="region"
|
|
tabindex="0"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
alert:
|
|
|
|
Name "":
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorWarning MuiAlert-outlinedWarning MuiAlert-outlined css-ld2gtz-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
paragraph:
|
|
|
|
Name "":
|
|
<p
|
|
class="MuiTypography-root MuiTypography-body1 css-1tibhyu-MuiTypography-root"
|
|
id="_r_ef_"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
button:
|
|
|
|
Name "Cancel":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary Mui-focusVisible MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1w0ggox-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
Name "Slett":
|
|
<button
|
|
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError MuiButton-root MuiButton-contained MuiButton-containedError MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorError css-1583z29-MuiButtonBase-root-MuiButton-root"
|
|
tabindex="0"
|
|
type="button"
|
|
/>
|
|
|
|
--------------------------------------------------
|
|
|
|
Ignored nodes: comments, script, style
|
|
<body
|
|
style="padding-right: 1024px; overflow: hidden;"
|
|
>
|
|
<div
|
|
aria-hidden="true"
|
|
>
|
|
<div
|
|
aria-busy="true"
|
|
aria-label="Users"
|
|
class="MuiBox-root css-1pt1ae"
|
|
role="group"
|
|
tabindex="-1"
|
|
>
|
|
<div
|
|
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-standardInfo MuiAlert-standard css-cc6lo2-MuiPaper-root-MuiAlert-root"
|
|
role="alert"
|
|
style="--Paper-shadow: var(--shadows-0); --Paper-overlay: var(--overlays-0);"
|
|
>
|
|
<div
|
|
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-8hoymy-MuiSvgIcon-root"
|
|
data-testid="InfoOutlinedIcon"
|
|
focusable="false"
|
|
viewBox="0 0 24 24"
|
|
>
|
|
<path
|
|
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
<div
|
|
class="MuiAlert-message css-zioonp-MuiAlert-message"
|
|
>
|
|
The final administrator is protected. Removing your own administrator role requires explicit confirmation.
|
|
</div>
|
|
</div>
|
|
<section
|
|
aria-labelledby="_r_ei_"
|
|
class="MuiBox-root css-agrbqe"
|
|
>
|
|
<header
|
|
class="MuiBox-root css-ekq74m"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-14m33b5"
|
|
>
|
|
<h2
|
|
class="MuiTypography-root MuiTypography-sectionTitle css-1ebwfki-MuiTypography-root"
|
|
id="_r_ei_"
|
|
>
|
|
Create user
|
|
</h2>
|
|
</div>
|
|
</header>
|
|
<div
|
|
class="MuiBox-root css-31l7gp"
|
|
>
|
|
<form
|
|
class="MuiBox-root css-0"
|
|
>
|
|
<div
|
|
class="MuiBox-root css-1ngi8ue"
|
|
>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_ej_"
|
|
id="_r_ej_-label"
|
|
>
|
|
Email
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_ej_"
|
|
type="text"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
aria-hidden="true"
|
|
class="MuiOutlinedInput-notchedOutline css-3q580a-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
|
|
>
|
|
<legend
|
|
class="css-1n64csd-MuiNotchedOutlined-root"
|
|
>
|
|
<span>
|
|
Email
|
|
</span>
|
|
</legend>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
|
|
>
|
|
<label
|
|
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeSmall MuiInputLabel-outlined css-gv8fz8-MuiFormLabel-root-MuiInputLabel-root"
|
|
data-shrink="false"
|
|
for="_r_ek_"
|
|
id="_r_ek_-label"
|
|
>
|
|
New password
|
|
</label>
|
|
<div
|
|
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-sizeSmall css-1pdqkhm-MuiInputBase-root-MuiOutlinedInput-root"
|
|
>
|
|
<input
|
|
aria-invalid="false"
|
|
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall css-t1wzep-MuiInputBase-input-MuiOutlinedInput-input"
|
|
id="_r_ek_"
|
|
type="password"
|
|
value=""
|
|
/>
|
|
<fieldset
|
|
...
|
|
|
|
78 | const reads = mockedApi.get.mock.calls.length;
|
|
79 | await act(async () => { window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })); });
|
|
> 80 | expect(screen.getByRole('dialog', { name: translations[to][titleKey] })).toBe(opened);
|
|
| ^
|
|
81 | expect(opened).toHaveAccessibleDescription(translations[to][messageKey].replace('{name}', name));
|
|
82 | expect(opened.querySelector('review')).toBeNull();
|
|
83 | expect(within(opened).getByRole('button', { name: translations[to][demote ? 'adminUsersRemoveAdmin' : 'adminUsersDelete'] })).toBeVisible();
|
|
|
|
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 getByRole (src/admin-users-page.test.tsx:80:17)
|
|
|
|
Test Suites: 1 failed, 1 total
|
|
Tests: 16 failed, 14 skipped, 30 total
|
|
Snapshots: 0 total
|
|
Time: 21.723 s
|
|
Ran all test suites matching src/admin-users-page.test.tsx with tests matching "pending admin confirmation".
|
|
Test results written to: E:\Storage\Projects\Active\temp docs\jobjakt-local-build\admin-dialog-red.json
|