aboutsummaryrefslogtreecommitdiff
path: root/test/profile/list-test.ts
diff options
context:
space:
mode:
authoramankumarsingh77 <amankumarsingh7702@gmail.com>2026-07-28 20:32:57 +0530
committerAman Kumar <145339995+amankumarsingh77@users.noreply.github.com>2026-08-02 19:12:46 +0530
commit34e5cfdcbe29bbb5f2f46ba54eb67903abd9274d (patch)
treef7b421652a7664d97362a308f4a1288cce2ef5b0 /test/profile/list-test.ts
parent91a2fdeff796bae8e87d9146e2d540550f54dd74 (diff)
refactor(test): strip comment noise
Removes suite banners, section dividers, and test-id markers that restate the test names. Keeps one-line notes for the deleted-binary fixture order, the never-arriving event consumer, the absent-vs-undefined key distinction, the unexpected-method-echo rationale, and the real-browser teardown and Local State flush quirks. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'test/profile/list-test.ts')
-rw-r--r--test/profile/list-test.ts18
1 files changed, 1 insertions, 17 deletions
diff --git a/test/profile/list-test.ts b/test/profile/list-test.ts
index b4397e3..f1db39c 100644
--- a/test/profile/list-test.ts
+++ b/test/profile/list-test.ts
@@ -1,11 +1,3 @@
-/**
- * Unit tests for profile enumeration — no browser required.
- *
- * Builds throwaway user-data-dirs on disk so both tiers (Local State and the
- * Preferences scan) run against real files.
- *
- * Run: npm test
- */
import { test, after, describe } from "node:test";
import assert from "node:assert/strict";
import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from "node:fs";
@@ -31,7 +23,6 @@ describe("profile enumeration", () => {
for (const root of roots) rmSync(root, { recursive: true, force: true });
});
- // L1: tier 1 — names, emails, ordering, last-used marker
const makeL1Udd = (): string => {
const udd = makeUdd();
writeLocalState(udd, {
@@ -73,7 +64,6 @@ describe("profile enumeration", () => {
assert.equal(profiles[0]?.lastUsed, false);
});
- // L2: profile with no signed-in account falls back to the directory
const makeL2Udd = (): string => {
const udd = makeUdd();
writeLocalState(udd, { profile: { info_cache: { "Profile 3": { name: "Work" } } } });
@@ -90,7 +80,6 @@ describe("profile enumeration", () => {
assert.equal(profiles[0]?.email, undefined);
});
- // L3: gaia_name backfills a missing name; ephemeral profiles are skipped
const makeL3Udd = (): string => {
const udd = makeUdd();
writeLocalState(udd, {
@@ -115,7 +104,6 @@ describe("profile enumeration", () => {
assert.equal(profiles[0]?.label, "Aman Kumar (gaia@example.com)");
});
- // L4: unlisted profiles are appended alphabetically after profiles_order
test("L4: ordered entries first, remainder alphabetical", async () => {
const udd = makeUdd();
writeLocalState(udd, {
@@ -132,7 +120,6 @@ describe("profile enumeration", () => {
assert.equal(profiles.map((p) => p.dir).join(","), "Profile 9,Default,Profile 3");
});
- // L5: corrupt Local State falls through to the Preferences scan
const makeL5Udd = (): string => {
const udd = makeUdd();
writeLocalState(udd, "{ this is not json");
@@ -140,7 +127,7 @@ describe("profile enumeration", () => {
profile: { name: "Fallback Name" },
account_info: [{ email: "fallback@example.com" }],
});
- writeProfileDir(udd, "Crash Reports"); // no Preferences → not a profile
+ writeProfileDir(udd, "Crash Reports");
return udd;
};
@@ -154,7 +141,6 @@ describe("profile enumeration", () => {
assert.equal(profiles[0]?.label, "Fallback Name (fallback@example.com)");
});
- // L6: missing info_cache also falls through to tier 2
test("L6: missing info_cache → Preferences scan", async () => {
const udd = makeUdd();
writeLocalState(udd, { profile: { last_used: "Default" } });
@@ -163,13 +149,11 @@ describe("profile enumeration", () => {
assert.equal(profiles[0]?.label, "Tier Two (Profile 1)");
});
- // L7: nothing readable → empty list, never a throw
test("L7: unreadable user-data-dir yields an empty list", async () => {
const profiles = await listProfiles(join(tmpdir(), "pi-profile-does-not-exist-xyz"));
assert.equal(profiles.length, 0);
});
- // L8: label formatting is total
test("L8: email wins the brackets", () => {
assert.equal(formatProfileLabel("A", "a@b.c", "Default"), "A (a@b.c)");
});