From 6214dd7585563ae1ac480dd49ee24b88d5298bab Mon Sep 17 00:00:00 2001 From: daocuong11 Date: Sat, 28 Nov 2026 07:28:39 +0700 Subject: [PATCH 1/2] fix(core): stop the profile test failing on a chance hex match (#146) Signed-off-by: daocuong11 --- packages/core/test/profile.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/test/profile.test.ts b/packages/core/test/profile.test.ts index 302de98..d7bc770 100644 --- a/packages/core/test/profile.test.ts +++ b/packages/core/test/profile.test.ts @@ -76,7 +76,9 @@ describe("profile values (US-FORM-03)", () => { test("a sealed value opens only with its key and for its own kind", async () => { const key = webcrypto.getRandomValues(new Uint8Array(32)); const sealed = await sealProfileValue(cipher, key, "id_number", "1-2345-6789"); - expect(sealed).not.toContain("2345"); + // The sealed value is hex: check the decoded bytes, not the hex text. + const sealedBytes = Buffer.from(sealed, "hex"); + expect(sealedBytes.includes(Buffer.from("1-2345-6789", "utf8"))).toBe(false); expect(await openProfileValue(cipher, key, "id_number", sealed)).toBe("1-2345-6789"); await expect(openProfileValue(cipher, key, "passport_number", sealed)).rejects.toThrow(); await expect(openProfileValue(cipher, new Uint8Array(32), "id_number", sealed)).rejects.toThrow(); From c4f0f2f7cb5c2f0d0591250398347edb72410fcb Mon Sep 17 00:00:00 2001 From: MugunthPerumal Date: Sat, 28 Nov 2026 22:41:06 +0530 Subject: [PATCH 2/2] test(mobile): scan nested route folders in a11y-scan --- apps/mobile/src/a11y-scan.test.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/mobile/src/a11y-scan.test.ts b/apps/mobile/src/a11y-scan.test.ts index 941d661..fe76127 100644 --- a/apps/mobile/src/a11y-scan.test.ts +++ b/apps/mobile/src/a11y-scan.test.ts @@ -5,11 +5,25 @@ import { test } from "node:test"; import assert from "node:assert/strict"; import { readdirSync, readFileSync } from "node:fs"; import { join } from "node:path"; +import { fileURLToPath } from "node:url"; import { contrast, stripComments, unlabelledControls } from "./a11y-scan.ts"; import { palettes } from "./theme.ts"; -const SRC = new URL(".", import.meta.url).pathname; -const files = ["app", "components"].flatMap((dir) => readdirSync(join(SRC, dir)).filter((f) => f.endsWith(".tsx")).map((f) => join(dir, f))).concat(["app-lock.tsx"]); +const SRC = fileURLToPath(new URL(".", import.meta.url)); +const files = [ + ...["app", "components"].flatMap((dir) => + readdirSync(join(SRC, dir), { recursive: true }) + .map(String) + .filter((f) => f.endsWith(".tsx")) + .map((f) => join(dir, f)) + ), + ...readdirSync(SRC).filter((f) => f.endsWith(".tsx")), +]; + +test("the scanner walks nested route folders and top-level screens", () => { + assert.ok(files.includes(join("app", "oauth", "mcp.tsx"))); + assert.ok(files.includes("app-lock.tsx")); +}); test("the scanner flags a Pressable without a role or a label", () => { const src = ` go("/x")} style={s}>\n{t("a.b")}`;