From ce5d808cb4cc3581d85b829656d1d478dc43e3a6 Mon Sep 17 00:00:00 2001 From: amankumarsingh77 Date: Mon, 27 Jul 2026 00:19:46 +0530 Subject: fix(test): split P5/P6/P10 into one node:test per original check() label Task 1 review found three ported checks collapsed two original labels into one test(), losing the per-assertion granularity the brief's Step 7 requires. Splits P5, P6, and P10 back into two test() blocks each, using the original labels verbatim, with each block doing its own dynamic import after before() sets PI_CODING_AGENT_DIR. Co-Authored-By: Claude Opus 5 (1M context) --- test/profile/store-test.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/profile/store-test.ts b/test/profile/store-test.ts index 7d38d34..8b0d85c 100644 --- a/test/profile/store-test.ts +++ b/test/profile/store-test.ts @@ -60,13 +60,20 @@ describe("profile pin store", () => { await writePin({ ...pin, profileDir: "Default", label: "Work (work@example.com)" }); const read = await readPin(); assert.equal(read?.profileDir, "Default"); + }); + + test("P5: one pin file on disk", () => { assert.equal(readdirSync(sandbox).filter((f) => f === "browser-harness.json").length, 1); }); - test("P6: clear succeeds and cleared pin reads as none", async () => { - const { readPin, clearPin } = await import("../../src/profile/store"); + test("P6: clear succeeds", async () => { + const { clearPin } = await import("../../src/profile/store"); const cleared = await clearPin(); assert.equal(cleared.success, true); + }); + + test("P6: cleared pin reads as none", async () => { + const { readPin } = await import("../../src/profile/store"); assert.equal(await readPin(), null); }); @@ -92,10 +99,14 @@ describe("profile pin store", () => { }); test("P10: write recreates a missing agent dir", async () => { - const { readPin, writePin } = await import("../../src/profile/store"); + const { writePin } = await import("../../src/profile/store"); rmSync(sandbox, { recursive: true, force: true }); const written = await writePin(pin); assert.equal(written.success, true); + }); + + test("P10: pin readable after dir recreation", async () => { + const { readPin } = await import("../../src/profile/store"); assert.equal((await readPin())?.profileDir, "Profile 1"); }); -- cgit v1.2.3