test: tighten storage doctor assertions

This commit is contained in:
Peter Steinberger
2026-05-08 15:05:29 +01:00
parent 9491176811
commit eecef7e10c
2 changed files with 4 additions and 2 deletions

View File

@@ -174,7 +174,8 @@ describe("doctor command", () => {
throw new Error("Expected doctor to write migrated auth profiles");
}
const profiles = (written.auth as { profiles: Record<string, unknown> }).profiles;
expect(profiles["anthropic:me@example.com"]).toEqual(expect.any(Object));
expect(profiles).toHaveProperty("anthropic:me@example.com");
expect(profiles["anthropic:me@example.com"]).not.toBeNull();
expect(profiles["anthropic:default"]).toBeUndefined();
}, 30_000);
});

View File

@@ -571,7 +571,8 @@ describe("loadSettings default gateway URL derivation", () => {
const persisted = JSON.parse(localStorage.getItem(scopedKey) ?? "{}");
expect(persisted.sessionsByGateway).toEqual(expect.any(Object));
expect(persisted.sessionsByGateway).toBeTypeOf("object");
expect(persisted.sessionsByGateway).not.toBeNull();
const scopes = Object.keys(persisted.sessionsByGateway);
expect(scopes).toHaveLength(10);
// oldest stale entries should be evicted