docs(i18n): qualify live dialog defaults and bounded copy contract

This commit is contained in:
cesnimda
2026-11-16 23:48:29 +01:00
parent 121627ff31
commit df853cb37b
27 changed files with 1175 additions and 0 deletions
@@ -0,0 +1,11 @@
# Live default confirmation and prompt labels
16 November 2026. Bounded EN/NB maintenance source `121627ff`, branch `codex/a3-ui-10`.
Both providers keep omitted titles/action labels omitted in state and resolve existing default keys during rendering. An open dialog now follows EN↔NB changes without resetting its promise, focus, input or selection. Explicit caller strings, including empty values, remain verbatim. No API, catalogue, caller, resolver, destructive/close or prompt-length contract changed.
RED:four default drift failures and four explicit/empty literal controls passed; six other provider cases filtered. Intermediate16 pass/four failures were test setup: fireEvent.click did not focus the opener, so the existing modal correctly restored the body. Tests now focus the opener before opening; no production focus change was made. Final20 provider/modal/flow cases passed. Root affected143 cases across nine suites (including current CV/mail/backup/Career-evidence callers), project TypeScript, four-file scoped lint and whitespace check passed. Earlier20 overlaps143. Root independently matched the worker's exact four source/test hashes. AST graph update passed19,255 nodes/47,326 edges.
This does not make explicit t(...) snapshot strings reactive. The separately planned opt-in key/params contract is tracked in DIALOG_TEXT_CONTRACT.md. Formal I18N stage/new-locale, actual browser/device/AT/native-language and final A3/security/release acceptance remain open; Next build is still FAILED pending advisory qualification. Source facts, generated document language, RD21 and canonical profile ownership are untouched.
Native logs use .txt artifact names and exact gzip copies. [Source/canonical/native bindings](evidence/dialog-default-locale/SOURCE_RECEIPTS.json).
@@ -0,0 +1,29 @@
# Live dialog text implementation plan
> For agentic workers: implement through the existing direct-chat subagent workflow, with explicit file ownership and test-first verification. No backlog controller or replacement runner is involved.
**Goal:** keep opted-in EN/NB confirmation and prompt copy current when language changes, preserving pending actions, literal data and drafts.
**Architecture:** use an optional `{ key, params }` representation alongside existing literal strings. Resolve it during provider rendering through the existing `TranslationKey`, catalogue and interpolation. This is the implementation team's delegated compatibility choice; formal I18N stage and locale-publication acceptance remain open.
**Tech stack:** existing React/TypeScript, MUI, I18nProvider and Jest. No new dependencies or configuration.
**Spec:** owner continuous directive; `E:/Storage/Projects/Active/temp docs/final/I18N/03_I18N_02_FRONTEND_UI.md` tasks2,3,6; master stage/publication gates remain. Root's read-only source review confirmed no mandatory separate approval for bounded compatible EN/NB maintenance.
## Contract and file ownership
- `src/dialogText.ts`: `DialogText = string | { key: TranslationKey; params?: TranslationParams }`; one shared resolver. Literal strings, including empty strings and key-looking user data, remain verbatim. Optional metadata uses current `t`; absent I18n context uses the English catalogue and the existing interpolation function.
- `src/i18n/I18nProvider.tsx`: export existing interpolation/parameter types for reuse; preserve their implementation and UI/job/generated-content language separation.
- `src/confirm.tsx`, `src/prompt.tsx`, `src/dialogs.ts`: widen only message/title/action-label inputs to DialogText and resolve at render. Preserve omitted defaults, promise types, focus/IDs, destructive flags, Escape/backdrop behaviour, prompt input/selection, max length and legacy callers. No reverse lookup of translated strings.
- First caller: only Correspondence's existing delete confirmation message/title/confirm label. Values and current-job guards remain unchanged. Other caller migrations are separate maintenance packages.
- Root owns Correspondence and its test; worker owns shared provider/type/resolver files and provider tests. Neither changes the other's scope or Git index. Root serialises source integration, checks and graph updates.
## Execution and verification
- [ ] Add EN→NB and NB→EN regressions for an already-open real correspondence confirmation; reproduce old snapshot text before implementation.
- [ ] Add contract tests covering literals/empty strings, opted-in labels/message, variable0/Unicode/plain-text escaping, missing context English fallback, pending resolver, prompt draft/focus and one accept/cancel result.
- [ ] Implement the smallest shared resolver and optional types, then migrate the one caller family. Avoid new engines, render callbacks or automatic translation of literal input.
- [ ] Run provider/modal/flow and affected correspondence tests; run TypeScript and scoped lint. Preserve failed/intermediate native receipts and distinguish overlapping reruns.
- [ ] Review source/data/callers, update AST graph, bind exact source/native evidence, commit/publish/ref-readback and update the authoritative TODO/status/checkpoint.
Current Next build remains FAILED pending advisory qualification. This package cannot claim fresh browser/device/native-language, full I18N/A3 or release acceptance. Roll back by reverting only this package's source commits on the development branch, preserving unrelated work; no database/data migration is involved.
@@ -0,0 +1,109 @@
{
"sourceCommit": "121627ff3181bd0b988aa989eaa95f56815020ff",
"sourcesLfSha256": {
"job-tracker-ui/src/confirm.tsx": "f3fcd48021f72513d0ca3d3155f5019553bdabfdabc9490d962ca52211597b75",
"job-tracker-ui/src/prompt.tsx": "172628da55f64cd160062bff17b0f49a01f83cf0f982cdef72318deab4991323",
"job-tracker-ui/src/confirm.test.tsx": "9d8e875c4fc10b4dc6a2a177df52f06590e8e07620721c2d8c1bdd43b569b982",
"job-tracker-ui/src/prompt.test.tsx": "3c7c46221f233e8dfee948345a6fc3e2a9b9150722d8b993b36ff59079361c47"
},
"evidenceLfSha256": {
"red.json": "4c705bf418cab9ab43b334bdc0656f5849cf7291d6b7908b8acdeb6eb0ef1fed",
"red.txt": "0f7a2a48a5185d072af0e7501eddd3cb17cebcc34a3fd4932fead9ef52f138e2",
"intermediate.json": "d4386bd8fb21e873ba421c23cfec39a745243e6462d219b3851b50cbd8ff3451",
"intermediate.txt": "a558031c4e59f56a5d68ce38b625d2623a7fcf6ce8dffc81c4b80976e5433a17",
"green.json": "e5b50bb749891d9ca245fd44b0ad32503f4fbee200e435f252ca97ddf8f21491",
"green.txt": "1e6043de34d4997c64a0a4b2559367074166eb4be63aa404018100cc0c96eb63",
"result-summary.json": "50b13879a635e0a1ee9fba3f872350764782540ede8968e10582930df1df9091",
"affected.json": "0f2ce1820e33cb4d813df5f7ecaf31b0e9e7e0f6e51745da74611f5325ccf4ee",
"affected.txt": "a78e728b7cf241b98592eabd751ab5414c54444f1f15cb77c44273375e8529ca",
"types.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"lint.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"graph.txt": "9d59f9c87674a4ef9dd60205dc6938374b171027e542dc90436c98110ca01175"
},
"nativeReceipts": [
{
"originFile": "red.json",
"path": "red.json",
"gzipPath": "red.json.gz",
"rawSha256": "4c705bf418cab9ab43b334bdc0656f5849cf7291d6b7908b8acdeb6eb0ef1fed",
"gzipSha256": "74263606d3f5b50530cdf1c9bf384bb75213af6b80b138dda9973c09a313efe7"
},
{
"originFile": "red.log",
"path": "red.txt",
"gzipPath": "red.txt.gz",
"rawSha256": "a857f968f1de48fbbbc7a6445877cb9a7488c8c65c02bcab61495e547690ce0a",
"gzipSha256": "604eb26b58a331138e557d456126ce8bc4c591d910dd1ce8b86e24d8a738c52f"
},
{
"originFile": "intermediate.json",
"path": "intermediate.json",
"gzipPath": "intermediate.json.gz",
"rawSha256": "d4386bd8fb21e873ba421c23cfec39a745243e6462d219b3851b50cbd8ff3451",
"gzipSha256": "e47dd8ac1e60a2cfde760423329d764b2f35d49c831e45f66431aade5ab8642b"
},
{
"originFile": "intermediate.log",
"path": "intermediate.txt",
"gzipPath": "intermediate.txt.gz",
"rawSha256": "e2303bf7bd956029badc66ddc972c3d00006c81ec827ce07288c57fdadc65fc6",
"gzipSha256": "350d16b474d6abc9381fc73e8bc39acca887c83e0739052216cb74d323bfa519"
},
{
"originFile": "green.json",
"path": "green.json",
"gzipPath": "green.json.gz",
"rawSha256": "e5b50bb749891d9ca245fd44b0ad32503f4fbee200e435f252ca97ddf8f21491",
"gzipSha256": "9a28fc96ae4910a0caad6bd7593282f968c9febc081726bbeb741ddaf6970870"
},
{
"originFile": "green.log",
"path": "green.txt",
"gzipPath": "green.txt.gz",
"rawSha256": "d2ed42c31ef6bab8f63263245a15fd200ebf0c9ffa15a34cde2f973dc2572944",
"gzipSha256": "75d674b0209dc1f1db7470257cf8f928fd3c96ed16a688e2f2d450ab5e00c737"
},
{
"originFile": "result-summary.json",
"path": "result-summary.json",
"gzipPath": "result-summary.json.gz",
"rawSha256": "438724daac666ae07d80b43085db5a021015afbddac9071e49a5d13381ad7c4f",
"gzipSha256": "f0191541ab79769877e6899a63f17c75834259be1f46cb84a13618f4aafe4659"
},
{
"originFile": "affected.json",
"path": "affected.json",
"gzipPath": "affected.json.gz",
"rawSha256": "0f2ce1820e33cb4d813df5f7ecaf31b0e9e7e0f6e51745da74611f5325ccf4ee",
"gzipSha256": "bf85f260e5106e49c65168beb3c217e9a8eece7d467b19d98fa59415b7be88d0"
},
{
"originFile": "affected.txt",
"path": "affected.txt",
"gzipPath": "affected.txt.gz",
"rawSha256": "a54f23e6aa4a20a9ef1ad57690fefbc0b63a75ce50a1cb56d2bc0b88dbbccfaf",
"gzipSha256": "dea8855c31540a3b398bb72477a8b98555745ca2ddc791162a4288dc65a54328"
},
{
"originFile": "types.txt",
"path": "types.txt",
"gzipPath": "types.txt.gz",
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
},
{
"originFile": "lint.txt",
"path": "lint.txt",
"gzipPath": "lint.txt.gz",
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
},
{
"originFile": "graph.txt",
"path": "graph.txt",
"gzipPath": "graph.txt.gz",
"rawSha256": "f4c2f69405bd32973a8f431ecef058869962f49bdcd11ec3f94fab43a3696442",
"gzipSha256": "13569b9c198af573e6bc24f9dd039c1778ac2e0ea152987dca120e85dbad108b"
}
]
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
Test Suites: 9 passed, 9 total
Tests: 143 passed, 143 total
Snapshots: 0 total
Time: 50.173 s
Ran all test suites matching src/confirm.test.tsx|src/prompt.test.tsx|src/modal-state.test.tsx|src/confirm-flow.test.tsx|src/dialog-flow.test.tsx|src/cv-builder-page.test.tsx|src/correspondence-gmail-import.test.tsx|src/backup-lifetime.test.tsx|src/career-evidence.test.tsx.
Test results written to: E:\Storage\Projects\Active\temp docs\jobjakt-local-build\dialog-default-locale\affected.json
@@ -0,0 +1,18 @@
Re-extracting code files in . (no LLM needed)...
[graphify watch] 542 file(s) not classified (no supported extension or shebang), skipped: .dockerignore, .env.example, .git, .gitattributes, .gitignore, 1440-en-dark-converted.gz (+536 more)
AST cache: 2513/2962 files served from cache (84%); 449 to extract
AST extraction: 100/449 uncached files (22%) [16 workers]
AST extraction: 200/449 uncached files (44%) [16 workers]
AST extraction: 300/449 uncached files (66%) [16 workers]
AST extraction: 400/449 uncached files (89%) [16 workers]
AST extraction: 449/449 uncached files (100%) [16 workers]
warning: 8 .sql file(s) contributed nothing to the graph because a dependency is missing: tree_sitter_sql not installed. Install it with: pip install "graphifyy[sql]" (#1745)
warning: 144 code file(s) yielded no symbols (0.14 MB) — a data file, or source this extractor models no symbols for: JobTrackerApi.Tests/PdfBrowserStub/Program.cs, JobTrackerApi/Program.cs, JobTrackerApi/Properties/AssemblyInfo.cs, browser-extension/tests/capture-url.test.mjs, docs/audits/2026-09-07/validation/evidence/b05-excel-probe.ps1 (+139 more)
[graphify watch] community set changed since labeling (0 saved labels, 1150 communities now; renamed 127 community(ies) by their hub). Run `graphify label` to refresh names with the LLM.
Graph has 19255 nodes (above 5000 limit). Building aggregated community view...
graph.html written (aggregated: 1150 community nodes, 3133 cross-community edges)
Tip: run with --obsidian for full node-level detail.
[graphify watch] Rebuilt: 19255 nodes, 47326 edges, 1150 communities
[graphify watch] graph.json, graph.html and GRAPH_REPORT.md updated in graphify-out
Code graph updated. For doc/paper/image changes run /graphify --update in your AI assistant.
Tip: set GEMINI_API_KEY or GOOGLE_API_KEY to use Gemini for semantic extraction.
File diff suppressed because one or more lines are too long
@@ -0,0 +1,7 @@
> jest --runInBand --no-cache --runTestsByPath src/confirm.test.tsx src/prompt.test.tsx src/modal-state.test.tsx src/confirm-flow.test.tsx src/dialog-flow.test.tsx --json --outputFile=E:\Storage\Projects\Active\temp docs\jobjakt-local-build\dialog-default-locale\green.json
Test Suites: 5 passed, 5 total
Tests: 20 passed, 20 total
Snapshots: 0 total
Time: 12.299 s
Ran all test suites within paths "src/confirm.test.tsx", "src/prompt.test.tsx", "src/modal-state.test.tsx", "src/confirm-flow.test.tsx", "src/dialog-flow.test.tsx".
Test results written to: E:\Storage\Projects\Active\temp docs\jobjakt-local-build\dialog-default-locale\green.json
File diff suppressed because one or more lines are too long
@@ -0,0 +1,122 @@
> jest --runInBand --no-cache --runTestsByPath src/confirm.test.tsx src/prompt.test.tsx src/modal-state.test.tsx src/confirm-flow.test.tsx src/dialog-flow.test.tsx --json --outputFile=E:\Storage\Projects\Active\temp docs\jobjakt-local-build\dialog-default-locale\green.json
FAIL src/confirm.test.tsx
● Console
console.error
An update to ForwardRef(ButtonBase) inside a test was not wrapped in act(...).
When testing, code that causes React state updates should be wrapped into act(...):
act(() => {
/* fire events that update state */
});
/* assert on the output */
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
90 | const messageRegion = screen.getByRole('region', { name: 'Delete job' });
91 | expect(messageRegion).toHaveAttribute('tabindex', '0');
> 92 | messageRegion.focus();
| ^
93 | expect(messageRegion).toHaveFocus();
94 | });
95 |
at node_modules/react-dom/cjs/react-dom-client.development.js:18758:19
at runWithFiberInDEV (node_modules/react-dom/cjs/react-dom-client.development.js:874:13)
at warnIfUpdatesNotWrappedWithActDEV (node_modules/react-dom/cjs/react-dom-client.development.js:18757:9)
at scheduleUpdateOnFiber (node_modules/react-dom/cjs/react-dom-client.development.js:16409:11)
at dispatchSetStateInternal (node_modules/react-dom/cjs/react-dom-client.development.js:9170:13)
at dispatchSetState (node_modules/react-dom/cjs/react-dom-client.development.js:9127:7)
at node_modules/@mui/material/ButtonBase/ButtonBase.js:162:7
at node_modules/@mui/material/ButtonBase/ButtonBase.js:290:7
at node_modules/@mui/utils/useEventCallback/useEventCallback.js:24:19
at executeDispatch (node_modules/react-dom/cjs/react-dom-client.development.js:19116:9)
at runWithFiberInDEV (node_modules/react-dom/cjs/react-dom-client.development.js:874:13)
at processDispatchQueue (node_modules/react-dom/cjs/react-dom-client.development.js:19166:19)
at node_modules/react-dom/cjs/react-dom-client.development.js:19767:9
at batchedUpdates$1 (node_modules/react-dom/cjs/react-dom-client.development.js:3255:40)
at dispatchEventForPluginEventSystem (node_modules/react-dom/cjs/react-dom-client.development.js:19320:7)
at dispatchEvent (node_modules/react-dom/cjs/react-dom-client.development.js:23585:11)
at dispatchDiscreteEvent (node_modules/react-dom/cjs/react-dom-client.development.js:23553:11)
at HTMLBodyElement.callTheUserObjectsOperation (node_modules/jsdom/lib/jsdom/living/generated/EventListener.js:26:30)
at innerInvokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:350:25)
at invokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:286:3)
at HTMLButtonElementImpl._dispatch (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:233:9)
at Object.exports.fireFocusEventWithTargetAdjustment (node_modules/jsdom/lib/jsdom/living/helpers/focusing.js:103:10)
at HTMLDivElementImpl.focus (node_modules/jsdom/lib/jsdom/living/nodes/HTMLOrSVGElement-impl.js:58:16)
at HTMLDivElement.focus (node_modules/jsdom/lib/jsdom/living/generated/HTMLElement.js:128:34)
at Object.focus (src/confirm.test.tsx:92:17)
console.error
An update to ForwardRef(TouchRipple) inside a test was not wrapped in act(...).
When testing, code that causes React state updates should be wrapped into act(...):
act(() => {
/* fire events that update state */
});
/* assert on the output */
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
at node_modules/react-dom/cjs/react-dom-client.development.js:18758:19
at runWithFiberInDEV (node_modules/react-dom/cjs/react-dom-client.development.js:874:13)
at warnIfUpdatesNotWrappedWithActDEV (node_modules/react-dom/cjs/react-dom-client.development.js:18757:9)
at scheduleUpdateOnFiber (node_modules/react-dom/cjs/react-dom-client.development.js:16409:11)
at dispatchSetStateInternal (node_modules/react-dom/cjs/react-dom-client.development.js:9170:13)
at dispatchSetState (node_modules/react-dom/cjs/react-dom-client.development.js:9127:7)
at Object.stop (node_modules/@mui/material/ButtonBase/TouchRipple.js:292:5)
at node_modules/@mui/material/useLazyRipple/useLazyRipple.js:74:47
● open confirm defaults follow en to nb without replacing focus or resolver
expect(element).toHaveFocus()
Expected element with focus:
<button>Open locale confirm</button>
Received element with focus:
<body style=""><div><button>Open locale confirm</button></div></body>
51 | expect(result).toHaveBeenCalledWith(accepted);
52 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
> 53 | expect(trigger).toHaveFocus();
| ^
54 | });
55 |
56 | test.each([
at toHaveFocus (src/confirm.test.tsx:53:19)
● open confirm defaults follow nb to en without replacing focus or resolver
expect(element).toHaveFocus()
Expected element with focus:
<button>Open locale confirm</button>
Received element with focus:
<body style=""><div><button>Open locale confirm</button></div></body>
51 | expect(result).toHaveBeenCalledWith(accepted);
52 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
> 53 | expect(trigger).toHaveFocus();
| ^
54 | });
55 |
56 | test.each([
at toHaveFocus (src/confirm.test.tsx:53:19)
FAIL src/prompt.test.tsx
● open prompt defaults follow en to nb without replacing its Unicode draft, focus or resolver
expect(element).toHaveFocus()
Expected element with focus:
<button>Open locale prompt</button>
Received element with focus:
<body style=""><div><button>Open locale prompt</button></div></body>
40 | expect(result).toHaveBeenCalledWith(accepted ? draft : null);
41 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
> 42 | expect(trigger).toHaveFocus();
| ^
43 | });
44 |
45 | test.each([
at toHaveFocus (src/prompt.test.tsx:42:19)
● open prompt defaults follow nb to en without replacing its Unicode draft, focus or resolver
expect(element).toHaveFocus()
Expected element with focus:
<button>Open locale prompt</button>
Received element with focus:
<body style=""><div><button>Open locale prompt</button></div></body>
40 | expect(result).toHaveBeenCalledWith(accepted ? draft : null);
41 | await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
> 42 | expect(trigger).toHaveFocus();
| ^
43 | });
44 |
45 | test.each([
at toHaveFocus (src/prompt.test.tsx:42:19)
Test Suites: 2 failed, 3 passed, 5 total
Tests: 4 failed, 16 passed, 20 total
Snapshots: 0 total
Time: 12.668 s
Ran all test suites within paths "src/confirm.test.tsx", "src/prompt.test.tsx", "src/modal-state.test.tsx", "src/confirm-flow.test.tsx", "src/dialog-flow.test.tsx".
Test results written to: E:\Storage\Projects\Active\temp docs\jobjakt-local-build\dialog-default-locale\green.json
File diff suppressed because one or more lines are too long
@@ -0,0 +1,831 @@
> jest --runInBand --no-cache --runTestsByPath src/confirm.test.tsx src/prompt.test.tsx --testNamePattern=open confirm defaults|open prompt defaults|locale changes preserve explicit --json --outputFile=E:\Storage\Projects\Active\temp docs\jobjakt-local-build\dialog-default-locale\red.json
FAIL src/confirm.test.tsx
● open confirm defaults follow en to nb without replacing focus or resolver
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Bekreft handling"
Here are the accessible roles:
presentation:
Name "":
<div
class="MuiDialog-root MuiModal-root css-1oaxuzu-MuiModal-root-MuiDialog-root"
role="presentation"
/>
Name "":
<div
class="MuiDialog-container MuiDialog-scrollPaper css-19do60a-MuiDialog-container"
role="presentation"
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
tabindex="-1"
/>
--------------------------------------------------
dialog:
Name "Confirm action":
<div
aria-describedby="_r_0_"
aria-labelledby="_r_1_"
aria-modal="true"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-n24a7g-MuiPaper-root-MuiDialog-paper"
role="dialog"
style="--Paper-shadow: 0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12);"
/>
--------------------------------------------------
heading:
Name "Confirm action":
<h2
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-rcehg8-MuiTypography-root-MuiDialogTitle-root"
id="_r_1_"
/>
--------------------------------------------------
region:
Name "Confirm action":
<div
aria-labelledby="_r_1_"
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-colorInfo MuiAlert-outlinedInfo MuiAlert-outlined css-r9gdcg-MuiPaper-root-MuiAlert-root"
role="alert"
style="--Paper-shadow: none;"
/>
--------------------------------------------------
paragraph:
Name "":
<p
class="MuiTypography-root MuiTypography-body1 css-3yi46c-MuiTypography-root"
id="_r_0_"
/>
--------------------------------------------------
button:
Name "Cancel":
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1dn15bh-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
/>
Name "Confirm":
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-83fk99-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
/>
--------------------------------------------------
Ignored nodes: comments, script, style
<body
style="padding-right: 1024px; overflow: hidden;"
>
<div
aria-hidden="true"
>
<button>
Open locale confirm
</button>
</div>
<div
class="MuiDialog-root MuiModal-root css-1oaxuzu-MuiModal-root-MuiDialog-root"
role="presentation"
>
<div
aria-hidden="true"
class="MuiBackdrop-root MuiModal-backdrop MuiDialog-backdrop css-1ktti4u-MuiBackdrop-root-MuiDialog-backdrop"
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
/>
<div
data-testid="sentinelStart"
tabindex="0"
/>
<div
class="MuiDialog-container MuiDialog-scrollPaper css-19do60a-MuiDialog-container"
role="presentation"
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
tabindex="-1"
>
<div
aria-describedby="_r_0_"
aria-labelledby="_r_1_"
aria-modal="true"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-n24a7g-MuiPaper-root-MuiDialog-paper"
role="dialog"
style="--Paper-shadow: 0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12);"
>
<h2
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-rcehg8-MuiTypography-root-MuiDialogTitle-root"
id="_r_1_"
>
Confirm action
</h2>
<div
aria-labelledby="_r_1_"
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
role="region"
tabindex="0"
>
<div
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-outlinedInfo MuiAlert-outlined css-r9gdcg-MuiPaper-root-MuiAlert-root"
role="alert"
style="--Paper-shadow: none;"
>
<div
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-1ckov0h-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"
>
Bekreft denne handlingen.
</div>
</div>
<p
class="MuiTypography-root MuiTypography-body1 css-3yi46c-MuiTypography-root"
id="_r_0_"
>
Literal spørsmål 東京?
</p>
</div>
<div
class="MuiDialogActions-root MuiDialogActions-spacing css-1uwjd7y-MuiDialogActions-root"
>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1dn15bh-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
Cancel
<span
class="MuiTouchRipple-root css-r3djoj-MuiTouchRipple-root"
>
<span
class="css-y4cjyz-MuiTouchRipple-ripple MuiTouchRipple-ripple MuiTouchRipple-rippleVisible MuiTouchRipple-ripplePulsate"
style="width: 1px; height: 1px; top: -0.5px; left: -0.5px;"
>
<span
class="MuiTouchRipple-child MuiTouchRipple-childLeaving MuiTouchRipple-childPulsate"
/>
</span>
</span>
</button>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-83fk99-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
Confirm
</button>
</div>
</div>
</div>
<div
data-testid="sentinelEnd"
tabindex="0"
/>
</div>
</body>
40 | act(() => message.focus());
41 | await act(async () => window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })));
> 42 | expect(screen.getByRole('dialog', { name: translations[to].confirmAction })).toBe(dialog);
| ^
43 | expect(screen.getByRole('button', { name: translations[to].confirm })).toBeVisible();
44 | expect(screen.getByRole('button', { name: translations[to].cancel })).toBeVisible();
45 | expect(dialog).toHaveAccessibleDescription('Literal spørsmål 東京?');
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/confirm.test.tsx:42:17)
● open confirm defaults follow nb to en without replacing focus or resolver
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Confirm action"
Here are the accessible roles:
presentation:
Name "":
<div
class="MuiDialog-root MuiModal-root css-1oaxuzu-MuiModal-root-MuiDialog-root"
role="presentation"
/>
Name "":
<div
class="MuiDialog-container MuiDialog-scrollPaper css-19do60a-MuiDialog-container"
role="presentation"
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
tabindex="-1"
/>
--------------------------------------------------
dialog:
Name "Bekreft handling":
<div
aria-describedby="_r_5_"
aria-labelledby="_r_6_"
aria-modal="true"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-n24a7g-MuiPaper-root-MuiDialog-paper"
role="dialog"
style="--Paper-shadow: 0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12);"
/>
--------------------------------------------------
heading:
Name "Bekreft handling":
<h2
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-rcehg8-MuiTypography-root-MuiDialogTitle-root"
id="_r_6_"
/>
--------------------------------------------------
region:
Name "Bekreft handling":
<div
aria-labelledby="_r_6_"
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-colorInfo MuiAlert-outlinedInfo MuiAlert-outlined css-r9gdcg-MuiPaper-root-MuiAlert-root"
role="alert"
style="--Paper-shadow: none;"
/>
--------------------------------------------------
paragraph:
Name "":
<p
class="MuiTypography-root MuiTypography-body1 css-3yi46c-MuiTypography-root"
id="_r_5_"
/>
--------------------------------------------------
button:
Name "Avbryt":
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1dn15bh-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
/>
Name "Bekreft":
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-83fk99-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
/>
--------------------------------------------------
Ignored nodes: comments, script, style
<body
style="padding-right: 1024px; overflow: hidden;"
>
<div
aria-hidden="true"
>
<button>
Open locale confirm
</button>
</div>
<div
class="MuiDialog-root MuiModal-root css-1oaxuzu-MuiModal-root-MuiDialog-root"
role="presentation"
>
<div
aria-hidden="true"
class="MuiBackdrop-root MuiModal-backdrop MuiDialog-backdrop css-1ktti4u-MuiBackdrop-root-MuiDialog-backdrop"
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
/>
<div
data-testid="sentinelStart"
tabindex="0"
/>
<div
class="MuiDialog-container MuiDialog-scrollPaper css-19do60a-MuiDialog-container"
role="presentation"
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
tabindex="-1"
>
<div
aria-describedby="_r_5_"
aria-labelledby="_r_6_"
aria-modal="true"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-n24a7g-MuiPaper-root-MuiDialog-paper"
role="dialog"
style="--Paper-shadow: 0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12);"
>
<h2
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-rcehg8-MuiTypography-root-MuiDialogTitle-root"
id="_r_6_"
>
Bekreft handling
</h2>
<div
aria-labelledby="_r_6_"
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
role="region"
tabindex="0"
>
<div
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation0 MuiAlert-root MuiAlert-colorInfo MuiAlert-outlinedInfo MuiAlert-outlined css-r9gdcg-MuiPaper-root-MuiAlert-root"
role="alert"
style="--Paper-shadow: none;"
>
<div
class="MuiAlert-icon css-1wrdnka-MuiAlert-icon"
>
<svg
aria-hidden="true"
class="MuiSvgIcon-root MuiSvgIcon-fontSizeInherit css-1ckov0h-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"
>
Please confirm this action.
</div>
</div>
<p
class="MuiTypography-root MuiTypography-body1 css-3yi46c-MuiTypography-root"
id="_r_5_"
>
Literal spørsmål 東京?
</p>
</div>
<div
class="MuiDialogActions-root MuiDialogActions-spacing css-1uwjd7y-MuiDialogActions-root"
>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1dn15bh-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
Avbryt
<span
class="MuiTouchRipple-root css-r3djoj-MuiTouchRipple-root"
>
<span
class="css-y4cjyz-MuiTouchRipple-ripple MuiTouchRipple-ripple MuiTouchRipple-rippleVisible MuiTouchRipple-ripplePulsate"
style="width: 1px; height: 1px; top: -0.5px; left: -0.5px;"
>
<span
class="MuiTouchRipple-child MuiTouchRipple-childLeaving MuiTouchRipple-childPulsate"
/>
</span>
</span>
</button>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-83fk99-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
Bekreft
</button>
</div>
</div>
</div>
<div
data-testid="sentinelEnd"
tabindex="0"
/>
</div>
</body>
40 | act(() => message.focus());
41 | await act(async () => window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })));
> 42 | expect(screen.getByRole('dialog', { name: translations[to].confirmAction })).toBe(dialog);
| ^
43 | expect(screen.getByRole('button', { name: translations[to].confirm })).toBeVisible();
44 | expect(screen.getByRole('button', { name: translations[to].cancel })).toBeVisible();
45 | expect(dialog).toHaveAccessibleDescription('Literal spørsmål 東京?');
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/confirm.test.tsx:42:17)
FAIL src/prompt.test.tsx
● open prompt defaults follow en to nb without replacing its Unicode draft, focus or resolver
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Skriv inn verdi"
Here are the accessible roles:
presentation:
Name "":
<div
class="MuiDialog-root MuiModal-root css-1oaxuzu-MuiModal-root-MuiDialog-root"
role="presentation"
/>
Name "":
<div
class="MuiDialog-container MuiDialog-scrollPaper css-19do60a-MuiDialog-container"
role="presentation"
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
tabindex="-1"
/>
--------------------------------------------------
dialog:
Name "Enter value":
<div
aria-describedby="_r_0_"
aria-labelledby="_r_1_"
aria-modal="true"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-n24a7g-MuiPaper-root-MuiDialog-paper"
role="dialog"
style="--Paper-shadow: 0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12);"
/>
--------------------------------------------------
heading:
Name "Enter value":
<h2
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-rcehg8-MuiTypography-root-MuiDialogTitle-root"
id="_r_1_"
/>
--------------------------------------------------
paragraph:
Name "":
<p
class="MuiTypography-root MuiTypography-body1 css-1pasqkq-MuiTypography-root"
id="_r_0_"
/>
Name "":
<p
class="MuiFormHelperText-root MuiFormHelperText-sizeMedium MuiFormHelperText-contained Mui-focused MuiFormHelperText-filled css-1h0qynx-MuiFormHelperText-root"
id="_r_2_-helper-text"
/>
--------------------------------------------------
textbox:
Name "Literal spørsmål 東京?":
<input
aria-describedby="_r_2_-helper-text"
aria-invalid="false"
aria-labelledby="_r_0_"
class="MuiInputBase-input MuiOutlinedInput-input css-hafeiy-MuiInputBase-input-MuiOutlinedInput-input"
id="_r_2_"
maxlength="180"
type="text"
value="Søknad 東京 🧑‍💻"
/>
--------------------------------------------------
button:
Name "Cancel":
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1dn15bh-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
/>
Name "Save":
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-83fk99-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
/>
--------------------------------------------------
Ignored nodes: comments, script, style
<body
style="padding-right: 1024px; overflow: hidden;"
>
<div
aria-hidden="true"
>
<button>
Open locale prompt
</button>
</div>
<div
class="MuiDialog-root MuiModal-root css-1oaxuzu-MuiModal-root-MuiDialog-root"
role="presentation"
>
<div
aria-hidden="true"
class="MuiBackdrop-root MuiModal-backdrop MuiDialog-backdrop css-1ktti4u-MuiBackdrop-root-MuiDialog-backdrop"
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
/>
<div
data-testid="sentinelStart"
tabindex="0"
/>
<div
class="MuiDialog-container MuiDialog-scrollPaper css-19do60a-MuiDialog-container"
role="presentation"
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
tabindex="-1"
>
<div
aria-describedby="_r_0_"
aria-labelledby="_r_1_"
aria-modal="true"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-n24a7g-MuiPaper-root-MuiDialog-paper"
role="dialog"
style="--Paper-shadow: 0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12);"
>
<h2
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-rcehg8-MuiTypography-root-MuiDialogTitle-root"
id="_r_1_"
>
Enter value
</h2>
<div
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
>
<p
class="MuiTypography-root MuiTypography-body1 css-1pasqkq-MuiTypography-root"
id="_r_0_"
>
Literal spørsmål 東京?
</p>
<div
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
>
<div
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth Mui-focused MuiInputBase-formControl css-1iqcefa-MuiInputBase-root-MuiOutlinedInput-root"
>
<input
aria-describedby="_r_2_-helper-text"
aria-invalid="false"
aria-labelledby="_r_0_"
class="MuiInputBase-input MuiOutlinedInput-input css-hafeiy-MuiInputBase-input-MuiOutlinedInput-input"
id="_r_2_"
maxlength="180"
type="text"
value="Søknad 東京 🧑‍💻"
/>
<fieldset
aria-hidden="true"
class="MuiOutlinedInput-notchedOutline css-18p5xg2-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-1nf2c5d-MuiNotchedOutlined-root"
>
<span
aria-hidden="true"
class="notranslate"
>
​
</span>
</legend>
</fieldset>
</div>
<p
class="MuiFormHelperText-root MuiFormHelperText-sizeMedium MuiFormHelperText-contained Mui-focused MuiFormHelperText-filled css-1h0qynx-MuiFormHelperText-root"
id="_r_2_-helper-text"
>
15/180
</p>
</div>
</div>
<div
class="MuiDialogActions-root MuiDialogActions-spacing css-1uwjd7y-MuiDialogActions-root"
>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1dn15bh-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
Cancel
</button>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-83fk99-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
Save
</button>
</div>
</div>
</div>
<div
data-testid="sentinelEnd"
tabindex="0"
/>
</div>
</body>
28 | input.setSelectionRange(2, 7);
29 | await act(async () => window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })));
> 30 | expect(screen.getByRole('dialog', { name: translations[to].enterValue })).toBe(dialog);
| ^
31 | expect(screen.getByRole('button', { name: translations[to].save })).toBeVisible();
32 | expect(screen.getByRole('button', { name: translations[to].cancel })).toBeVisible();
33 | expect(input).toHaveValue(draft); expect(input).toHaveFocus();
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/prompt.test.tsx:30:17)
● open prompt defaults follow nb to en without replacing its Unicode draft, focus or resolver
TestingLibraryElementError: Unable to find an accessible element with the role "dialog" and name "Enter value"
Here are the accessible roles:
presentation:
Name "":
<div
class="MuiDialog-root MuiModal-root css-1oaxuzu-MuiModal-root-MuiDialog-root"
role="presentation"
/>
Name "":
<div
class="MuiDialog-container MuiDialog-scrollPaper css-19do60a-MuiDialog-container"
role="presentation"
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
tabindex="-1"
/>
--------------------------------------------------
dialog:
Name "Skriv inn verdi":
<div
aria-describedby="_r_5_"
aria-labelledby="_r_6_"
aria-modal="true"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-n24a7g-MuiPaper-root-MuiDialog-paper"
role="dialog"
style="--Paper-shadow: 0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12);"
/>
--------------------------------------------------
heading:
Name "Skriv inn verdi":
<h2
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-rcehg8-MuiTypography-root-MuiDialogTitle-root"
id="_r_6_"
/>
--------------------------------------------------
paragraph:
Name "":
<p
class="MuiTypography-root MuiTypography-body1 css-1pasqkq-MuiTypography-root"
id="_r_5_"
/>
Name "":
<p
class="MuiFormHelperText-root MuiFormHelperText-sizeMedium MuiFormHelperText-contained Mui-focused MuiFormHelperText-filled css-1h0qynx-MuiFormHelperText-root"
id="_r_7_-helper-text"
/>
--------------------------------------------------
textbox:
Name "Literal spørsmål 東京?":
<input
aria-describedby="_r_7_-helper-text"
aria-invalid="false"
aria-labelledby="_r_5_"
class="MuiInputBase-input MuiOutlinedInput-input css-hafeiy-MuiInputBase-input-MuiOutlinedInput-input"
id="_r_7_"
maxlength="180"
type="text"
value="Søknad 東京 🧑‍💻"
/>
--------------------------------------------------
button:
Name "Avbryt":
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1dn15bh-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
/>
Name "Lagre":
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-83fk99-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
/>
--------------------------------------------------
Ignored nodes: comments, script, style
<body
style="padding-right: 1024px; overflow: hidden;"
>
<div
aria-hidden="true"
>
<button>
Open locale prompt
</button>
</div>
<div
class="MuiDialog-root MuiModal-root css-1oaxuzu-MuiModal-root-MuiDialog-root"
role="presentation"
>
<div
aria-hidden="true"
class="MuiBackdrop-root MuiModal-backdrop MuiDialog-backdrop css-1ktti4u-MuiBackdrop-root-MuiDialog-backdrop"
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
/>
<div
data-testid="sentinelStart"
tabindex="0"
/>
<div
class="MuiDialog-container MuiDialog-scrollPaper css-19do60a-MuiDialog-container"
role="presentation"
style="opacity: 1; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
tabindex="-1"
>
<div
aria-describedby="_r_5_"
aria-labelledby="_r_6_"
aria-modal="true"
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXs MuiDialog-paperFullWidth css-n24a7g-MuiPaper-root-MuiDialog-paper"
role="dialog"
style="--Paper-shadow: 0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12);"
>
<h2
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-rcehg8-MuiTypography-root-MuiDialogTitle-root"
id="_r_6_"
>
Skriv inn verdi
</h2>
<div
class="MuiDialogContent-root css-kw13he-MuiDialogContent-root"
>
<p
class="MuiTypography-root MuiTypography-body1 css-1pasqkq-MuiTypography-root"
id="_r_5_"
>
Literal spørsmål 東京?
</p>
<div
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-cmpglg-MuiFormControl-root-MuiTextField-root"
>
<div
class="MuiInputBase-root MuiOutlinedInput-root MuiInputBase-colorPrimary MuiInputBase-fullWidth Mui-focused MuiInputBase-formControl css-1iqcefa-MuiInputBase-root-MuiOutlinedInput-root"
>
<input
aria-describedby="_r_7_-helper-text"
aria-invalid="false"
aria-labelledby="_r_5_"
class="MuiInputBase-input MuiOutlinedInput-input css-hafeiy-MuiInputBase-input-MuiOutlinedInput-input"
id="_r_7_"
maxlength="180"
type="text"
value="Søknad 東京 🧑‍💻"
/>
<fieldset
aria-hidden="true"
class="MuiOutlinedInput-notchedOutline css-18p5xg2-MuiNotchedOutlined-root-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-1nf2c5d-MuiNotchedOutlined-root"
>
<span
aria-hidden="true"
class="notranslate"
>
​
</span>
</legend>
</fieldset>
</div>
<p
class="MuiFormHelperText-root MuiFormHelperText-sizeMedium MuiFormHelperText-contained Mui-focused MuiFormHelperText-filled css-1h0qynx-MuiFormHelperText-root"
id="_r_7_-helper-text"
>
15/180
</p>
</div>
</div>
<div
class="MuiDialogActions-root MuiDialogActions-spacing css-1uwjd7y-MuiDialogActions-root"
>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-colorPrimary css-1dn15bh-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
Avbryt
</button>
<button
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-colorPrimary css-83fk99-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
>
Lagre
</button>
</div>
</div>
</div>
<div
data-testid="sentinelEnd"
tabindex="0"
/>
</div>
</body>
28 | input.setSelectionRange(2, 7);
29 | await act(async () => window.dispatchEvent(new StorageEvent('storage', { key: 'uiLanguage', newValue: to })));
> 30 | expect(screen.getByRole('dialog', { name: translations[to].enterValue })).toBe(dialog);
| ^
31 | expect(screen.getByRole('button', { name: translations[to].save })).toBeVisible();
32 | expect(screen.getByRole('button', { name: translations[to].cancel })).toBeVisible();
33 | expect(input).toHaveValue(draft); expect(input).toHaveFocus();
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/prompt.test.tsx:30:17)
Test Suites: 2 failed, 2 total
Tests: 4 failed, 6 skipped, 4 passed, 14 total
Snapshots: 0 total
Time: 5.491 s
Ran all test suites within paths "src/confirm.test.tsx", "src/prompt.test.tsx".
Test results written to: E:\Storage\Projects\Active\temp docs\jobjakt-local-build\dialog-default-locale\red.json
@@ -0,0 +1,37 @@
{
"reports": {
"red": {
"numFailedTestSuites": 2,
"numFailedTests": 4,
"numPassedTestSuites": 0,
"numPassedTests": 4,
"numPendingTests": 6,
"numTotalTests": 14,
"success": false
},
"intermediate": {
"numFailedTestSuites": 2,
"numFailedTests": 4,
"numPassedTestSuites": 3,
"numPassedTests": 16,
"numPendingTests": 0,
"numTotalTests": 20,
"success": false
},
"green": {
"numFailedTestSuites": 0,
"numFailedTests": 0,
"numPassedTestSuites": 5,
"numPassedTests": 20,
"numPendingTests": 0,
"numTotalTests": 20,
"success": true
}
},
"sha256": {
"job-tracker-ui/src/confirm.tsx": "ce3f9835b19d48bc8f92b98aa017dd0b4ceec4c1d74176ec7a8eaab22998d9b5",
"job-tracker-ui/src/prompt.tsx": "fb44dfe5fcbcd7fc54039866c52c774b6bb9eb4d19e8139aad3813879418939f",
"job-tracker-ui/src/confirm.test.tsx": "04430dea67dc9bce419e2950015665a05fdbbe0d7db0087ccc93810b700483ac",
"job-tracker-ui/src/prompt.test.tsx": "c108fe1ad6acc9c1b307af8779f4a6ac7cd96e2c021f48ce8f107a94d0e20b0f"
}
}