Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 418de0ada6 | |||
| 5c00ec8751 | |||
| 21606ddbd1 | |||
| 54550c1c6e |
@@ -0,0 +1,38 @@
|
||||
# Scoped Jest glob 14 candidate
|
||||
|
||||
Baseline: `efa438201c66d74149d76646ea9243efa145c10f`; isolated branch `codex/jest-glob14-candidate`. This candidate has the local Windows qualification below and remains pending parent review. Original validated branch and shared node_modules remain untouched. No integrated acceptance, push, main merge, deployment, or orchestrator action is implied.
|
||||
|
||||
Before the scheduled full run, three parent-reviewed source commits were incorporated without overlap/conflicts: `336bc09987e5f3eb7b21c3a312284d9e45b3b9fc`→`54550c1c` (interview parent read/draft isolation), `5262bee15a8d861b7cc3cf74e4737fc0c430681e`→`21606ddb` (compact CV heading hierarchy), and `f2e6a517ebe79bba293bcf0551ef38a438062fe8`→`5c00ec87` (answer draft preservation). Full-run source HEAD is `5c00ec87516364abd01791fd744bcf3ce649b7c5` plus the isolated candidate diff; `SOURCE_INPUTS.json` binds415 actual frontend files and the exact tracked diff. Original discovery snapshots predate these source inputs, so subsequent execution ordering/timing changes must not be attributed automatically to glob.
|
||||
|
||||
## Candidate scope and lock resolution
|
||||
|
||||
The three existing glob ^10.5.0 consumers are @jest/reporters 30.4.1 (coverage thresholds), jest-config 30.4.2 (project expansion), and jest-runtime 30.4.2 (missing-extension diagnostics). Each uses `require('glob').glob.sync(pattern,{windowsPathsNoEscape:true})`. They pass no cancellation signal; the cancellation defect is not reached by these observed calls. Glob 10 internally requests minimatch optimizationLevel2, so attacker-controlled patterns remain relevant to its minimatch amplification advisory.
|
||||
|
||||
Package.json adds exact glob14.0.6 overrides under those three owners. Each also explicitly preserves `test-exclude: {glob: '7.2.3'}` within that scope. Existing brace-expansion/postcss/sharp/zod overrides and all direct dependency versions remain unchanged. The initial three simple owner overrides unexpectedly propagated through each owner's subtree and upgraded test-exclude's glob7 to14. A guard rejected that lock before install. Explicit nested exceptions plus regenerating from the original baseline lock preserve the complete old glob7 entry byte-for-byte in parsed JSON. An intermediate regeneration against the already-derived lock retained the wrong version; its outputs are preserved separately and are not accepted evidence.
|
||||
|
||||
The accepted candidate lock hoists glob14.0.6 and minimatch11.0.9, upgrades path-scurry1.11.1→3.0.0 and its lru-cache10.4.3→11.5.3, and removes obsolete glob10 dependencies. The now-shared minimatch11.0.9 replaces the identical nested TypeScript ESLint copy. Direct Jest/Next versions and the test-exclude glob7 tree remain unchanged. `lock-delta.json` records exact changes. Each of the four changed package version/resolved URL/integrity identities matches official npm registry metadata. This is a genuine cross-major dependency change, not a compatible-range leaf update.
|
||||
|
||||
Glob14 metadata supports Node18/20/>=22; its minimatch11 requires Node20 or >=22. Declared frontend CI/Docker use Node20, and Next16 requires >=20.9.0. Actual checks below use Windows Node24.19.0/npm11.17.0 only. Node20/Linux, hosted CI, and deployed identity remain unqualified.
|
||||
|
||||
## Evidence accounting
|
||||
|
||||
- Before patching: actual baseline project `jest --listTests --runInBand --json` returned129 suites twice with exact identical ordering/content; native outputs and normalized repo-relative paths retained.
|
||||
- Fresh own `npm ci --ignore-scripts --no-audit`: PASS,806 installed packages. Installed affected tree `npm ls`: PASS; no shared install reuse or writes.
|
||||
- Candidate actual project discovery: PASS, same129 suites in exactly the recorded baseline order. This is discovery evidence, not a suite execution result.
|
||||
- Three permanent Node fixture regressions: PASS on both original baseline Jest/glob10 and installed candidate Jest/glob14. They exercise actual Jest project-glob expansion plus execution of two configured suites, actual coverage-threshold selection (100% passes;101% intentionally fails), and actual missing-import sibling-extension suggestions (intentional failed import). These nested fixture runs are not added to the main frontend suite total.
|
||||
- Fixture setup failures on both baseline and candidate are retained: JSON CLI configuration inherited rootDir into each project, producing duplicate execution; changing to a config file and explicit child roots fixed that harness issue. Aligning subprocess CWD to the temporary fixture root enabled V8 coverage collection across the C:/E: drive boundary; `.js` coverage source uses the default supported extension. The negative coverage diagnostic assertion was corrected to the actual Jest wording. No application tests/configuration or rule severity was weakened.
|
||||
- New regression-file ESLint: PASS, zero warnings.
|
||||
- Existing explicit glob-security and redirect-security commands: PASS, two cases each on the new installed tree. These remain separate from main-suite counts.
|
||||
- Fresh candidate full lock-only audit: FAIL exit1,48 high package/metavulnerability records,zero moderate/critical. Exactly one concrete advisory remains, picomatch GHSA-fc5q-39xc-vjpf. Glob/minimatch are absent from the returned concrete advisories. This is not48 independent vulnerabilities or full supply-chain clearance.
|
||||
- Fresh production-tree lock-only audit (`--omit=dev`): PASS exit0 with zero returned findings; this narrower scope does not clear the full toolchain.
|
||||
- Scheduled full frontend Jest: PASS native exit 0, 129/129 suites and 1665/1665 tests, zero failed/pending/todo, 646.02 seconds. All 129 executed suite paths match the original discovery inventory. Serial `--runInBand --no-cache`, own E: temp/cache, no test skips or weakening. These totals include the three parent-reviewed source inputs above; focused fixture/security runs are not added. The summary helper subsequently failed to decode UTF8 JSON using Windows cp1252; explicit UTF8 parsing recovered the saved native result without rerunning the suite.
|
||||
- Sequential Next 16.4.6 build: PASS, compile, TypeScript and 3/3 static pages/export. All 415 bound frontend source files remain unchanged after execution/build. Browser: NOT RUN; parent owns that lane. Node 20/Linux, backend, native/device/AT, provider/model, formal integrated security, hosted CI and production: NOT RUN.
|
||||
- Own AST-only `graphify update .`: PASS, 19,876 nodes/48,092 edges. Optional PDF/SQL extractors were absent; warnings and hashes are retained. Newly generated untracked graph artifacts were moved to sibling `jest-glob14-candidate-evidence/graphify-out`; shared A3 graph was untouched.
|
||||
|
||||
Receipts bind native subprocess bytes, exact commands/exits, normalized discovery, official metadata, rejected locks, source hashes and accepted lock delta. Remaining picomatch has no published patched version in the previously verified maintainer/registry evidence; this candidate does not fix or suppress it. Candidate audits are reported separately when complete, without inferring independent advisory elimination from npm metavulnerability count shifts.
|
||||
|
||||
## Remaining gates
|
||||
|
||||
1. Parent review of scoped overrides, registry identities, lock delta, fixture behavior, and residual dependency findings.
|
||||
2. Parent-scheduled browser checks as appropriate; declared Node20/Linux execution before claiming that environment qualified. A fresh full standalone ESLint run was not repeated; the new regression file passed scoped lint and inherited source commits have parent-owned validation.
|
||||
3. Publish/integrate only if explicitly authorised after qualification. Rollback means reverting this candidate and reinstalling the original lock, which restores affected glob10/minimatch9 and is not a security clearance.
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,523 @@
|
||||
{
|
||||
"baseline": "efa438201c66d74149d76646ea9243efa145c10f",
|
||||
"sourceHead": "5c00ec87516364abd01791fd744bcf3ce649b7c5",
|
||||
"sourceSha256Lf": {
|
||||
"job-tracker-ui/package.json": "142cebe0ae76d37e02a616d4bf615f4912411e90db1d9a8426daa43b99613596",
|
||||
"job-tracker-ui/package-lock.json": "7ebd728f99a1ed9a5334542fb578b30127b4a0c7984efe2913266e89e2fbfbd3",
|
||||
"job-tracker-ui/test/jest-glob-compatibility.test.mjs": "5d2a1f719853bb55d7e484d103cb11d3f4457b06669032f0362930d69f4c6605",
|
||||
"job-tracker-ui/test/typescript-eslint-glob-security.test.mjs": "ce08ecc4d216e5d22965dbd40c0f94fbe6666d0b9fcf64601dc29a6bc7e261d7",
|
||||
"job-tracker-ui/test/follow-redirects-security.test.mjs": "f33363739c99fb7006293ca2ae19fa506aeb08dcbc320f536c0fc669aef92189"
|
||||
},
|
||||
"nativeReceipts": [
|
||||
{
|
||||
"path": "after-build-source-check.json.gz",
|
||||
"rawSha256": "5d70a73d764ff65de8c229176dd93f5176cc93e020f5c0e75a792386d7f38547",
|
||||
"gzipSha256": "d364bfd97439fbfbceab599995fd029d8b3b667804ffc2a433865b957afbd230",
|
||||
"rawBytes": 20
|
||||
},
|
||||
{
|
||||
"path": "baseline-callers.exit.json.gz",
|
||||
"rawSha256": "e1f9b639a767ecd2c57ff6e44638cf145259366e882edfa2b1e2fbd73ce9d0aa",
|
||||
"gzipSha256": "3f5ca613e6c02ecae319df3d3666cecfaa16f1f491ec4f8acdb8b77a500b9b87",
|
||||
"rawBytes": 170
|
||||
},
|
||||
{
|
||||
"path": "baseline-callers.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "baseline-callers.stdout.txt.gz",
|
||||
"rawSha256": "a51256a953b59fe5401ebedad75f622eae1cdca104b4cd7b31799abd02f09b12",
|
||||
"gzipSha256": "84eb3d8d679b2948ef0bd6552b711a11550a1c623d54cf719b9bbf414caa32f7",
|
||||
"rawBytes": 354
|
||||
},
|
||||
{
|
||||
"path": "baseline-discovery-1.exit.json.gz",
|
||||
"rawSha256": "d5f79fdbd265f3c166bb2284f57a9b18eb72eb8aff2fbb6f1b7ad0377a06082d",
|
||||
"gzipSha256": "8c5df1747db6e20b639430d74b04eba08eb181cf29294f3eacd235f591d89aa6",
|
||||
"rawBytes": 109
|
||||
},
|
||||
{
|
||||
"path": "baseline-discovery-1.normalized.json.gz",
|
||||
"rawSha256": "ea32022a3bfab14b9ecbbbc90750de0a5596d299737f1df0eb5abf73fb0c62c0",
|
||||
"gzipSha256": "b7863ad48e50eb175a87c94560ece5b83377b2cf7ce30cb0315a8e12db7197ce",
|
||||
"rawBytes": 4916
|
||||
},
|
||||
{
|
||||
"path": "baseline-discovery-1.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "baseline-discovery-1.stdout.json.gz",
|
||||
"rawSha256": "86453c807822ed345e3ef42432d9434c3c520f65505d01c26d9726dd0f46c9a3",
|
||||
"gzipSha256": "4b80a45fc384e1939ee1890ecd21e42af057b66ba386a54effdefd139be5b8fa",
|
||||
"rawBytes": 17686
|
||||
},
|
||||
{
|
||||
"path": "baseline-discovery-2.exit.json.gz",
|
||||
"rawSha256": "d5f79fdbd265f3c166bb2284f57a9b18eb72eb8aff2fbb6f1b7ad0377a06082d",
|
||||
"gzipSha256": "8c5df1747db6e20b639430d74b04eba08eb181cf29294f3eacd235f591d89aa6",
|
||||
"rawBytes": 109
|
||||
},
|
||||
{
|
||||
"path": "baseline-discovery-2.normalized.json.gz",
|
||||
"rawSha256": "ea32022a3bfab14b9ecbbbc90750de0a5596d299737f1df0eb5abf73fb0c62c0",
|
||||
"gzipSha256": "b7863ad48e50eb175a87c94560ece5b83377b2cf7ce30cb0315a8e12db7197ce",
|
||||
"rawBytes": 4916
|
||||
},
|
||||
{
|
||||
"path": "baseline-discovery-2.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "baseline-discovery-2.stdout.json.gz",
|
||||
"rawSha256": "86453c807822ed345e3ef42432d9434c3c520f65505d01c26d9726dd0f46c9a3",
|
||||
"gzipSha256": "4b80a45fc384e1939ee1890ecd21e42af057b66ba386a54effdefd139be5b8fa",
|
||||
"rawBytes": 17686
|
||||
},
|
||||
{
|
||||
"path": "build.exit.json.gz",
|
||||
"rawSha256": "65df1be29a5b8d308f1431eabb19cfbf0bf4790a1f7b43ae3e840867e1e68bd0",
|
||||
"gzipSha256": "e5654699e8d8d22a34d815e40da7c248e3dd1f8a559473dd61f3ce873225433c",
|
||||
"rawBytes": 94
|
||||
},
|
||||
{
|
||||
"path": "build.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "build.stdout.txt.gz",
|
||||
"rawSha256": "72460cad8a9936990c56ecc560acc69695e5d5be89a32ec5a947958a7dd08a9d",
|
||||
"gzipSha256": "ad4e580fb1651abb269a6596f3cf3fa947a86a977c801ea513917b2e24fbf5a6",
|
||||
"rawBytes": 592
|
||||
},
|
||||
{
|
||||
"path": "candidate-audit.exit.json.gz",
|
||||
"rawSha256": "f468f8bf84d59a390a40e5d5ac0291111e0e6eeb79821864810ae628cbd3507e",
|
||||
"gzipSha256": "4761ccb47a53fb185b703d6c40024da0ffd4d99a4a86cb3c05e8d72c6c3e785d",
|
||||
"rawBytes": 15
|
||||
},
|
||||
{
|
||||
"path": "candidate-audit.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "candidate-audit.stdout.json.gz",
|
||||
"rawSha256": "9e0e573d75966da518d914c51672289ff616369d08b9c60fc6950d171639c9b4",
|
||||
"gzipSha256": "1f58681b8585658ed48260b58866b3ad4640c7cc5a582fa3551bc54ae709f2a5",
|
||||
"rawBytes": 23343
|
||||
},
|
||||
{
|
||||
"path": "candidate-callers.exit.json.gz",
|
||||
"rawSha256": "889c0e66174cdcc11e642fbe58791fafde3fcead435905de36f5ccf49b8b882d",
|
||||
"gzipSha256": "11ae0fa97d3c3265b42ee4f496f90854221535a15ec7a7b7f8725e4ab6bdbd36",
|
||||
"rawBytes": 78
|
||||
},
|
||||
{
|
||||
"path": "candidate-callers.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "candidate-callers.stdout.txt.gz",
|
||||
"rawSha256": "b7f05252662d25d58e165fbc3926ed5db0aae472e9a919ba1255100fe8c2a2fc",
|
||||
"gzipSha256": "04ec44cf6848b9833c84b14094af36075c0d701fa23d9d230a7bc39c6ef59c04",
|
||||
"rawBytes": 457
|
||||
},
|
||||
{
|
||||
"path": "candidate-discovery.exit.json.gz",
|
||||
"rawSha256": "d5f79fdbd265f3c166bb2284f57a9b18eb72eb8aff2fbb6f1b7ad0377a06082d",
|
||||
"gzipSha256": "8c5df1747db6e20b639430d74b04eba08eb181cf29294f3eacd235f591d89aa6",
|
||||
"rawBytes": 109
|
||||
},
|
||||
{
|
||||
"path": "candidate-discovery.normalized.json.gz",
|
||||
"rawSha256": "ea32022a3bfab14b9ecbbbc90750de0a5596d299737f1df0eb5abf73fb0c62c0",
|
||||
"gzipSha256": "b7863ad48e50eb175a87c94560ece5b83377b2cf7ce30cb0315a8e12db7197ce",
|
||||
"rawBytes": 4916
|
||||
},
|
||||
{
|
||||
"path": "candidate-discovery.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "candidate-discovery.stdout.txt.gz",
|
||||
"rawSha256": "a825409d37f87fa9ee237cee16c43c47f0721caa37f9777fb28dc5e627377291",
|
||||
"gzipSha256": "4e090d9965969cafefebd66fe1c179f3d1e18aae1554795932f38b86003bde05",
|
||||
"rawBytes": 17686
|
||||
},
|
||||
{
|
||||
"path": "candidate-lock-preserved-fresh.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "candidate-lock-preserved-fresh.stdout.txt.gz",
|
||||
"rawSha256": "17c0db54a1e8ff3e32de36431a528e128a09c047c32831fed580c56215afbced",
|
||||
"gzipSha256": "307b7266164e97819571c8f95e85865671068e8153cd682bdcc4348628172048",
|
||||
"rawBytes": 85
|
||||
},
|
||||
{
|
||||
"path": "candidate-lock-preserved.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "candidate-lock-preserved.stdout.txt.gz",
|
||||
"rawSha256": "dcc32217cbadb7cccabac1f27016396afa33d3b315398016bf80d886407f5d53",
|
||||
"gzipSha256": "3bf7654cc46f0769bc808a98ac4ff999c72c4930a479a82e9586e63b0f988e4c",
|
||||
"rawBytes": 85
|
||||
},
|
||||
{
|
||||
"path": "candidate-lock.exit.json.gz",
|
||||
"rawSha256": "47b8b6b49d4695fe6e036bd916538aff4f46773e212ca0d429db80f3963e2cfe",
|
||||
"gzipSha256": "0610f69ca93f69d5ad6b87fc15dac7e1be30033bb24c59033de8d2f93f275d38",
|
||||
"rawBytes": 15
|
||||
},
|
||||
{
|
||||
"path": "candidate-lock.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "candidate-lock.stdout.txt.gz",
|
||||
"rawSha256": "dcc32217cbadb7cccabac1f27016396afa33d3b315398016bf80d886407f5d53",
|
||||
"gzipSha256": "3bf7654cc46f0769bc808a98ac4ff999c72c4930a479a82e9586e63b0f988e4c",
|
||||
"rawBytes": 85
|
||||
},
|
||||
{
|
||||
"path": "candidate-tree.exit.json.gz",
|
||||
"rawSha256": "397dcbd3e6a77ed1217abdf7c40fe3d1bd7631eb99587a26d2d8018fc345b5af",
|
||||
"gzipSha256": "cc0fd6173c2e795846bc12e0e6152c0063a1c070397e333d317be1e81fac8f53",
|
||||
"rawBytes": 91
|
||||
},
|
||||
{
|
||||
"path": "candidate-tree.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "candidate-tree.stdout.txt.gz",
|
||||
"rawSha256": "b08adbb479f99d5884c0f47e5999409ef387c3549867018fe6527ed52b053dec",
|
||||
"gzipSha256": "9737432d006d1de01b59915904c1647604674304efe9877bc1ea89348dc39311",
|
||||
"rawBytes": 6873
|
||||
},
|
||||
{
|
||||
"path": "candidate-uncommitted.patch.gz",
|
||||
"rawSha256": "8fb96d84da91acea867f121a67b52170b5279d38650425cccd7395e7cff546bc",
|
||||
"gzipSha256": "7365e9b5a3b6ee6002c5107935b2f72e9da00b4d02e05148820e3d63a4e43628",
|
||||
"rawBytes": 17685
|
||||
},
|
||||
{
|
||||
"path": "ci.exit.json.gz",
|
||||
"rawSha256": "47b8b6b49d4695fe6e036bd916538aff4f46773e212ca0d429db80f3963e2cfe",
|
||||
"gzipSha256": "0610f69ca93f69d5ad6b87fc15dac7e1be30033bb24c59033de8d2f93f275d38",
|
||||
"rawBytes": 15
|
||||
},
|
||||
{
|
||||
"path": "ci.stderr.txt.gz",
|
||||
"rawSha256": "dfab09e91dab3c00b36cedcf884daa1dbde2cb7dbf8b9d299320d3d71597b028",
|
||||
"gzipSha256": "2f051ff55c8ec019656fd8ca81acd9bab74b22bbeecebe24c5cd9f2af435ac3b",
|
||||
"rawBytes": 778
|
||||
},
|
||||
{
|
||||
"path": "ci.stdout.txt.gz",
|
||||
"rawSha256": "c9eb679fa792be1f6dba2e1cd05569f1c9fbcfa843ed7ff73eece28f26489eaa",
|
||||
"gzipSha256": "e57fb199fa57cddf8de3812ee47d97c322a85a3a938848d8e1fbde90383a8791",
|
||||
"rawBytes": 94
|
||||
},
|
||||
{
|
||||
"path": "full-jest-results.json.gz",
|
||||
"rawSha256": "e8f054a89999e5628e75596278c5412954f0be4e9e3fd96aa6e1a9bb755db252",
|
||||
"gzipSha256": "ffe94ce6dad4dd21320ad07f8608c2506ca7af13e1336596759afc222e45cc77",
|
||||
"rawBytes": 702614
|
||||
},
|
||||
{
|
||||
"path": "full-jest.exit.json.gz",
|
||||
"rawSha256": "9f8313dc44638eda309602022899a695cf2727e65fd301c1236361a922d0002c",
|
||||
"gzipSha256": "4852533e4ca3ecc533ee5703950601fca5e2638216c819b2b5c1863de40ef38c",
|
||||
"rawBytes": 406
|
||||
},
|
||||
{
|
||||
"path": "full-jest.stderr.txt.gz",
|
||||
"rawSha256": "b1268f17ddc880898f4911d8d7874bcfe53c74c8ccc2d74418adf46b93f93951",
|
||||
"gzipSha256": "fa97a26a2731ddb7e66d133b03f98f85a6a05aa8f79d3858c43a9955e2f8ee64",
|
||||
"rawBytes": 223
|
||||
},
|
||||
{
|
||||
"path": "full-jest.stdout.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "glob-14.0.6-registry.json.gz",
|
||||
"rawSha256": "6534734646cfe087459d0e04a0e5db68d2f9aa24919db28059dcc2d03b40c519",
|
||||
"gzipSha256": "0f1060cb0d359802fcb5d579f2adedbfd53702e5083ef9a56e7de63b84683ca9",
|
||||
"rawBytes": 3659
|
||||
},
|
||||
{
|
||||
"path": "glob-regression.exit.json.gz",
|
||||
"rawSha256": "da0113d8a762cfbd47093480ce9c5e3bdb547a6a02c3a612678072fa8e0a61d2",
|
||||
"gzipSha256": "ac7c689c35be456b71bd3c6d8fb15e25dfda3bf5ec73d2bdd0c887ec88f35698",
|
||||
"rawBytes": 68
|
||||
},
|
||||
{
|
||||
"path": "glob-regression.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "glob-regression.stdout.txt.gz",
|
||||
"rawSha256": "beb4fbae4206717b59a18e5f88a18db99659bd4df164516d0be17ce6d8b6349f",
|
||||
"gzipSha256": "275bdb4535cc2afa3d857c13fb566088b6c1c79b35d830a077fae587eb8fdaa0",
|
||||
"rawBytes": 378
|
||||
},
|
||||
{
|
||||
"path": "graph-update.exit.json.gz",
|
||||
"rawSha256": "c896d23873a2776f9ef9f1fd482b9dbbab5e89923b5d686ac37b288bcf999850",
|
||||
"gzipSha256": "341d1622f97459f8f4a2531ee01c5796e5f62ee83c56d331b04033a480216ba0",
|
||||
"rawBytes": 94
|
||||
},
|
||||
{
|
||||
"path": "graph-update.stderr.txt.gz",
|
||||
"rawSha256": "252f13231cdf5188fedb3f87caa797600ea7eee4e589778807168be2fe7c20c1",
|
||||
"gzipSha256": "742558330e5618c0487c801ccaa3b27a8fdbe6a6f8d8df1123d3411fa7eabca0",
|
||||
"rawBytes": 669
|
||||
},
|
||||
{
|
||||
"path": "graph-update.stdout.txt.gz",
|
||||
"rawSha256": "c0e148e77fafa9c934153cc37ef5f6d9102e052135ac205b42be79bf4f0b214b",
|
||||
"gzipSha256": "b5a2bb974c9c97a7a76a65985763100dec03109c9222b2eae6338fc2c3c45693",
|
||||
"rawBytes": 2865
|
||||
},
|
||||
{
|
||||
"path": "GRAPH_ARTIFACTS.json.gz",
|
||||
"rawSha256": "c02ba657127ac39483e6123949743d0282a372d35cfb658de521643376da22a8",
|
||||
"gzipSha256": "de78290f53e6b35c13cba6183668143be809af3f6cef71094f1cb03b8ca38845",
|
||||
"rawBytes": 424
|
||||
},
|
||||
{
|
||||
"path": "lock-delta.json.gz",
|
||||
"rawSha256": "cd5234361cb435ac49e2fb83dbbca390fea285d706693184b01b9909d3f1c870",
|
||||
"gzipSha256": "f7fab477b431bb536555240fde93ad33ef66dcc06c4c16f5634a7b1ba57106cb",
|
||||
"rawBytes": 2463
|
||||
},
|
||||
{
|
||||
"path": "lru-cache-11.5.3-registry.json.gz",
|
||||
"rawSha256": "bb5dc2a3778a8f0aa5da88d7bb130ed1a3ceb7f0f7294835705be1e5ab383323",
|
||||
"gzipSha256": "977b26affb09095690cee10c9b59406ff366c30dd1c655bec5e7ec8ee179744a",
|
||||
"rawBytes": 5053
|
||||
},
|
||||
{
|
||||
"path": "minimatch-11.0.9-registry.json.gz",
|
||||
"rawSha256": "c52299c747e033d8bf72e22fadc923f17f29addfb94cc1be3de1a7860a210468",
|
||||
"gzipSha256": "4be025db899bd555a668b5343870e65ffeda27026d571a1e8dac242dc39b232c",
|
||||
"rawBytes": 2759
|
||||
},
|
||||
{
|
||||
"path": "path-scurry-3.0.0-registry.json.gz",
|
||||
"rawSha256": "ef27cc9cc753abad809ac0df7d37fcd7c4b48f10011b699734c253aa9163a8b6",
|
||||
"gzipSha256": "6865cf18012687b3f0053817ae925160887e397592de50f8eebd70deaaa5c8b0",
|
||||
"rawBytes": 2558
|
||||
},
|
||||
{
|
||||
"path": "production-audit.exit.json.gz",
|
||||
"rawSha256": "47b8b6b49d4695fe6e036bd916538aff4f46773e212ca0d429db80f3963e2cfe",
|
||||
"gzipSha256": "0610f69ca93f69d5ad6b87fc15dac7e1be30033bb24c59033de8d2f93f275d38",
|
||||
"rawBytes": 15
|
||||
},
|
||||
{
|
||||
"path": "production-audit.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "production-audit.stdout.json.gz",
|
||||
"rawSha256": "66c3caf4729219f53051327403cb20e8172a6b0fd27cfb00b8256504e56776f9",
|
||||
"gzipSha256": "a6e010ea341f472d88adecd67e89a066e0adfdbdd48b7e0a4cee0a314d77bd38",
|
||||
"rawBytes": 365
|
||||
},
|
||||
{
|
||||
"path": "redirect-regression.exit.json.gz",
|
||||
"rawSha256": "ded6dd68d16715de062e13a0b43f34b960c41c7d9d331afdb390c1712191b558",
|
||||
"gzipSha256": "b2699c4826b7ed316324107592ee4e4154d5c743f75a4559c3763c15c9f4abdc",
|
||||
"rawBytes": 72
|
||||
},
|
||||
{
|
||||
"path": "redirect-regression.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "redirect-regression.stdout.txt.gz",
|
||||
"rawSha256": "53dc17fbefc1d0af384bc6020f5ddd9785ae79305bd3cc8ae2f2091d8bc55d6b",
|
||||
"gzipSha256": "6ea5238d402c256d047df20d2f23a778d6186807b9f2fac2f1117bb8a0468aea",
|
||||
"rawBytes": 389
|
||||
},
|
||||
{
|
||||
"path": "rejected-scope-leak.lock-delta.json.gz",
|
||||
"rawSha256": "dcbc7a0013933916e075d5a55c7b26ec22a7f10ea6639357c6d9b00aa5b5d206",
|
||||
"gzipSha256": "7fb426b9bd08d172d6729c05293eaf3079fbf848abe79e59fc61f9032d125fed",
|
||||
"rawBytes": 4689
|
||||
},
|
||||
{
|
||||
"path": "rejected-scope-leak.package-lock.json.gz",
|
||||
"rawSha256": "e27b841a58347064864c12ba9e8b66d94df924d572b763b1ac6f1f6df884be5b",
|
||||
"gzipSha256": "f350a8a9bc14b5908f85f0162fdffdc6d08c5304bebffc2b5221d617c873eb37",
|
||||
"rawBytes": 484069
|
||||
},
|
||||
{
|
||||
"path": "setup1-baseline-callers.exit.json.gz",
|
||||
"rawSha256": "a5dab457cef26f701b8257c387631f9eb699abd5258801285911c8eeb3b954a3",
|
||||
"gzipSha256": "f1d256a8a71f1a4f60d3ea10423140da9090df4c5b37fa056a606955b8625f8d",
|
||||
"rawBytes": 170
|
||||
},
|
||||
{
|
||||
"path": "setup1-baseline-callers.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "setup1-baseline-callers.stdout.txt.gz",
|
||||
"rawSha256": "fe956ec6b68cd1b9f470acd64be685bf03ddb6c3b6ffdea0282e6051927bc0ff",
|
||||
"gzipSha256": "46f493c65be9d3fc26d0e3262719b8ca827270056be8b252b7a7b9d4626ff736",
|
||||
"rawBytes": 2286
|
||||
},
|
||||
{
|
||||
"path": "setup1-candidate-callers.exit.json.gz",
|
||||
"rawSha256": "6c560f8ac85f71cc8db2941d77fcb52b138cb45853b33cc96a813b327eebb7b7",
|
||||
"gzipSha256": "030554ee227385cde52731c7a7e0311180611b623f346276517f7be9d428aac2",
|
||||
"rawBytes": 78
|
||||
},
|
||||
{
|
||||
"path": "setup1-candidate-callers.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "setup1-candidate-callers.stdout.txt.gz",
|
||||
"rawSha256": "dda8b52f9d882e4612f35ba133955d39965ce9e9d2c145e979044ced8ee535f7",
|
||||
"gzipSha256": "fa70e25c95620ce889b8c4adaa30d299397edd0230505eb0f70670701db1b00a",
|
||||
"rawBytes": 2378
|
||||
},
|
||||
{
|
||||
"path": "setup2-baseline-callers.exit.json.gz",
|
||||
"rawSha256": "a5dab457cef26f701b8257c387631f9eb699abd5258801285911c8eeb3b954a3",
|
||||
"gzipSha256": "f1d256a8a71f1a4f60d3ea10423140da9090df4c5b37fa056a606955b8625f8d",
|
||||
"rawBytes": 170
|
||||
},
|
||||
{
|
||||
"path": "setup2-baseline-callers.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "setup2-baseline-callers.stdout.txt.gz",
|
||||
"rawSha256": "008072b55059853dcbef153d62ccad4f44332ccb602ce2912908134f964c97a4",
|
||||
"gzipSha256": "e985bd456de31b49553d127dfc1148ff51fa4db92f7faf8c897c4e8e656f5121",
|
||||
"rawBytes": 2283
|
||||
},
|
||||
{
|
||||
"path": "setup2-candidate-callers.exit.json.gz",
|
||||
"rawSha256": "6c560f8ac85f71cc8db2941d77fcb52b138cb45853b33cc96a813b327eebb7b7",
|
||||
"gzipSha256": "030554ee227385cde52731c7a7e0311180611b623f346276517f7be9d428aac2",
|
||||
"rawBytes": 78
|
||||
},
|
||||
{
|
||||
"path": "setup2-candidate-callers.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "setup2-candidate-callers.stdout.txt.gz",
|
||||
"rawSha256": "25ec09ab729d69c41c4411a7f133ab6901ea7ad8022e079e880e69bfb38c7d11",
|
||||
"gzipSha256": "fa92ca2bd2e95541086b430c8dab813098d044c87ebdb9b75f48722aacab9a0a",
|
||||
"rawBytes": 2377
|
||||
},
|
||||
{
|
||||
"path": "setup3-baseline-callers.exit.json.gz",
|
||||
"rawSha256": "a5dab457cef26f701b8257c387631f9eb699abd5258801285911c8eeb3b954a3",
|
||||
"gzipSha256": "f1d256a8a71f1a4f60d3ea10423140da9090df4c5b37fa056a606955b8625f8d",
|
||||
"rawBytes": 170
|
||||
},
|
||||
{
|
||||
"path": "setup3-baseline-callers.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "setup3-baseline-callers.stdout.txt.gz",
|
||||
"rawSha256": "ca915f19e9610f3214025418e47fa37ce7c4da667a84a32e0d5b16af200a1467",
|
||||
"gzipSha256": "a2a53cf289a91bff03ec0a6359be4a78ee171dcabec405412089b6d4a9c71ac8",
|
||||
"rawBytes": 11551
|
||||
},
|
||||
{
|
||||
"path": "setup3-candidate-callers.exit.json.gz",
|
||||
"rawSha256": "6c560f8ac85f71cc8db2941d77fcb52b138cb45853b33cc96a813b327eebb7b7",
|
||||
"gzipSha256": "030554ee227385cde52731c7a7e0311180611b623f346276517f7be9d428aac2",
|
||||
"rawBytes": 78
|
||||
},
|
||||
{
|
||||
"path": "setup3-candidate-callers.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "setup3-candidate-callers.stdout.txt.gz",
|
||||
"rawSha256": "1bcabd6f09e91fba9ab3d21a0ad3ef82cb4e202aa8acbb9e6cfc69ca61bbd344",
|
||||
"gzipSha256": "988da0c81c59b6dd90c6a69a7a4e12339e7504ce5659baed66306d4fad91eec0",
|
||||
"rawBytes": 11645
|
||||
},
|
||||
{
|
||||
"path": "SOURCE_INPUTS.json.gz",
|
||||
"rawSha256": "3ff9e86e93cf74462d708c5e3aefe90622b34251bf880bb92b615ad3d0ae3ade",
|
||||
"gzipSha256": "6968f1d0eb208298ebc9025a94ce9829c0a435500018e0cb3c0bcd92fabccf01",
|
||||
"rawBytes": 51202
|
||||
},
|
||||
{
|
||||
"path": "targeted-lint.exit.json.gz",
|
||||
"rawSha256": "47b8b6b49d4695fe6e036bd916538aff4f46773e212ca0d429db80f3963e2cfe",
|
||||
"gzipSha256": "0610f69ca93f69d5ad6b87fc15dac7e1be30033bb24c59033de8d2f93f275d38",
|
||||
"rawBytes": 15
|
||||
},
|
||||
{
|
||||
"path": "targeted-lint.stderr.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
},
|
||||
{
|
||||
"path": "targeted-lint.stdout.txt.gz",
|
||||
"rawSha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"gzipSha256": "46b50c321b39e89a491b6727a01628c34245605a30beb3e7414c5e01cff90e6e",
|
||||
"rawBytes": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,44 @@
|
||||
# Preserve interview answer drafts through same-job refresh
|
||||
|
||||
18 November 2026. Branch `codex/interview-answer-refresh`, based on validated parent-lifetime checkpoint `336bc09987e5f3eb7b21c3a312284d9e45b3b9fc`. This resolves the ordinary-refresh draft-loss limitation recorded in that checkpoint, without changing job ownership, latest-read sequencing, APIs, locale catalogue or persistence contracts.
|
||||
|
||||
## Root cause and bounded change
|
||||
|
||||
`PrepRow` explicitly treats the answer as a local draft until saved, but `Shell` unmounted all children whenever its parent started a board GET. A sibling mark-ready, add, delete or explicit answer save therefore removed unrelated answer drafts. Failed refreshes also hid the loaded board with no GET retry. Separately, the row's shared write helper cleared its own draft after a readiness-only PATCH even though no answer was saved.
|
||||
|
||||
The shared local Shell now accepts an opt-in `keepContentOnLoading` flag. Only interview prep enables it, and only when its current job-keyed workspace has a successfully loaded board. That same condition retains content on a refresh error; read errors expose the existing GET-only retry. Initial loading/failed initial reads still have no editable board/default rows. Follow-up and AI Shell callers retain their existing defaults. Explicit answer saves clear that row's draft after successful persistence; readiness-only writes retain it.
|
||||
|
||||
Fresh successful GETs remain authoritative for row presence and server content. Surviving stable row IDs retain local drafts; rows absent from the refreshed board unmount normally. Explicit discard reveals the newest server answer. Changing job still unmounts all old private content/drafts via the existing keyed workspace. No global store, stale-content cache, string addition, implicit save or write retry was added.
|
||||
|
||||
## Test-first evidence
|
||||
|
||||
New deferred-promise tests initially failed on unchanged parent source: EN/NB sibling ready/add/delete/save refreshes, EN/NB refresh-error/retry preservation, and same-row readiness-only draft preservation. Delete fixtures were corrected to await modal exit; both corrected delete cases were then rerun against original `336bc099` production bytes and failed specifically because the editor disappeared during the board GET. Fixed production bytes were restored before final verification. Overlapping reruns are not added to test totals.
|
||||
|
||||
The final suite adds **13 cases**: eight sibling-action cases across EN/NB; two refresh-error/GET-retry cases; one readiness-only case; two job-change/failed-initial-read privacy controls. The inherited latest-read test now expects a previously loaded same-job board to remain mounted during refresh, while retaining its progress indicator. Initial/cross-job loading assertions remain unchanged. Native receipt: [jest-results.json](jest-results.json).
|
||||
|
||||
## Verification
|
||||
|
||||
From `job-tracker-ui`:
|
||||
|
||||
```powershell
|
||||
rtk proxy node node_modules/jest/bin/jest.js --runInBand --runTestsByPath src/interview-prep.test.tsx --cacheDirectory='../.test-cache' --json --outputFile='../docs/validation/interview-answer-refresh/jest-results.json'
|
||||
rtk proxy node node_modules/typescript/bin/tsc --noEmit --incremental false
|
||||
rtk proxy node node_modules/eslint/bin/eslint.js src/components/InterviewPrep.tsx src/interview-prep.test.tsx --max-warnings=0
|
||||
```
|
||||
|
||||
- Focused jsdom: **76/76 passed**, zero failed/skipped, no snapshots or React warnings; runner duration 28.558 seconds. This is 63 inherited plus 13 new cases, not a cumulative total of repeated runs.
|
||||
- Full UI TypeScript: passed, exit 0.
|
||||
- Scoped ESLint: passed, exit 0, zero warnings.
|
||||
- `rtk git diff --check`: passed.
|
||||
- Graph-first query used the existing parent worktree graph before source inspection. Its local graph artifacts were copied into this new worktree solely as an update seed. `rtk proxy graphify update .` ran AST-only here after source edits, with no API/model calls or shared graph mutation. Optional PDF/SQL extraction dependencies were absent; graph results provide structural orientation only. Generated graph and Jest cache remain local untracked artifacts.
|
||||
|
||||
Existing dependencies were accessed through the approved read-only junction to `next-security-patch/job-tracker-ui/node_modules`; no install, application build, browser or server ran.
|
||||
|
||||
Validated working-file SHA-256:
|
||||
|
||||
| File | SHA-256 |
|
||||
| --- | --- |
|
||||
| `job-tracker-ui/src/components/InterviewPrep.tsx` | `088cd555085bdecede0d61aa5b822505126ce5c66272f57030a532df50ff11cb` |
|
||||
| `job-tracker-ui/src/interview-prep.test.tsx` | `f02cfda979b20a76972765d96e47538b3574507a5b442c209086e663ce2e22bd` |
|
||||
|
||||
Browser/native/device, broader repository suites, hosted CI, backend/database, live AI/provider and production checks were not run. Root owns source-bound browser qualification, publication/integration and central tracking. Pending explicit writes still complete against their original job; this patch neither cancels nor redirects them. A deleted or recategorised row can legitimately unmount on authoritative refresh; preserving arbitrary removed content is outside this change.
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,45 @@
|
||||
# Interview parent state lifetime
|
||||
|
||||
17 November 2026; final revalidation 18 November 2026. Development checkpoint based on A3 `eb253877`, branch `codex/interview-parent-lifetime`. Scope is the interview-preparation and follow-up parent components and their unit tests. No runtime locale expansion, model/service calls, schema changes, production work or approval changes.
|
||||
|
||||
## Reproduced defects and fix
|
||||
|
||||
On unchanged baseline, deferred reads for application 7 were completed after rendering application 8. Seven regression cases failed: previous prep content replaced the current board; previous follow-up data overwrote a current draft; stale errors appeared in either current surface; stale finalisers dismissed either current loading state; and parent drafts/data survived the application boundary, causing a failed new follow-up read to expose old editable data instead of a GET-only retry.
|
||||
|
||||
A second pre-fix run added three cases: an older same-application refresh replaced a newer board, and a late prep addition cleared the new application's title draft and initiated a previous-application reload (both failed); a late follow-up write already retained its original API target (positive control passed). Thus nine expected failing regressions and one passing control were observed before editing production code; overlapping reruns are not additional unique tests.
|
||||
|
||||
The exported prep/follow-up components now render a job-keyed private workspace, following the existing keyed interview-assistant ownership pattern. Changing job unmounts its board, drafts, error and busy state together. A per-workspace active flag and read sequence guard read success/error/finally, and prevent an unmounted workspace from starting a refresh after an existing write completes. Only the newest read can update a mounted owner. Explicit writes retain their original closure/API target; no write is cancelled, migrated to another application or retried automatically. Same-application language changes keep the same workspace and its drafts.
|
||||
|
||||
Two additional same-application controls exercise stale errors and stale finalisers while a newer refresh remains pending. Existing rerender tests now await remount reads inside `act`, avoiding React test warnings caused by unawaited new parent workspaces. No test suppresses console output.
|
||||
|
||||
## Verification
|
||||
|
||||
Commands from `job-tracker-ui`:
|
||||
|
||||
```powershell
|
||||
rtk proxy node node_modules/jest/bin/jest.js --runInBand --runTestsByPath src/interview-prep.test.tsx --cacheDirectory='../.test-cache'
|
||||
rtk proxy node node_modules/typescript/bin/tsc --noEmit --incremental false
|
||||
rtk proxy node node_modules/eslint/bin/eslint.js src/components/InterviewPrep.tsx src/interview-prep.test.tsx --max-warnings=0
|
||||
```
|
||||
|
||||
- Final focused jsdom suite: **63/63 passed**, no snapshots, no React warnings. This includes 12 added cases and the existing 51; prior focused runs are not added to that total.
|
||||
- Native runner receipt: [jest-results.json](jest-results.json), produced with `--json --outputFile='../docs/validation/interview-parent-lifetime/jest-results.json'` added to the command above. Final revalidation passed 63/63 with zero failed/pending tests and 23.206 seconds reported by the runner. This is a repeat of the same source-bound cases, not an additional 63 distinct tests.
|
||||
- Full UI TypeScript check: passed, exit 0.
|
||||
- Scoped lint: passed, exit 0, zero warnings. An earlier cleanup-ref lint warning was fixed by checking the active flag on completion instead of mutating the read ref during cleanup.
|
||||
- `rtk git diff --check`: passed.
|
||||
- Graph-first query used the existing isolated A3 research graph before source inspection. `rtk proxy graphify update .` performed AST-only extraction in this new worktree, without API/model calls or shared graph mutation. The initial refresh created 19,835 nodes and 48,044 edges; an incremental refresh followed the final source/test edits. Generated graph output is local untracked research material, not a new runtime dependency. Graph reported missing optional PDF/SQL extraction dependencies and unsupported/no-symbol files; this is structural orientation, not full runtime or document analysis.
|
||||
|
||||
Existing dependencies were accessed read-only through a directory junction to `E:/Storage/Projects/Active/temp docs/jobjakt-local-build/next-security-patch/job-tracker-ui/node_modules`. No install/build/browser lane ran.
|
||||
|
||||
Validated working-file SHA-256:
|
||||
|
||||
| File | SHA-256 |
|
||||
| --- | --- |
|
||||
| `job-tracker-ui/src/components/InterviewPrep.tsx` | `57d208df5880d8b93c9a3acf13e7b11d2791f4a9d3fdf55da56debe68c3145ee` |
|
||||
| `job-tracker-ui/src/interview-prep.test.tsx` | `82c36af6225d4fb00fb689bf7243ef2163b6abc237c91a7058f283c173d34471` |
|
||||
|
||||
## Limits and integration
|
||||
|
||||
Browser/native/device, broader repository suites, hosted CI, backend/database, live AI, provider and production checks were not run. Root owns source-bound browser qualification, integration/publication and central tracking. This checkpoint does not grant release or roadmap-stage approval.
|
||||
|
||||
Adjacent existing behaviour remains: ordinary same-application board refresh hides/remounts row editors through `Shell`'s loading condition; preserving row-local unsaved answers during every ordinary refresh needs a separate behavioural decision and test package. This fix prevents superseded reads from replacing the newest board/draft state; it does not redesign refresh presentation or persistence. Pending writes may still finish on the original application after navigation, as explicitly initiated by the user.
|
||||
File diff suppressed because one or more lines are too long
@@ -427,7 +427,7 @@ test('[P7-06 forms] live EN/Bokmal retains dirty letter and both answer drafts w
|
||||
test.setTimeout(90_000); const seeded = await fixture(page, session.owner); await enter(page, session.owner, seeded.job, 'letter');
|
||||
await expect(letter(page)).toHaveValue(seeded.originalLetter); await letter(page).fill('Dirty owner text remains the same across UI locale — æøå');
|
||||
let reads = assetReads(session, seeded.job.id).length;
|
||||
const firstLocale = response(page, 'PUT', `${apiUrl}/auth/preferences/language`); await keyboard(page, page.locator('header').first().getByRole('button', { name: 'Norsk', exact: true }));
|
||||
const firstLocale = response(page, 'PUT', `${apiUrl}/auth/preferences/language`); await keyboard(page, page.locator('header').first().getByRole('button', { name: translations.en.languageNorwegianBokmal, exact: true }));
|
||||
const firstLocaleResponse = await firstLocale;
|
||||
await info.attach('application-locale-first-http', { body: JSON.stringify({ status: firstLocaleResponse.status(), body: await firstLocaleResponse.text() }), contentType: 'application/json' });
|
||||
expect(firstLocaleResponse.status()).toBe(204);
|
||||
@@ -556,7 +556,7 @@ test('[P7-06 forms] controlled language HTTP503 preserves local dirty drafts and
|
||||
const dirtyLetter = 'Controlled-failure draft; retain my exact unsaved letter — æøå';
|
||||
await letter(page).fill(dirtyLetter); let reads = assetReads(session, seeded.job.id).length;
|
||||
const firstResponse = response(page, 'PUT', preferenceUrl);
|
||||
await keyboard(page, page.locator('header').first().getByRole('button', { name: 'Norsk', exact: true }));
|
||||
await keyboard(page, page.locator('header').first().getByRole('button', { name: translations.en.languageNorwegianBokmal, exact: true }));
|
||||
expect((await firstResponse).status()).toBe(503); await expect(page.locator('html')).toHaveAttribute('lang', 'nb-NO');
|
||||
await expect(letter(page, 'nb')).toHaveValue(dirtyLetter);
|
||||
const nbFeedback = page.getByRole('alert').filter({ hasText: translations.nb.settingsLanguageSaveFailed }); await expect(nbFeedback).toBeVisible();
|
||||
|
||||
Generated
+29
-304
@@ -3149,24 +3149,6 @@
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@isaacs/cliui": {
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
|
||||
"integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"string-width": "^5.1.2",
|
||||
"string-width-cjs": "npm:string-width@^4.2.0",
|
||||
"strip-ansi": "^7.0.1",
|
||||
"strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
|
||||
"wrap-ansi": "^8.1.0",
|
||||
"wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@isaacs/nonrecursive-glob-match": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz",
|
||||
@@ -4346,17 +4328,6 @@
|
||||
"node": ">=12.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@pkgjs/parseargs": {
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
|
||||
"integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/@pkgr/core": {
|
||||
"version": "0.3.6",
|
||||
"resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.3.6.tgz",
|
||||
@@ -4991,23 +4962,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
|
||||
"version": "11.0.9",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.9.tgz",
|
||||
"integrity": "sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"@isaacs/nonrecursive-glob-match": "^1.1.0",
|
||||
"brace-expansion": "^5.0.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "8.73.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.73.0.tgz",
|
||||
@@ -6629,13 +6583,6 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/eastasianwidth": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
|
||||
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.5.418",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.418.tgz",
|
||||
@@ -7785,23 +7732,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/foreground-child": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz",
|
||||
"integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.6",
|
||||
"signal-exit": "^4.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "4.0.6",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz",
|
||||
@@ -8005,22 +7935,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "10.5.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",
|
||||
"integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",
|
||||
"deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me",
|
||||
"version": "14.0.6",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-14.0.6.tgz",
|
||||
"integrity": "sha512-OwXjVP2svY5EyLY75Vek96C8qK43gqrt4xsZ+qSILdnaEiJPXkd62mcfUSNx/TQErQRdu5uM5kF67sfONragKw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"foreground-child": "^3.1.0",
|
||||
"jackspeak": "^3.1.2",
|
||||
"minimatch": "^9.0.4",
|
||||
"minipass": "^7.1.2",
|
||||
"package-json-from-dist": "^1.0.0",
|
||||
"path-scurry": "^1.11.1"
|
||||
"minimatch": "^11.0.5",
|
||||
"minipass": "^7.1.3",
|
||||
"path-scurry": "^3.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"glob": "dist/esm/bin.mjs"
|
||||
"engines": {
|
||||
"node": "18 || 20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
@@ -8976,22 +8902,6 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/jackspeak": {
|
||||
"version": "3.4.3",
|
||||
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",
|
||||
"integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"@isaacs/cliui": "^8.0.2"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@pkgjs/parseargs": "^0.11.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jest": {
|
||||
"version": "30.4.2",
|
||||
"resolved": "https://registry.npmjs.org/jest/-/jest-30.4.2.tgz",
|
||||
@@ -10246,16 +10156,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "9.0.9",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
|
||||
"integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",
|
||||
"version": "11.0.9",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.9.tgz",
|
||||
"integrity": "sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.2"
|
||||
"@isaacs/nonrecursive-glob-match": "^1.1.0",
|
||||
"brace-expansion": "^5.0.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16 || 14 >=14.17"
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
@@ -10697,13 +10608,6 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/package-json-from-dist": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
|
||||
"integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0"
|
||||
},
|
||||
"node_modules/parent-module": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
|
||||
@@ -10784,28 +10688,31 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/path-scurry": {
|
||||
"version": "1.11.1",
|
||||
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
|
||||
"integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-3.0.0.tgz",
|
||||
"integrity": "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"lru-cache": "^10.2.0",
|
||||
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
|
||||
"lru-cache": "^11.0.0",
|
||||
"minipass": "^7.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16 || 14 >=14.18"
|
||||
"node": "18 || 20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/path-scurry/node_modules/lru-cache": {
|
||||
"version": "10.4.3",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
|
||||
"integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
|
||||
"version": "11.5.3",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz",
|
||||
"integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
"license": "BlueOak-1.0.0",
|
||||
"engines": {
|
||||
"node": "20 || >=22"
|
||||
}
|
||||
},
|
||||
"node_modules/path-type": {
|
||||
"version": "4.0.0",
|
||||
@@ -11880,60 +11787,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/string-width": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
|
||||
"integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"eastasianwidth": "^0.2.0",
|
||||
"emoji-regex": "^9.2.2",
|
||||
"strip-ansi": "^7.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/string-width-cjs": {
|
||||
"name": "string-width",
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"strip-ansi": "^6.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/string-width-cjs/node_modules/emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/string-width-cjs/node_modules/strip-ansi": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/string.prototype.includes": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/string.prototype.includes/-/string.prototype.includes-2.0.1.tgz",
|
||||
@@ -12048,49 +11901,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-ansi": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
|
||||
"integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^6.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-ansi-cjs": {
|
||||
"name": "strip-ansi",
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-ansi/node_modules/ansi-regex": {
|
||||
"version": "6.2.2",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
|
||||
"integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-bom": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
|
||||
@@ -12917,91 +12727,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/wrap-ansi": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
|
||||
"integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^6.1.0",
|
||||
"string-width": "^5.0.1",
|
||||
"strip-ansi": "^7.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/wrap-ansi-cjs": {
|
||||
"name": "wrap-ansi",
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.0.0",
|
||||
"string-width": "^4.1.0",
|
||||
"strip-ansi": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/wrap-ansi-cjs/node_modules/string-width": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"strip-ansi": "^6.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/wrap-ansi-cjs/node_modules/strip-ansi": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/wrap-ansi/node_modules/ansi-styles": {
|
||||
"version": "6.2.3",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
|
||||
"integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
"test": "jest",
|
||||
"test:redirect-security": "node --test test/follow-redirects-security.test.mjs",
|
||||
"test:glob-security": "node --test test/typescript-eslint-glob-security.test.mjs",
|
||||
"test:jest-glob-compatibility": "node --test test/jest-glob-compatibility.test.mjs",
|
||||
"test:pdf-admission": "playwright test --config=playwright.pdf.config.ts",
|
||||
"test:rate-limits": "playwright test --config=playwright.rate-limits.config.ts",
|
||||
"test:e2e": "node ./scripts/run-e2e.mjs"
|
||||
@@ -71,6 +72,9 @@
|
||||
"jest-environment-jsdom": "^30.4.1"
|
||||
},
|
||||
"overrides": {
|
||||
"@jest/reporters": { "glob": "14.0.6", "test-exclude": { "glob": "7.2.3" } },
|
||||
"jest-config": { "glob": "14.0.6", "test-exclude": { "glob": "7.2.3" } },
|
||||
"jest-runtime": { "glob": "14.0.6", "test-exclude": { "glob": "7.2.3" } },
|
||||
"brace-expansion": "2.1.7",
|
||||
"postcss": "8.5.25",
|
||||
"sharp": "0.35.5",
|
||||
|
||||
@@ -25,7 +25,7 @@ import ViewStateNotice from "./ViewStateNotice";
|
||||
// become prep items after an explicit accept action.
|
||||
// docs/architecture/overview.md.
|
||||
|
||||
function Shell({ title, subtitle, loading, error, children, onRetry, keepContentOnError = false }: {
|
||||
function Shell({ title, subtitle, loading, error, children, onRetry, keepContentOnError = false, keepContentOnLoading = false }: {
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
loading: boolean;
|
||||
@@ -33,16 +33,21 @@ function Shell({ title, subtitle, loading, error, children, onRetry, keepContent
|
||||
children: React.ReactNode;
|
||||
onRetry?: () => void | Promise<void>;
|
||||
keepContentOnError?: boolean;
|
||||
keepContentOnLoading?: boolean;
|
||||
}) {
|
||||
return (
|
||||
<PageSection surface title={title} description={subtitle} level="h3">
|
||||
<ViewStateNotice title={title} loading={loading} error={error ? { kind: "error", message: error, retryable: Boolean(onRetry) } : null} onRetry={onRetry} compact />
|
||||
{!loading && (!error || keepContentOnError) && children}
|
||||
{(!loading || keepContentOnLoading) && (!error || keepContentOnError) && children}
|
||||
</PageSection>
|
||||
);
|
||||
}
|
||||
|
||||
export function ApplicationInterviewPrep({ jobId }: { jobId: number }) {
|
||||
return <InterviewPrepWorkspace key={jobId} jobId={jobId} />;
|
||||
}
|
||||
|
||||
function InterviewPrepWorkspace({ jobId }: { jobId: number }) {
|
||||
const { t } = useI18n();
|
||||
const [board, setBoard] = useState<InterviewPrepBoard | null>(null);
|
||||
const [error, setError] = useState<{ cause: unknown; fallback: "interviewPrepLoadFailed" | "interviewPrepUpdateFailed" | "interviewPrepAnswerSaveFailed" } | null>(null);
|
||||
@@ -50,16 +55,26 @@ export function ApplicationInterviewPrep({ jobId }: { jobId: number }) {
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [title, setTitle] = useState("");
|
||||
const [category, setCategory] = useState(INTERVIEW_PREP_CATEGORIES[0].key);
|
||||
const active = useRef(true);
|
||||
const readSequence = useRef(0);
|
||||
useLayoutEffect(() => {
|
||||
active.current = true;
|
||||
return () => { active.current = false; };
|
||||
}, []);
|
||||
|
||||
const load = useCallback(async () => {
|
||||
if (!active.current) return;
|
||||
const request = ++readSequence.current;
|
||||
setLoading(true);
|
||||
try {
|
||||
setBoard(await interviewPrepApi.get(jobId));
|
||||
const result = await interviewPrepApi.get(jobId);
|
||||
if (!active.current || request !== readSequence.current) return;
|
||||
setBoard(result);
|
||||
setError(null);
|
||||
} catch (err) {
|
||||
setError({ cause: err, fallback: "interviewPrepLoadFailed" });
|
||||
if (active.current && request === readSequence.current) setError({ cause: err, fallback: "interviewPrepLoadFailed" });
|
||||
} finally {
|
||||
setLoading(false);
|
||||
if (active.current && request === readSequence.current) setLoading(false);
|
||||
}
|
||||
}, [jobId]);
|
||||
|
||||
@@ -104,7 +119,9 @@ export function ApplicationInterviewPrep({ jobId }: { jobId: number }) {
|
||||
subtitle={t("interviewPrepSubtitle")}
|
||||
loading={loading}
|
||||
error={error ? getApiErrorMessage(error.cause, t(error.fallback)) : null}
|
||||
keepContentOnError={error?.fallback === "interviewPrepAnswerSaveFailed" || error?.fallback === "interviewPrepUpdateFailed"}
|
||||
onRetry={error?.fallback === "interviewPrepLoadFailed" ? load : undefined}
|
||||
keepContentOnLoading={board !== null}
|
||||
keepContentOnError={board !== null}
|
||||
>
|
||||
<Stack spacing={2}>
|
||||
{board && !board.isInterviewStage && (
|
||||
@@ -341,11 +358,11 @@ function PrepRow({ jobId, item, busy, onChanged, onError }: {
|
||||
const content = draft ?? item.content ?? "";
|
||||
const dirty = draft !== null && draft !== (item.content ?? "");
|
||||
|
||||
const run = async (fn: () => Promise<unknown>) => {
|
||||
const run = async (fn: () => Promise<unknown>, savesAnswer = false) => {
|
||||
setSaving(true);
|
||||
try {
|
||||
await fn();
|
||||
setDraft(null);
|
||||
if (savesAnswer) setDraft(null);
|
||||
onChanged();
|
||||
} catch (err) {
|
||||
onError({ cause: err, fallback: "interviewPrepAnswerSaveFailed" });
|
||||
@@ -390,7 +407,7 @@ function PrepRow({ jobId, item, busy, onChanged, onError }: {
|
||||
size="small"
|
||||
variant="contained"
|
||||
disabled={saving}
|
||||
onClick={() => run(() => interviewPrepApi.update(jobId, item.id, { content }))}
|
||||
onClick={() => run(() => interviewPrepApi.update(jobId, item.id, { content }), true)}
|
||||
>
|
||||
{t("interviewPrepSaveAnswer")}
|
||||
</Button>
|
||||
@@ -424,6 +441,10 @@ function PrepRow({ jobId, item, busy, onChanged, onError }: {
|
||||
}
|
||||
|
||||
export function ApplicationFollowUp({ jobId }: { jobId: number }) {
|
||||
return <FollowUpWorkspace key={jobId} jobId={jobId} />;
|
||||
}
|
||||
|
||||
function FollowUpWorkspace({ jobId }: { jobId: number }) {
|
||||
const { t } = useI18n();
|
||||
const [data, setData] = useState<FollowUp | null>(null);
|
||||
const [error, setError] = useState<{ cause: unknown; fallback: "interviewFollowUpLoadFailed" | "interviewFollowUpSaveFailed" } | null>(null);
|
||||
@@ -431,19 +452,28 @@ export function ApplicationFollowUp({ jobId }: { jobId: number }) {
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [date, setDate] = useState<string>("");
|
||||
const [action, setAction] = useState<string>("");
|
||||
const active = useRef(true);
|
||||
const readSequence = useRef(0);
|
||||
useLayoutEffect(() => {
|
||||
active.current = true;
|
||||
return () => { active.current = false; };
|
||||
}, []);
|
||||
|
||||
const load = useCallback(async () => {
|
||||
if (!active.current) return;
|
||||
const request = ++readSequence.current;
|
||||
setLoading(true);
|
||||
try {
|
||||
const result = await interviewPrepApi.followUp(jobId);
|
||||
if (!active.current || request !== readSequence.current) return;
|
||||
setData(result);
|
||||
setDate(result.followUpAt ? result.followUpAt.slice(0, 10) : "");
|
||||
setAction(result.nextAction ?? "");
|
||||
setError(null);
|
||||
} catch (err) {
|
||||
setError({ cause: err, fallback: "interviewFollowUpLoadFailed" });
|
||||
if (active.current && request === readSequence.current) setError({ cause: err, fallback: "interviewFollowUpLoadFailed" });
|
||||
} finally {
|
||||
setLoading(false);
|
||||
if (active.current && request === readSequence.current) setLoading(false);
|
||||
}
|
||||
}, [jobId]);
|
||||
|
||||
|
||||
@@ -331,6 +331,7 @@ test('mobile studio navigation exposes complete section labels and retains edits
|
||||
routeGet(() => Promise.resolve({ data: variant }));
|
||||
renderAt(3);
|
||||
await screen.findByDisplayValue('Backend CV');
|
||||
expect(screen.getByRole('heading', { name: translations.en.cvEditorEditingRegion, level: 2 })).toBeInTheDocument();
|
||||
const navigation = screen.getByRole('combobox', { name: new RegExp(`^${translations.en.cvEditorStudioNavigation}`) });
|
||||
fireEvent.change(screen.getByLabelText('Headline override'), { target: { value: 'Retained mobile draft' } });
|
||||
fireEvent.mouseDown(navigation);
|
||||
|
||||
@@ -63,6 +63,232 @@ beforeEach(() => {
|
||||
window.localStorage.setItem("uiLanguage", "en");
|
||||
});
|
||||
|
||||
function deferredRead() {
|
||||
let resolve!: (value: any) => void;
|
||||
let reject!: (reason: unknown) => void;
|
||||
const promise = new Promise<any>((yes, no) => { resolve = yes; reject = no; });
|
||||
return { promise, resolve, reject };
|
||||
}
|
||||
|
||||
test.each((['en', 'nb'] as const).flatMap(language => (['ready', 'add', 'delete', 'save'] as const).map(operation => [language, operation] as const)))('same-application %s %s refresh keeps a sibling answer mounted until explicit discard', async (language, operation) => {
|
||||
localStorage.setItem('uiLanguage', language);
|
||||
const copy = translations[language];
|
||||
mockedApi.get.mockReset(); routeGet();
|
||||
const read = mockedApi.get.getMockImplementation()!;
|
||||
const refresh = deferredRead(); let reads = 0;
|
||||
mockedApi.get.mockImplementation((url: string) => url.endsWith('/interview-prep') && ++reads > 1 ? refresh.promise : read(url));
|
||||
mockedApi.patch.mockReset().mockResolvedValue({ data: board.groups[0].items[0] } as any);
|
||||
mockedApi.post.mockReset().mockResolvedValue({ data: board.groups[0].items[0] } as any);
|
||||
mockedApi.delete.mockReset().mockResolvedValue({ data: null } as any);
|
||||
render(<ApplicationInterviewPrep jobId={7} />);
|
||||
const name = copy.interviewPrepAnswerFor.replace('{title}', 'Tell me about a conflict');
|
||||
const answer = await screen.findByRole('textbox', { name });
|
||||
fireEvent.change(answer, { target: { value: 'My unsaved sibling answer Øresund' } });
|
||||
if (operation === 'ready') fireEvent.click(screen.getByRole('checkbox', { name: copy.interviewPrepReadyLabel.replace('{title}', 'Funding history') }));
|
||||
if (operation === 'add') {
|
||||
fireEvent.change(screen.getByLabelText(copy.interviewPrepAddLabel), { target: { value: 'New prep item' } });
|
||||
fireEvent.click(screen.getByRole('button', { name: copy.interviewPrepAdd }));
|
||||
}
|
||||
if (operation === 'delete') {
|
||||
fireEvent.click(screen.getByRole('button', { name: copy.interviewPrepDeleteLabel.replace('{title}', 'Funding history') }));
|
||||
fireEvent.click(within(await screen.findByRole('dialog')).getByRole('button', { name: copy.interviewPrepDelete }));
|
||||
await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument());
|
||||
}
|
||||
if (operation === 'save') {
|
||||
fireEvent.change(screen.getByRole('textbox', { name: copy.interviewPrepAnswerFor.replace('{title}', 'Funding history') }), { target: { value: 'Saved first answer' } });
|
||||
fireEvent.click(screen.getAllByRole('button', { name: copy.interviewPrepSaveAnswer })[0]);
|
||||
}
|
||||
await waitFor(() => expect(reads).toBe(2));
|
||||
expect(screen.getByRole('textbox', { name })).toBe(answer);
|
||||
expect(answer).toHaveValue('My unsaved sibling answer Øresund');
|
||||
const updatedGroup = { ...board.groups[1], items: [{ ...board.groups[1].items[0], content: 'Current server answer' }] };
|
||||
const updated = { ...board, groups: operation === 'delete' ? [updatedGroup] : [board.groups[0], updatedGroup] };
|
||||
await act(async () => refresh.resolve({ data: updated }));
|
||||
expect(screen.getByRole('textbox', { name })).toBe(answer);
|
||||
expect(answer).toHaveValue('My unsaved sibling answer Øresund');
|
||||
expect(mockedApi.patch).not.toHaveBeenCalledWith('/jobapplications/7/interview-prep/2', expect.anything());
|
||||
fireEvent.click(screen.getByRole('button', { name: copy.interviewPrepDiscard }));
|
||||
expect(answer).toHaveValue('Current server answer');
|
||||
});
|
||||
|
||||
test.each(['en', 'nb'] as const)('same-application %s refresh failure and GET-only retry preserve an unsaved answer', async language => {
|
||||
localStorage.setItem('uiLanguage', language);
|
||||
const copy = translations[language];
|
||||
mockedApi.get.mockReset(); routeGet();
|
||||
const read = mockedApi.get.getMockImplementation()!;
|
||||
let reads = 0;
|
||||
mockedApi.get.mockImplementation((url: string) => url.endsWith('/interview-prep') && ++reads === 2 ? Promise.reject(new Error('Refresh failed')) : read(url));
|
||||
mockedApi.patch.mockReset().mockResolvedValue({ data: board.groups[0].items[0] } as any);
|
||||
render(<ApplicationInterviewPrep jobId={7} />);
|
||||
const name = copy.interviewPrepAnswerFor.replace('{title}', 'Tell me about a conflict');
|
||||
const answer = await screen.findByRole('textbox', { name });
|
||||
fireEvent.change(answer, { target: { value: 'Keep across failed refresh' } });
|
||||
fireEvent.click(screen.getByRole('checkbox', { name: copy.interviewPrepReadyLabel.replace('{title}', 'Funding history') }));
|
||||
expect(await screen.findByText(copy.interviewPrepLoadFailed)).toBeVisible();
|
||||
expect(screen.getByRole('textbox', { name })).toBe(answer);
|
||||
expect(answer).toHaveValue('Keep across failed refresh');
|
||||
fireEvent.click(screen.getByRole('button', { name: copy.retry }));
|
||||
await waitFor(() => expect(screen.queryByText(copy.interviewPrepLoadFailed)).not.toBeInTheDocument());
|
||||
expect(reads).toBe(3); expect(mockedApi.patch).toHaveBeenCalledTimes(1);
|
||||
expect(screen.getByRole('textbox', { name })).toBe(answer);
|
||||
expect(answer).toHaveValue('Keep across failed refresh');
|
||||
});
|
||||
|
||||
test('marking readiness preserves that row answer draft because the write contains no answer', async () => {
|
||||
mockedApi.get.mockReset(); routeGet();
|
||||
mockedApi.patch.mockReset().mockResolvedValue({ data: board.groups[1].items[0] } as any);
|
||||
render(<ApplicationInterviewPrep jobId={7} />);
|
||||
const name = translations.en.interviewPrepAnswerFor.replace('{title}', 'Tell me about a conflict');
|
||||
fireEvent.change(await screen.findByRole('textbox', { name }), { target: { value: 'Not saved by readiness' } });
|
||||
fireEvent.click(screen.getByRole('checkbox', { name: 'Ready: Tell me about a conflict' }));
|
||||
await waitFor(() => expect(mockedApi.get.mock.calls.filter(([url]) => String(url).endsWith('/interview-prep'))).toHaveLength(2));
|
||||
expect(screen.getByRole('textbox', { name })).toHaveValue('Not saved by readiness');
|
||||
expect(mockedApi.patch.mock.calls).toEqual([['/jobapplications/7/interview-prep/2', { isPrepared: true }]]);
|
||||
});
|
||||
|
||||
test.each(['en', 'nb'] as const)('changing job clears %s answer drafts and a failed initial read offers only a GET retry', async language => {
|
||||
localStorage.setItem('uiLanguage', language);
|
||||
const copy = translations[language];
|
||||
mockedApi.get.mockReset(); routeGet();
|
||||
const read = mockedApi.get.getMockImplementation()!;
|
||||
const current = deferredRead(); let currentReads = 0;
|
||||
mockedApi.get.mockImplementation((url: string) => url === '/jobapplications/8/interview-prep' && ++currentReads === 1 ? current.promise : read(url));
|
||||
const name = copy.interviewPrepAnswerFor.replace('{title}', 'Tell me about a conflict');
|
||||
const view = render(<ApplicationInterviewPrep jobId={7} />);
|
||||
fireEvent.change(await screen.findByRole('textbox', { name }), { target: { value: 'Private application seven answer' } });
|
||||
await act(async () => view.rerender(<I18nProvider><ConfirmProvider><ApplicationInterviewPrep jobId={8} /></ConfirmProvider></I18nProvider>));
|
||||
expect(screen.queryByRole('textbox', { name })).not.toBeInTheDocument();
|
||||
await act(async () => current.reject(new Error('New application initial read failed')));
|
||||
expect(screen.getByText(copy.interviewPrepLoadFailed)).toBeVisible();
|
||||
expect(screen.queryByLabelText(copy.interviewPrepAddLabel)).not.toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole('button', { name: copy.retry }));
|
||||
expect(await screen.findByRole('textbox', { name })).toHaveValue('');
|
||||
expect(currentReads).toBe(2);
|
||||
expect(mockedApi.patch).not.toHaveBeenCalled(); expect(mockedApi.post).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test.each(['success', 'failure', 'pending-newer'] as const)('a newer preparation refresh wins against an older %s completion', async completion => {
|
||||
mockedApi.get.mockReset(); routeGet();
|
||||
const read = mockedApi.get.getMockImplementation()!;
|
||||
const older = deferredRead(); const newer = deferredRead();
|
||||
let reads = 0;
|
||||
mockedApi.get.mockImplementation((url: string) => url.endsWith('/interview-prep') && ++reads > 1 ? (reads === 2 ? older.promise : newer.promise) : read(url));
|
||||
const firstWrite = deferredRead(); const secondWrite = deferredRead();
|
||||
mockedApi.patch.mockReset().mockReturnValueOnce(firstWrite.promise).mockReturnValueOnce(secondWrite.promise);
|
||||
render(<ApplicationInterviewPrep jobId={7} />);
|
||||
fireEvent.click(await screen.findByRole('checkbox', { name: 'Ready: Funding history' }));
|
||||
fireEvent.click(screen.getByRole('checkbox', { name: 'Ready: Tell me about a conflict' }));
|
||||
await act(async () => firstWrite.resolve({ data: {} }));
|
||||
await act(async () => secondWrite.resolve({ data: {} }));
|
||||
expect(reads).toBe(3);
|
||||
if (completion === 'pending-newer') {
|
||||
await act(async () => older.resolve({ data: board }));
|
||||
const region = within(screen.getByRole('region', { name: translations.en.interviewPrepTitle }));
|
||||
expect(region.getByRole('progressbar', { name: translations.en.loading })).toBeVisible();
|
||||
expect(region.getByLabelText(translations.en.interviewPrepAddLabel)).toBeVisible();
|
||||
}
|
||||
const currentBoard = { ...board, groups: [{ ...board.groups[0], items: [{ ...board.groups[0].items[0], title: 'Newest board' }] }] };
|
||||
await act(async () => newer.resolve({ data: currentBoard }));
|
||||
expect(await screen.findByText('Newest board')).toBeVisible();
|
||||
fireEvent.change(screen.getByLabelText(translations.en.interviewPrepAddLabel), { target: { value: 'Current draft' } });
|
||||
if (completion === 'success') await act(async () => older.resolve({ data: board }));
|
||||
if (completion === 'failure') await act(async () => older.reject(new Error('Older refresh failure')));
|
||||
expect(screen.getByText('Newest board')).toBeVisible();
|
||||
expect(screen.queryByText(translations.en.interviewPrepLoadFailed)).not.toBeInTheDocument();
|
||||
expect(screen.getByLabelText(translations.en.interviewPrepAddLabel)).toHaveValue('Current draft');
|
||||
});
|
||||
|
||||
test.each(['prep', 'follow-up'] as const)('late %s write keeps its original target and cannot clear a new application draft', async surface => {
|
||||
mockedApi.get.mockReset(); routeGet();
|
||||
const write = deferredRead();
|
||||
mockedApi.post.mockReset().mockReturnValueOnce(write.promise);
|
||||
mockedApi.put.mockReset().mockReturnValueOnce(write.promise);
|
||||
const component = (id: number) => surface === 'prep' ? <ApplicationInterviewPrep jobId={id} /> : <ApplicationFollowUp jobId={id} />;
|
||||
const label = surface === 'prep' ? translations.en.interviewPrepAddLabel : translations.en.workspaceNextAction;
|
||||
const view = render(component(7));
|
||||
fireEvent.change(await screen.findByLabelText(label), { target: { value: 'Original application write' } });
|
||||
fireEvent.click(screen.getByRole('button', { name: translations.en[surface === 'prep' ? 'interviewPrepAdd' : 'save'] }));
|
||||
await act(async () => view.rerender(<I18nProvider><ConfirmProvider>{component(8)}</ConfirmProvider></I18nProvider>));
|
||||
fireEvent.change(await screen.findByLabelText(label), { target: { value: 'New application draft' } });
|
||||
await act(async () => write.resolve({ data: surface === 'prep' ? board.groups[0].items[0] : followUp }));
|
||||
expect(screen.getByLabelText(label)).toHaveValue('New application draft');
|
||||
expect(surface === 'prep' ? mockedApi.post : mockedApi.put).toHaveBeenCalledTimes(1);
|
||||
expect((surface === 'prep' ? mockedApi.post : mockedApi.put).mock.calls[0][0]).toBe(`/jobapplications/7/${surface === 'prep' ? 'interview-prep' : 'follow-up'}`);
|
||||
expect(mockedApi.get.mock.calls.filter(([url]) => url === '/jobapplications/7/interview-prep')).toHaveLength(surface === 'prep' ? 1 : 0);
|
||||
});
|
||||
|
||||
test.each(['prep', 'follow-up'] as const)('late %s read cannot replace the current application or its draft', async surface => {
|
||||
mockedApi.get.mockReset(); routeGet();
|
||||
const read = mockedApi.get.getMockImplementation()!;
|
||||
const old = deferredRead();
|
||||
const suffix = surface === 'prep' ? 'interview-prep' : 'follow-up';
|
||||
mockedApi.get.mockImplementation((url: string) => url === `/jobapplications/7/${suffix}` ? old.promise : read(url));
|
||||
const component = (id: number) => surface === 'prep' ? <ApplicationInterviewPrep jobId={id} /> : <ApplicationFollowUp jobId={id} />;
|
||||
const view = render(component(7));
|
||||
await act(async () => view.rerender(<I18nProvider><ConfirmProvider>{component(8)}</ConfirmProvider></I18nProvider>));
|
||||
const label = surface === 'prep' ? translations.en.interviewPrepAddLabel : translations.en.workspaceNextAction;
|
||||
fireEvent.change(await screen.findByLabelText(label), { target: { value: 'Current application draft' } });
|
||||
const oldData = surface === 'prep'
|
||||
? { ...board, groups: [{ ...board.groups[0], items: [{ ...board.groups[0].items[0], title: 'Previous application only' }] }] }
|
||||
: { ...followUp, nextAction: 'Previous application only' };
|
||||
await act(async () => old.resolve({ data: oldData }));
|
||||
expect(screen.getByLabelText(label)).toHaveValue('Current application draft');
|
||||
expect(screen.queryByText('Previous application only')).not.toBeInTheDocument();
|
||||
expect(screen.queryByDisplayValue('Previous application only')).not.toBeInTheDocument();
|
||||
expect(mockedApi.post).not.toHaveBeenCalled(); expect(mockedApi.put).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test.each(['prep', 'follow-up'] as const)('late %s read failure cannot hide the current draft', async surface => {
|
||||
mockedApi.get.mockReset(); routeGet();
|
||||
const read = mockedApi.get.getMockImplementation()!;
|
||||
const old = deferredRead();
|
||||
const suffix = surface === 'prep' ? 'interview-prep' : 'follow-up';
|
||||
mockedApi.get.mockImplementation((url: string) => url === `/jobapplications/7/${suffix}` ? old.promise : read(url));
|
||||
const component = (id: number) => surface === 'prep' ? <ApplicationInterviewPrep jobId={id} /> : <ApplicationFollowUp jobId={id} />;
|
||||
const view = render(component(7));
|
||||
await act(async () => view.rerender(<I18nProvider><ConfirmProvider>{component(8)}</ConfirmProvider></I18nProvider>));
|
||||
const label = surface === 'prep' ? translations.en.interviewPrepAddLabel : translations.en.workspaceNextAction;
|
||||
fireEvent.change(await screen.findByLabelText(label), { target: { value: 'Current application draft' } });
|
||||
await act(async () => old.reject(new Error('Previous application failure')));
|
||||
expect(screen.queryByText(translations.en[surface === 'prep' ? 'interviewPrepLoadFailed' : 'interviewFollowUpLoadFailed'])).not.toBeInTheDocument();
|
||||
expect(screen.getByLabelText(label)).toHaveValue('Current application draft');
|
||||
});
|
||||
|
||||
test.each(['prep', 'follow-up'] as const)('late %s finally cannot dismiss the current application loading state', async surface => {
|
||||
mockedApi.get.mockReset(); routeGet();
|
||||
const read = mockedApi.get.getMockImplementation()!;
|
||||
const old = deferredRead(); const current = deferredRead();
|
||||
const suffix = surface === 'prep' ? 'interview-prep' : 'follow-up';
|
||||
mockedApi.get.mockImplementation((url: string) => url.endsWith(`/${suffix}`) ? (url.includes('/7/') ? old.promise : current.promise) : read(url));
|
||||
const component = (id: number) => surface === 'prep' ? <ApplicationInterviewPrep jobId={id} /> : <ApplicationFollowUp jobId={id} />;
|
||||
const view = render(component(7));
|
||||
await act(async () => view.rerender(<I18nProvider><ConfirmProvider>{component(8)}</ConfirmProvider></I18nProvider>));
|
||||
await act(async () => old.resolve({ data: surface === 'prep' ? board : followUp }));
|
||||
const region = within(screen.getByRole('region', { name: translations.en[surface === 'prep' ? 'interviewPrepTitle' : 'interviewFollowUpTitle'] }));
|
||||
expect(region.getByRole('progressbar', { name: translations.en.loading })).toBeVisible();
|
||||
expect(region.queryByLabelText(translations.en[surface === 'prep' ? 'interviewPrepAddLabel' : 'workspaceNextAction'])).not.toBeInTheDocument();
|
||||
await act(async () => current.resolve({ data: surface === 'prep' ? board : followUp }));
|
||||
expect(await region.findByLabelText(translations.en[surface === 'prep' ? 'interviewPrepAddLabel' : 'workspaceNextAction'])).toBeVisible();
|
||||
});
|
||||
|
||||
test('changing application resets parent drafts and a failed follow-up read retains a GET-only retry', async () => {
|
||||
mockedApi.get.mockReset(); routeGet();
|
||||
const read = mockedApi.get.getMockImplementation()!;
|
||||
mockedApi.get.mockImplementation((url: string) => url === '/jobapplications/8/follow-up' ? Promise.reject(new Error('Current read failure')) : read(url));
|
||||
const view = render(<ApplicationInterviewPrep jobId={7} />);
|
||||
fireEvent.change(await screen.findByLabelText(translations.en.interviewPrepAddLabel), { target: { value: 'Application seven draft' } });
|
||||
await screen.findByDisplayValue(followUp.nextAction);
|
||||
await act(async () => view.rerender(<I18nProvider><ConfirmProvider><ApplicationInterviewPrep jobId={8} /></ConfirmProvider></I18nProvider>));
|
||||
expect(await screen.findByLabelText(translations.en.interviewPrepAddLabel)).toHaveValue('');
|
||||
expect(await screen.findByText(translations.en.interviewFollowUpLoadFailed)).toBeVisible();
|
||||
const region = within(screen.getByRole('region', { name: translations.en.interviewFollowUpTitle }));
|
||||
expect(region.queryByLabelText(translations.en.workspaceNextAction)).not.toBeInTheDocument();
|
||||
mockedApi.get.mockImplementation(read);
|
||||
fireEvent.click(region.getByRole('button', { name: translations.en.retry }));
|
||||
expect(await region.findByLabelText(translations.en.workspaceNextAction)).toHaveValue(followUp.nextAction);
|
||||
expect(mockedApi.put).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test.each(['en', 'nb'] as const)('pending preparation deletion follows %s without a preparation reload or answer loss', async from => {
|
||||
localStorage.setItem('uiLanguage', from);
|
||||
const to = from === 'en' ? 'nb' : 'en';
|
||||
@@ -352,7 +578,7 @@ test('late generation cannot offer another application the previous application
|
||||
fireEvent.change(screen.getByLabelText(translations.en.coverAiAdditionalInstructions), { target: { value: 'Private instructions for application seven' } });
|
||||
fireEvent.click(screen.getByRole('button', { name: translations.en.interviewAiGenerate }));
|
||||
await waitFor(() => expect(mockedApi.post).toHaveBeenCalledTimes(1));
|
||||
view.rerender(<I18nProvider><ConfirmProvider><ApplicationInterviewPrep jobId={8} /></ConfirmProvider></I18nProvider>);
|
||||
await act(async () => view.rerender(<I18nProvider><ConfirmProvider><ApplicationInterviewPrep jobId={8} /></ConfirmProvider></I18nProvider>));
|
||||
await act(async () => finish({ data: { result: { text: 'Only for application seven' } } }));
|
||||
const assistant = within(screen.getByRole('region', { name: translations.en.interviewAiTitle }));
|
||||
expect(assistant.queryByText('Only for application seven')).not.toBeInTheDocument();
|
||||
@@ -368,7 +594,7 @@ test('completed AI suggestion is scoped to its application instead of becoming a
|
||||
await screen.findByText('Backend CV');
|
||||
fireEvent.click(screen.getByRole('button', { name: translations.en.interviewAiGenerate }));
|
||||
expect(await screen.findByText('Prepared for application seven only')).toBeVisible();
|
||||
view.rerender(<I18nProvider><ConfirmProvider><ApplicationInterviewPrep jobId={8} /></ConfirmProvider></I18nProvider>);
|
||||
await act(async () => view.rerender(<I18nProvider><ConfirmProvider><ApplicationInterviewPrep jobId={8} /></ConfirmProvider></I18nProvider>));
|
||||
const assistant = within(screen.getByRole('region', { name: translations.en.interviewAiTitle }));
|
||||
expect(assistant.queryByText('Prepared for application seven only')).not.toBeInTheDocument();
|
||||
expect(assistant.queryByRole('button', { name: translations.en.interviewAiAddToPrep })).not.toBeInTheDocument();
|
||||
@@ -385,7 +611,7 @@ test('late accepted suggestion does not reload the previous application board in
|
||||
await screen.findByText('Application seven suggestion');
|
||||
fireEvent.click(screen.getByRole('button', { name: translations.en.interviewAiAddToPrep }));
|
||||
await waitFor(() => expect(mockedApi.post).toHaveBeenCalledTimes(2));
|
||||
view.rerender(<I18nProvider><ConfirmProvider><ApplicationInterviewPrep jobId={8} /></ConfirmProvider></I18nProvider>);
|
||||
await act(async () => view.rerender(<I18nProvider><ConfirmProvider><ApplicationInterviewPrep jobId={8} /></ConfirmProvider></I18nProvider>));
|
||||
await waitFor(() => expect(mockedApi.get).toHaveBeenCalledWith('/jobapplications/8/interview-prep'));
|
||||
await act(async () => finish({ data: board.groups[0].items[0] }));
|
||||
expect(mockedApi.get.mock.calls.filter(([url]) => url === '/jobapplications/7/interview-prep')).toHaveLength(1);
|
||||
@@ -444,7 +670,7 @@ test.each(['en', 'nb'] as const)('changing application hides the previous linked
|
||||
mockedApi.get.mockImplementation((url: string) => url === '/jobapplications/8/cv' ? pending as any : read(url));
|
||||
const view = render(<ApplicationInterviewPrep jobId={7} />);
|
||||
await screen.findByText('Backend CV');
|
||||
view.rerender(<I18nProvider><ConfirmProvider><ApplicationInterviewPrep jobId={8} /></ConfirmProvider></I18nProvider>);
|
||||
await act(async () => view.rerender(<I18nProvider><ConfirmProvider><ApplicationInterviewPrep jobId={8} /></ConfirmProvider></I18nProvider>));
|
||||
const assistant = within(screen.getByRole('region', { name: translations[language].interviewAiTitle }));
|
||||
expect(assistant.queryByText('Backend CV')).not.toBeInTheDocument();
|
||||
expect(assistant.getByRole('progressbar', { name: translations[language].loading })).toBeVisible();
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
Menu, MenuItem, Paper, Skeleton, Stack, Tab, Tabs, TextField, Tooltip, Typography,
|
||||
} from "@mui/material";
|
||||
import useMediaQuery from "@mui/material/useMediaQuery";
|
||||
import { visuallyHidden } from "@mui/utils";
|
||||
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
|
||||
import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward";
|
||||
import ArrowDownwardIcon from "@mui/icons-material/ArrowDownward";
|
||||
@@ -666,9 +667,10 @@ export default function CvBuilderEditor() {
|
||||
<Box data-cv-studio-layout sx={{ display: "grid", gridTemplateColumns: "minmax(0, 1fr)", "@media (min-width:1001px)": { gridTemplateColumns: "minmax(360px, 1fr) minmax(0, 1fr)" }, gap: 1.5, alignItems: "start" }}>
|
||||
<Box ref={editorRef} tabIndex={-1} role="region" aria-label={t("cvEditorEditingRegion")} onFocusCapture={() => setMobilePane("edit")} sx={{ display: compactEditor && mobilePane !== "edit" ? "none" : "block", top: "var(--cv-pane-top)", minWidth: 0, "@media (min-width:1001px)": { position: "sticky", maxHeight: "calc(100dvh - var(--cv-pane-top) - 12px)", overflowY: "auto" }, scrollbarWidth: "thin" }}>
|
||||
<Stack direction="row" justifyContent="space-between" alignItems="center" gap={1} sx={{ py: 0.5, borderBottom: "1px solid", borderColor: "divider" }}>
|
||||
{compactStudioNavigation ? <TextField select size="small" variant="standard" label={t("cvEditorStudioNavigation")} value={tab} sx={{ flex: 1, minWidth: 0 }} onChange={(event) => { const value = Number(event.target.value); setTab(value); if (value === 4) loadVersions(); }}>
|
||||
<Typography component="h2" variant="subtitle2" sx={compactStudioNavigation ? visuallyHidden : undefined}>{t("cvEditorEditingRegion")}</Typography>
|
||||
{compactStudioNavigation && <TextField select size="small" variant="standard" label={t("cvEditorStudioNavigation")} value={tab} sx={{ flex: 1, minWidth: 0 }} onChange={(event) => { const value = Number(event.target.value); setTab(value); if (value === 4) loadVersions(); }}>
|
||||
{[1, 0, 2, 3, 4].map((value) => <MenuItem key={value} value={value}>{t((["cvEditorTemplate", "cvEditorContent", "cvEditorCustomize", "cvEditorAiTools", "cvEditorHistory"] as const)[value])}</MenuItem>)}
|
||||
</TextField> : <Typography component="h2" variant="subtitle2">{t("cvEditorEditingRegion")}</Typography>}
|
||||
</TextField>}
|
||||
<Stack direction="row">
|
||||
<Tooltip describeChild title={t("cvEditorUndo")}><span><IconButton size="small" aria-label={t("cvEditorUndo")} disabled={!canUndo} onClick={undo}><UndoIcon fontSize="small" /></IconButton></span></Tooltip>
|
||||
<Tooltip describeChild title={t("cvEditorRedo")}><span><IconButton size="small" aria-label={t("cvEditorRedo")} disabled={!canRedo} onClick={redo}><RedoIcon fontSize="small" /></IconButton></span></Tooltip>
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from 'node:fs';
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import test from 'node:test';
|
||||
|
||||
const root = mkdtempSync(path.join(os.tmpdir(), 'jobjakt glob callers '));
|
||||
const jest = path.resolve(import.meta.dirname, '../node_modules/jest/bin/jest.js');
|
||||
const write = (file, content) => {
|
||||
const target = path.join(root, file);
|
||||
mkdirSync(path.dirname(target), { recursive: true });
|
||||
writeFileSync(target, content);
|
||||
};
|
||||
const run = (config, ...args) => {
|
||||
const configFile = path.join(root, 'jest.config.cjs');
|
||||
writeFileSync(configFile, `module.exports = ${JSON.stringify({ rootDir: root, testEnvironment: 'node', transform: {}, ...config })};\n`);
|
||||
return spawnSync(process.execPath, [jest, '--runInBand', '--config', configFile, ...args], { cwd: root, encoding: 'utf8', timeout: 30000 });
|
||||
};
|
||||
|
||||
test.after(() => rmSync(root, { recursive: true, force: true }));
|
||||
|
||||
test('Jest expands project globs and discovers both configured suites', () => {
|
||||
for (const name of ['one', 'two']) {
|
||||
write(`projects/${name}/package.json`, JSON.stringify({ jest: { rootDir: path.join(root, 'projects', name), testEnvironment: 'node', transform: {}, testMatch: ['**/*.test.cjs'] } }));
|
||||
write(`projects/${name}/example.test.cjs`, "test('ordinary assertion',()=>expect(1+1).toBe(2));\n");
|
||||
}
|
||||
const config = { projects: [path.join(root, 'projects/*')] };
|
||||
const discovery = run(config, '--listTests', '--json');
|
||||
assert.equal(discovery.status, 0, discovery.stderr);
|
||||
const names = JSON.parse(discovery.stdout).map(file => path.relative(root, file).replaceAll('\\', '/')).sort();
|
||||
assert.deepEqual(names, ['projects/one/example.test.cjs', 'projects/two/example.test.cjs']);
|
||||
const execution = run(config, '--json');
|
||||
assert.equal(execution.status, 0, execution.stderr);
|
||||
assert.equal(JSON.parse(execution.stdout).numPassedTests, 2);
|
||||
});
|
||||
|
||||
test('Jest enforces coverage thresholds selected by a glob', () => {
|
||||
write('coverage-source/calculator.js', 'module.exports = value => value + 1;\n');
|
||||
write('coverage-test/example.test.cjs', "test('calculator',()=>expect(require('../coverage-source/calculator.js')(1)).toBe(2));\n");
|
||||
const config = { testMatch: ['**/coverage-test/*.test.cjs'], collectCoverage: true, coverageProvider: 'v8', coverageReporters: ['json-summary'], collectCoverageFrom: ['coverage-source/*.js'] };
|
||||
const positive = run({ ...config, coverageThreshold: { './coverage-source/*.js': { lines: 100 } } });
|
||||
assert.equal(positive.status, 0, positive.stderr);
|
||||
const negative = run({ ...config, coverageThreshold: { './coverage-source/*.js': { lines: 101 } } });
|
||||
assert.equal(negative.status, 1, negative.stderr);
|
||||
assert.match(negative.stderr, /Coverage for lines \(100%\) does not meet .* threshold \(101%\)/);
|
||||
});
|
||||
|
||||
test('Jest missing-import diagnostics retain sibling extension suggestions', () => {
|
||||
write('missing-import/module.custom', 'synthetic fixture\n');
|
||||
write('missing-import/example.test.cjs', "test('missing extension',()=>require('./module'));\n");
|
||||
const result = run({ testMatch: ['**/missing-import/*.test.cjs'] });
|
||||
assert.equal(result.status, 1, result.stderr);
|
||||
assert.match(result.stderr, /module\.custom/);
|
||||
assert.match(result.stderr, /You might want to include a file extension/);
|
||||
});
|
||||
Reference in New Issue
Block a user