docs(documents): retain preview download regression evidence

This commit is contained in:
cesnimda
2026-11-17 15:23:52 +01:00
parent 419fd49569
commit 1e9105dfd7
16 changed files with 654 additions and 0 deletions
@@ -0,0 +1,11 @@
# Download the actual previewed attachment
17 November 2026. Source `419fd49569b07f545b0d420f954047f564df7a0c`, branch `codex/a3-ui-10`, baseline `3623d1b5`.
The preview dialog reconstructed the attachment with ID0 for Download, requesting `/attachments/download/0`. Retain the previewed attachment ID alongside its existing URL/type/name and pass that ID to the unchanged download handler. No endpoint, session/lifetime guard, blob handling, filename, renderer or storage contract changes.
Both original EN/NB regressions FAILED with the wrong download ID. Final **103 cases/four complete affected suites PASSED**, zero failures/skips; non-incremental TypeScript, two-file lint, diff check and AST update PASSED (19,324 nodes/47,465 edges). Existing preview request ordering and job/session/unmount checks run in the same package. Counts overlap preceding attachment/dialog packages and are not cumulative full regression.
Source/native/gzip bindings: `evidence/attachment-preview-download/SOURCE_RECEIPTS.json`. Blob and anchor clicks are mocked synthetic JSDOM checks; no real files, live API/provider, browser/device or physical PDF qualification. The prior Next build remains FAILED and final A3/security/release gates stay open. Rollback: revert this source commit; no migration.
Follow-up investigation reproduced two separate same-application reload ordering failures after successive renames. Those tests are outside this source/evidence snapshot and need their own fix and verification; metadata write ordering remains unqualified.
@@ -0,0 +1,63 @@
{
"sourceCommit": "419fd49569b07f545b0d420f954047f564df7a0c",
"sourcesLfSha256": {
"job-tracker-ui/src/components/Attachments.tsx": "4af6e607a79f9749ff3b41a30ab3d43fcd25c78075d6caee2f034f5ecea71c9e",
"job-tracker-ui/src/attachment-action-lifetime.test.tsx": "11018367cf0c8bf85ddcb0ff9aaa7893f798db7cd21a8bfa773f36becc268cbf",
"job-tracker-ui/src/attachments.test.tsx": "20b023eedce62a660149c8436426bae0c5d2b2410b318069ab7f798fca6bc51b",
"job-tracker-ui/src/file-picker-activation.test.tsx": "accb87f94a7b36373eec6583a391a17ede7e7779cf18d81d4a86b43e0bd6afbe",
"job-tracker-ui/src/dialog-text.test.tsx": "60db06fb84238d356c6f7be657f6dcf0dc47c0b51cc5e89d001d6f9024fe44fe"
},
"evidenceLfSha256": {
"red.json": "64ea05652ff7c3b303db5ac7eed43c7fc017e410a2a0a28d4c293c14336bb32e",
"red.txt": "048e1da13fb9c542ca882f517bb34b2ab7bbd9ee57115bda5f9a5321056d8702",
"green.json": "725434427fb475fa01ef25bed01da464714c1756be5ed0fb7600ce6447a2a95f",
"green.txt": "187dcf1dd08deb262cd9cbba20d802437e98f62d167b49bf78fc76b5723d725c",
"typecheck.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"lint.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"graph.txt": "a2bfd9d6649fbd08095359780f5e146f2437a8cad6cb189fe5c33e73e0fbfc34"
},
"nativeReceipts": [
{
"path": "red.json",
"gzipPath": "red.json.gz",
"rawSha256": "64ea05652ff7c3b303db5ac7eed43c7fc017e410a2a0a28d4c293c14336bb32e",
"gzipSha256": "a8448345431f3aeebca29acac46ea6b37c2900f3a9a9b21d11efd0676c49c740"
},
{
"path": "red.txt",
"gzipPath": "red.txt.gz",
"rawSha256": "a55b5e4d1e874a0af67dd56f714220259f58d221a1459337bcadfa1a01a80e36",
"gzipSha256": "1aa9c1d524f4cddb97afb99f071b8f1620f6393ea209ba10bd33f0cc083b3448"
},
{
"path": "green.json",
"gzipPath": "green.json.gz",
"rawSha256": "725434427fb475fa01ef25bed01da464714c1756be5ed0fb7600ce6447a2a95f",
"gzipSha256": "96b27bce4d52c0b2c7d198cd878d1a54c7cf010b293121961aabb8df6e3119c8"
},
{
"path": "green.txt",
"gzipPath": "green.txt.gz",
"rawSha256": "e46b198a3ef5a1ae2a3fbbf98eecc382ea5f0c0456ba3b662cc3e38854a8dd8f",
"gzipSha256": "2cf7ac38a375f27eeaf2af939c10cd308203467b33ff82ce35f8e1369535421a"
},
{
"path": "typecheck.txt",
"gzipPath": "typecheck.txt.gz",
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
},
{
"path": "lint.txt",
"gzipPath": "lint.txt.gz",
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e"
},
{
"path": "graph.txt",
"gzipPath": "graph.txt.gz",
"rawSha256": "85cdd3e8b70066329b7ce1de6caceb277be685e1e31e45f4eaeb444b45ceb2cd",
"gzipSha256": "234111d71c6bd480736d544dbe064a0feddc573c62b7278041300e592b4463cf"
}
]
}
@@ -0,0 +1,18 @@
Re-extracting code files in . (no LLM needed)...
[graphify watch] 737 file(s) not classified (no supported extension or shebang), skipped: .dockerignore, .env.example, .git, .gitattributes, .gitignore, 1440-en-dark-converted.gz (+731 more)
AST cache: 2620/3071 files served from cache (85%); 451 to extract
AST extraction: 100/451 uncached files (22%) [16 workers]
AST extraction: 200/451 uncached files (44%) [16 workers]
AST extraction: 300/451 uncached files (66%) [16 workers]
AST extraction: 400/451 uncached files (88%) [16 workers]
AST extraction: 451/451 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: 145 code file(s) yielded no symbols (0.15 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 (+140 more)
[graphify watch] community set changed since labeling (0 saved labels, 1196 communities now; renamed 131 community(ies) by their hub). Run `graphify label` to refresh names with the LLM.
Graph has 19324 nodes (above 5000 limit). Building aggregated community view...
graph.html written (aggregated: 1196 community nodes, 3036 cross-community edges)
Tip: run with --obsidian for full node-level detail.
[graphify watch] Rebuilt: 19324 nodes, 47465 edges, 1196 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 @@
Test Suites: 4 passed, 4 total
Tests: 103 passed, 103 total
Snapshots: 0 total
Time: 20.329 s
Ran all test suites matching src/attachment-action-lifetime.test.tsx|src/attachments.test.tsx|src/file-picker-activation.test.tsx|src/dialog-text.test.tsx.
Test results written to: E:\Storage\Projects\Active\temp docs\jobjakt-local-build\attachment-preview-download-green.json
File diff suppressed because one or more lines are too long
@@ -0,0 +1,553 @@
console.warn
A function to advance timers was called but the timers APIs are not replaced with fake timers. Call `jest.useFakeTimers()` in this test file or enable fake timers for all tests by setting 'fakeTimers': {'enableGlobally': true} in Jest configuration file.
Stack Trace:
54 | const view = render(page());
55 | try {
> 56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
| ^
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
Error:
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:654:7)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/dom/dist/wait-for.js:71:16
at node_modules/@testing-library/react/dist/act-compat.js:47:24
at process.env.NODE_ENV.exports.act (node_modules/react/cjs/react.development.js:814:22)
at node_modules/@testing-library/react/dist/act-compat.js:46:25
at unstable_advanceTimersWrapper (node_modules/@testing-library/react/dist/pure.js:78:35)
at node_modules/@testing-library/dom/dist/wait-for.js:65:15
at waitFor (node_modules/@testing-library/dom/dist/wait-for.js:36:10)
at node_modules/@testing-library/dom/dist/wait-for.js:164:54
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:87:28)
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:164:35)
at node_modules/@testing-library/dom/dist/query-helpers.js:86:33
at findByRole (src/attachment-action-lifetime.test.tsx:56:34)
54 | const view = render(page());
55 | try {
> 56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
| ^
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:652:28)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/dom/dist/wait-for.js:71:16
at node_modules/@testing-library/react/dist/act-compat.js:47:24
at process.env.NODE_ENV.exports.act (node_modules/react/cjs/react.development.js:814:22)
at node_modules/@testing-library/react/dist/act-compat.js:46:25
at unstable_advanceTimersWrapper (node_modules/@testing-library/react/dist/pure.js:78:35)
at node_modules/@testing-library/dom/dist/wait-for.js:65:15
at waitFor (node_modules/@testing-library/dom/dist/wait-for.js:36:10)
at node_modules/@testing-library/dom/dist/wait-for.js:164:54
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:87:28)
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:164:35)
at node_modules/@testing-library/dom/dist/query-helpers.js:86:33
at findByRole (src/attachment-action-lifetime.test.tsx:56:34)
console.warn
A function to advance timers was called but the timers APIs are not replaced with fake timers. Call `jest.useFakeTimers()` in this test file or enable fake timers for all tests by setting 'fakeTimers': {'enableGlobally': true} in Jest configuration file.
Stack Trace:
54 | const view = render(page());
55 | try {
> 56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
| ^
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
Error:
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:654:7)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/react/dist/pure.js:96:16
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:91:13)
at src/attachment-action-lifetime.test.tsx:56:21
54 | const view = render(page());
55 | try {
> 56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
| ^
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:652:28)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/react/dist/pure.js:96:16
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:91:13)
at src/attachment-action-lifetime.test.tsx:56:21
console.warn
A function to advance timers was called but the timers APIs are not replaced with fake timers. Call `jest.useFakeTimers()` in this test file or enable fake timers for all tests by setting 'fakeTimers': {'enableGlobally': true} in Jest configuration file.
Stack Trace:
55 | try {
56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
> 57 | const dialog = await screen.findByRole('dialog');
| ^
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
Error:
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:654:7)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/dom/dist/wait-for.js:71:16
at node_modules/@testing-library/react/dist/act-compat.js:47:24
at process.env.NODE_ENV.exports.act (node_modules/react/cjs/react.development.js:814:22)
at node_modules/@testing-library/react/dist/act-compat.js:46:25
at unstable_advanceTimersWrapper (node_modules/@testing-library/react/dist/pure.js:78:35)
at node_modules/@testing-library/dom/dist/wait-for.js:65:15
at waitFor (node_modules/@testing-library/dom/dist/wait-for.js:36:10)
at node_modules/@testing-library/dom/dist/wait-for.js:164:54
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:87:28)
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:164:35)
at node_modules/@testing-library/dom/dist/query-helpers.js:86:33
at findByRole (src/attachment-action-lifetime.test.tsx:57:33)
55 | try {
56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
> 57 | const dialog = await screen.findByRole('dialog');
| ^
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:652:28)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/dom/dist/wait-for.js:71:16
at node_modules/@testing-library/react/dist/act-compat.js:47:24
at process.env.NODE_ENV.exports.act (node_modules/react/cjs/react.development.js:814:22)
at node_modules/@testing-library/react/dist/act-compat.js:46:25
at unstable_advanceTimersWrapper (node_modules/@testing-library/react/dist/pure.js:78:35)
at node_modules/@testing-library/dom/dist/wait-for.js:65:15
at waitFor (node_modules/@testing-library/dom/dist/wait-for.js:36:10)
at node_modules/@testing-library/dom/dist/wait-for.js:164:54
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:87:28)
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:164:35)
at node_modules/@testing-library/dom/dist/query-helpers.js:86:33
at findByRole (src/attachment-action-lifetime.test.tsx:57:33)
console.warn
A function to advance timers was called but the timers APIs are not replaced with fake timers. Call `jest.useFakeTimers()` in this test file or enable fake timers for all tests by setting 'fakeTimers': {'enableGlobally': true} in Jest configuration file.
Stack Trace:
55 | try {
56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
> 57 | const dialog = await screen.findByRole('dialog');
| ^
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
Error:
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:654:7)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/react/dist/pure.js:96:16
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:91:13)
at src/attachment-action-lifetime.test.tsx:57:20
55 | try {
56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
> 57 | const dialog = await screen.findByRole('dialog');
| ^
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:652:28)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/react/dist/pure.js:96:16
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:91:13)
at src/attachment-action-lifetime.test.tsx:57:20
console.warn
A function to advance timers was called but the timers APIs are not replaced with fake timers. Call `jest.useFakeTimers()` in this test file or enable fake timers for all tests by setting 'fakeTimers': {'enableGlobally': true} in Jest configuration file.
Stack Trace:
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
> 59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
| ^
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
61 | expect(mockedApi.post).not.toHaveBeenCalled();
62 | expect(mockedApi.patch).not.toHaveBeenCalled();
Error:
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:654:7)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/dom/dist/wait-for.js:71:16
at node_modules/@testing-library/react/dist/act-compat.js:47:24
at process.env.NODE_ENV.exports.act (node_modules/react/cjs/react.development.js:814:22)
at node_modules/@testing-library/react/dist/act-compat.js:46:25
at unstable_advanceTimersWrapper (node_modules/@testing-library/react/dist/pure.js:78:35)
at node_modules/@testing-library/dom/dist/wait-for.js:65:15
at waitFor (node_modules/@testing-library/dom/dist/wait-for.js:36:10)
at node_modules/@testing-library/dom/dist/wait-for.js:164:54
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:87:28)
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:164:35)
at src/attachment-action-lifetime.test.tsx:59:18
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
> 59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
| ^
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
61 | expect(mockedApi.post).not.toHaveBeenCalled();
62 | expect(mockedApi.patch).not.toHaveBeenCalled();
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:652:28)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/dom/dist/wait-for.js:71:16
at node_modules/@testing-library/react/dist/act-compat.js:47:24
at process.env.NODE_ENV.exports.act (node_modules/react/cjs/react.development.js:814:22)
at node_modules/@testing-library/react/dist/act-compat.js:46:25
at unstable_advanceTimersWrapper (node_modules/@testing-library/react/dist/pure.js:78:35)
at node_modules/@testing-library/dom/dist/wait-for.js:65:15
at waitFor (node_modules/@testing-library/dom/dist/wait-for.js:36:10)
at node_modules/@testing-library/dom/dist/wait-for.js:164:54
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:87:28)
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:164:35)
at src/attachment-action-lifetime.test.tsx:59:18
console.warn
A function to advance timers was called but the timers APIs are not replaced with fake timers. Call `jest.useFakeTimers()` in this test file or enable fake timers for all tests by setting 'fakeTimers': {'enableGlobally': true} in Jest configuration file.
Stack Trace:
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
> 59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
| ^
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
61 | expect(mockedApi.post).not.toHaveBeenCalled();
62 | expect(mockedApi.patch).not.toHaveBeenCalled();
Error:
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:654:7)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/react/dist/pure.js:96:16
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:91:13)
at src/attachment-action-lifetime.test.tsx:59:5
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
> 59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
| ^
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
61 | expect(mockedApi.post).not.toHaveBeenCalled();
62 | expect(mockedApi.patch).not.toHaveBeenCalled();
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:652:28)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/react/dist/pure.js:96:16
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:91:13)
at src/attachment-action-lifetime.test.tsx:59:5
console.warn
A function to advance timers was called but the timers APIs are not replaced with fake timers. Call `jest.useFakeTimers()` in this test file or enable fake timers for all tests by setting 'fakeTimers': {'enableGlobally': true} in Jest configuration file.
Stack Trace:
54 | const view = render(page());
55 | try {
> 56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
| ^
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
Error:
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:654:7)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/dom/dist/wait-for.js:71:16
at node_modules/@testing-library/react/dist/act-compat.js:47:24
at process.env.NODE_ENV.exports.act (node_modules/react/cjs/react.development.js:814:22)
at node_modules/@testing-library/react/dist/act-compat.js:46:25
at unstable_advanceTimersWrapper (node_modules/@testing-library/react/dist/pure.js:78:35)
at node_modules/@testing-library/dom/dist/wait-for.js:65:15
at waitFor (node_modules/@testing-library/dom/dist/wait-for.js:36:10)
at node_modules/@testing-library/dom/dist/wait-for.js:164:54
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:87:28)
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:164:35)
at node_modules/@testing-library/dom/dist/query-helpers.js:86:33
at findByRole (src/attachment-action-lifetime.test.tsx:56:34)
54 | const view = render(page());
55 | try {
> 56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
| ^
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:652:28)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/dom/dist/wait-for.js:71:16
at node_modules/@testing-library/react/dist/act-compat.js:47:24
at process.env.NODE_ENV.exports.act (node_modules/react/cjs/react.development.js:814:22)
at node_modules/@testing-library/react/dist/act-compat.js:46:25
at unstable_advanceTimersWrapper (node_modules/@testing-library/react/dist/pure.js:78:35)
at node_modules/@testing-library/dom/dist/wait-for.js:65:15
at waitFor (node_modules/@testing-library/dom/dist/wait-for.js:36:10)
at node_modules/@testing-library/dom/dist/wait-for.js:164:54
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:87:28)
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:164:35)
at node_modules/@testing-library/dom/dist/query-helpers.js:86:33
at findByRole (src/attachment-action-lifetime.test.tsx:56:34)
console.warn
A function to advance timers was called but the timers APIs are not replaced with fake timers. Call `jest.useFakeTimers()` in this test file or enable fake timers for all tests by setting 'fakeTimers': {'enableGlobally': true} in Jest configuration file.
Stack Trace:
54 | const view = render(page());
55 | try {
> 56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
| ^
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
Error:
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:654:7)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/react/dist/pure.js:96:16
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:91:13)
at src/attachment-action-lifetime.test.tsx:56:21
54 | const view = render(page());
55 | try {
> 56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
| ^
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:652:28)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/react/dist/pure.js:96:16
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:91:13)
at src/attachment-action-lifetime.test.tsx:56:21
console.warn
A function to advance timers was called but the timers APIs are not replaced with fake timers. Call `jest.useFakeTimers()` in this test file or enable fake timers for all tests by setting 'fakeTimers': {'enableGlobally': true} in Jest configuration file.
Stack Trace:
55 | try {
56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
> 57 | const dialog = await screen.findByRole('dialog');
| ^
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
Error:
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:654:7)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/dom/dist/wait-for.js:71:16
at node_modules/@testing-library/react/dist/act-compat.js:47:24
at process.env.NODE_ENV.exports.act (node_modules/react/cjs/react.development.js:814:22)
at node_modules/@testing-library/react/dist/act-compat.js:46:25
at unstable_advanceTimersWrapper (node_modules/@testing-library/react/dist/pure.js:78:35)
at node_modules/@testing-library/dom/dist/wait-for.js:65:15
at waitFor (node_modules/@testing-library/dom/dist/wait-for.js:36:10)
at node_modules/@testing-library/dom/dist/wait-for.js:164:54
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:87:28)
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:164:35)
at node_modules/@testing-library/dom/dist/query-helpers.js:86:33
at findByRole (src/attachment-action-lifetime.test.tsx:57:33)
55 | try {
56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
> 57 | const dialog = await screen.findByRole('dialog');
| ^
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:652:28)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/dom/dist/wait-for.js:71:16
at node_modules/@testing-library/react/dist/act-compat.js:47:24
at process.env.NODE_ENV.exports.act (node_modules/react/cjs/react.development.js:814:22)
at node_modules/@testing-library/react/dist/act-compat.js:46:25
at unstable_advanceTimersWrapper (node_modules/@testing-library/react/dist/pure.js:78:35)
at node_modules/@testing-library/dom/dist/wait-for.js:65:15
at waitFor (node_modules/@testing-library/dom/dist/wait-for.js:36:10)
at node_modules/@testing-library/dom/dist/wait-for.js:164:54
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:87:28)
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:164:35)
at node_modules/@testing-library/dom/dist/query-helpers.js:86:33
at findByRole (src/attachment-action-lifetime.test.tsx:57:33)
console.warn
A function to advance timers was called but the timers APIs are not replaced with fake timers. Call `jest.useFakeTimers()` in this test file or enable fake timers for all tests by setting 'fakeTimers': {'enableGlobally': true} in Jest configuration file.
Stack Trace:
55 | try {
56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
> 57 | const dialog = await screen.findByRole('dialog');
| ^
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
Error:
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:654:7)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/react/dist/pure.js:96:16
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:91:13)
at src/attachment-action-lifetime.test.tsx:57:20
55 | try {
56 | fireEvent.click(await screen.findByRole('button', { name: `${copy.attachmentsPreview}: ${file.fileName}` }));
> 57 | const dialog = await screen.findByRole('dialog');
| ^
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:652:28)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/react/dist/pure.js:96:16
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:91:13)
at src/attachment-action-lifetime.test.tsx:57:20
console.warn
A function to advance timers was called but the timers APIs are not replaced with fake timers. Call `jest.useFakeTimers()` in this test file or enable fake timers for all tests by setting 'fakeTimers': {'enableGlobally': true} in Jest configuration file.
Stack Trace:
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
> 59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
| ^
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
61 | expect(mockedApi.post).not.toHaveBeenCalled();
62 | expect(mockedApi.patch).not.toHaveBeenCalled();
Error:
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:654:7)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/dom/dist/wait-for.js:71:16
at node_modules/@testing-library/react/dist/act-compat.js:47:24
at process.env.NODE_ENV.exports.act (node_modules/react/cjs/react.development.js:814:22)
at node_modules/@testing-library/react/dist/act-compat.js:46:25
at unstable_advanceTimersWrapper (node_modules/@testing-library/react/dist/pure.js:78:35)
at node_modules/@testing-library/dom/dist/wait-for.js:65:15
at waitFor (node_modules/@testing-library/dom/dist/wait-for.js:36:10)
at node_modules/@testing-library/dom/dist/wait-for.js:164:54
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:87:28)
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:164:35)
at src/attachment-action-lifetime.test.tsx:59:18
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
> 59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
| ^
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
61 | expect(mockedApi.post).not.toHaveBeenCalled();
62 | expect(mockedApi.patch).not.toHaveBeenCalled();
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:652:28)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/dom/dist/wait-for.js:71:16
at node_modules/@testing-library/react/dist/act-compat.js:47:24
at process.env.NODE_ENV.exports.act (node_modules/react/cjs/react.development.js:814:22)
at node_modules/@testing-library/react/dist/act-compat.js:46:25
at unstable_advanceTimersWrapper (node_modules/@testing-library/react/dist/pure.js:78:35)
at node_modules/@testing-library/dom/dist/wait-for.js:65:15
at waitFor (node_modules/@testing-library/dom/dist/wait-for.js:36:10)
at node_modules/@testing-library/dom/dist/wait-for.js:164:54
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:87:28)
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:164:35)
at src/attachment-action-lifetime.test.tsx:59:18
console.warn
A function to advance timers was called but the timers APIs are not replaced with fake timers. Call `jest.useFakeTimers()` in this test file or enable fake timers for all tests by setting 'fakeTimers': {'enableGlobally': true} in Jest configuration file.
Stack Trace:
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
> 59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
| ^
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
61 | expect(mockedApi.post).not.toHaveBeenCalled();
62 | expect(mockedApi.patch).not.toHaveBeenCalled();
Error:
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:654:7)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/react/dist/pure.js:96:16
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:91:13)
at src/attachment-action-lifetime.test.tsx:59:5
57 | const dialog = await screen.findByRole('dialog');
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
> 59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
| ^
60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
61 | expect(mockedApi.post).not.toHaveBeenCalled();
62 | expect(mockedApi.patch).not.toHaveBeenCalled();
at FakeTimers._checkFakeTimers (node_modules/@jest/fake-timers/build/index.js:652:28)
at FakeTimers.advanceTimersByTime (node_modules/@jest/fake-timers/build/index.js:578:14)
at node_modules/@testing-library/react/dist/pure.js:96:16
at Object.asyncWrapper (node_modules/@testing-library/react/dist/pure.js:91:13)
at src/attachment-action-lifetime.test.tsx:59:5
FAIL src/attachment-action-lifetime.test.tsx
● preview download keeps the attachment identity and filename (en)
expect(received).toEqual(expected) // deep equality
- Expected - 1
+ Received + 1
Array [
"/attachments/download/7",
- "/attachments/download/7",
+ "/attachments/download/0",
]
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
> 60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
| ^
61 | expect(mockedApi.post).not.toHaveBeenCalled();
62 | expect(mockedApi.patch).not.toHaveBeenCalled();
63 | expect(mockedApi.delete).not.toHaveBeenCalled();
at toEqual (src/attachment-action-lifetime.test.tsx:60:112)
● preview download keeps the attachment identity and filename (nb)
expect(received).toEqual(expected) // deep equality
- Expected - 1
+ Received + 1
Array [
"/attachments/download/7",
- "/attachments/download/7",
+ "/attachments/download/0",
]
58 | fireEvent.click(within(dialog).getByRole('button', { name: copy.attachmentsDownload }));
59 | await waitFor(() => expect(downloads).toEqual([file.fileName]));
> 60 | expect(mockedApi.get.mock.calls.filter(([url]) => String(url).includes('/download/')).map(([url]) => url)).toEqual(['/attachments/download/7', '/attachments/download/7']);
| ^
61 | expect(mockedApi.post).not.toHaveBeenCalled();
62 | expect(mockedApi.patch).not.toHaveBeenCalled();
63 | expect(mockedApi.delete).not.toHaveBeenCalled();
at toEqual (src/attachment-action-lifetime.test.tsx:60:112)
Test Suites: 1 failed, 1 total
Tests: 2 failed, 60 skipped, 62 total
Snapshots: 0 total
Time: 3.825 s
Ran all test suites matching src/attachment-action-lifetime.test.tsx with tests matching "preview download keeps".
Test results written to: E:\Storage\Projects\Active\temp docs\jobjakt-local-build\attachment-preview-download-red.json