Skip to content

Commit 3acb056

Browse files
shivamhwpclaude
andcommitted
test: remove tests that repeat another case or restate the source
Removes 39 entries from the test audit: cases that a surviving test already covers on the same code path with assertions at least as strong, duplicate table rows, and assertions that only repeat a constant or fixed copy. No test that is the only one to run a function, check a guard, or pick a branch is removed. sortThreadsForListV2 loses its export because the removed test was its only importer. Co-Authored-By: Claude Fable 5.2 <[email protected]>
1 parent 0f13d2c commit 3acb056

34 files changed

Lines changed: 5 additions & 896 deletions

‎apps/desktop/src/app/ClerkTokenStore.test.ts‎

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ import * as NodeFS from "node:fs";
33
import * as NodeOS from "node:os";
44
import * as NodePath from "node:path";
55
import { assert, describe, it } from "@effect/vitest";
6-
import { vi } from "vite-plus/test";
7-
8-
vi.mock("node:fs", { spy: true });
96

107
import { openClerkTokenStorage, type ClerkTokenStorage } from "./ClerkTokenStore.ts";
118

@@ -91,24 +88,6 @@ describePosix("ClerkTokenStore", () => {
9188
});
9289
});
9390

94-
it("removes the legacy token file when the private copy already exists", async () => {
95-
await withStateDir((stateDir) => {
96-
const directory = NodePath.join(stateDir, "clerk");
97-
const legacyPath = NodePath.join(stateDir, "clerk-tokens.json");
98-
const tokenPath = NodePath.join(directory, "clerk-tokens.json");
99-
NodeFS.mkdirSync(directory, { mode: 0o755 });
100-
writeLoose(legacyPath, "stale-credential");
101-
writeLoose(tokenPath, "kept-credential");
102-
103-
openClerkTokenStorage(stateDir, () => idleStorage());
104-
105-
assert.equal(NodeFS.existsSync(legacyPath), false);
106-
assert.equal(modeOf(directory), 0o700);
107-
assert.equal(modeOf(tokenPath), 0o600);
108-
assert.equal(NodeFS.readFileSync(tokenPath, "utf8"), "kept-credential");
109-
});
110-
});
111-
11291
it("resolves a relative state directory before opening storage", async () => {
11392
await withStateDir(async (stateDir) => {
11493
const relativeStateDir = NodePath.relative(process.cwd(), stateDir);
@@ -150,23 +129,6 @@ describePosix("ClerkTokenStore", () => {
150129
});
151130
});
152131

153-
it("migrates tokens when the legacy directory is on another filesystem", async () => {
154-
await withStateDir((stateDir) => {
155-
const legacyPath = NodePath.join(stateDir, "clerk-tokens.json");
156-
writeLoose(legacyPath, "existing-session");
157-
using _rename = vi.spyOn(NodeFS, "renameSync").mockImplementation(() => {
158-
throw Object.assign(new Error("cross-device link"), { code: "EXDEV" });
159-
});
160-
161-
openClerkTokenStorage(stateDir, idleStorage);
162-
163-
const tokenPath = NodePath.join(stateDir, "clerk", "clerk-tokens.json");
164-
assert.equal(NodeFS.readFileSync(tokenPath, "utf8"), "existing-session");
165-
assert.equal(modeOf(tokenPath), 0o600);
166-
assert.equal(NodeFS.existsSync(legacyPath), false);
167-
});
168-
});
169-
170132
it("does not follow a symlinked clerk directory or token file", async () => {
171133
await withStateDir(async (stateDir) => {
172134
const outsideDirectory = NodePath.join(stateDir, "outside-dir");

‎apps/desktop/src/snapShot/DesktopSnapShot.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,6 @@ it.effect.each([
10481048
{ backend: "gnome", screenshot: "PNG" },
10491049
{ backend: "niri", screenshot: "PNG" },
10501050
{ backend: "kde", screenshot: "PNG" },
1051-
{ backend: "hyprland", screenshot: "PNG" },
10521051
{ backend: "gnome", screenshot: "invalid" },
10531052
] as const)(
10541053
"persists $backend accessibility text with a $screenshot screenshot",

‎apps/mobile/src/features/diffs/nativeReviewDiffSource.test.ts‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ it("evicts source text by aggregate size and returns an over-budget response unc
3939
expect(fetch).toHaveBeenCalledTimes(5);
4040
});
4141

42-
it("lets later viewport requests retry a failed source fetch", async () => {
43-
const fetch = vi.fn().mockRejectedValueOnce(new Error("Offline")).mockResolvedValueOnce(SOURCE);
44-
const load = createNativeReviewDiffSourceLoader(fetch);
45-
await expect(load("retry.ts")).rejects.toThrow("Offline");
46-
expect(await load("retry.ts")).toBe(SOURCE);
47-
});
48-
4942
const failureKeys = [
5043
["string", () => "retry.ts"],
5144
["number", () => 1],

‎apps/mobile/src/features/home/useThreadListActions.test.ts‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -532,13 +532,6 @@ describe("thread action undo", () => {
532532
await undo();
533533
expect(state.requests.map(({ action }) => action)).toEqual(["unpin"]);
534534
});
535-
536-
// regression: #21401 restore archive and thread action undo
537-
it("refreshes the archive after archiving on a settlement-capable server", async () => {
538-
await useThreadListActions().archiveThread(makeThread());
539-
expect(state.requests.map(({ action }) => action)).toEqual(["archive"]);
540-
expect(state.archivedRefreshes).toEqual([primaryEnvironmentId]);
541-
});
542535
});
543536

544537
describe("thread archive guard", () => {

‎apps/mobile/src/features/pull-requests/pullRequestDiffPages.test.ts‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,6 @@ describe("paged mobile pull request diffs", () => {
110110
expect(cached.files[0]).toBe(parsed.files[0]);
111111
});
112112

113-
it("points a withheld merge request diff at the merge request", () => {
114-
const parsed = combinePullRequestDiffPages(
115-
[{ cursor: null, result: withheldDiff() }],
116-
new WeakMap(),
117-
"mr",
118-
sourceControlClients.get("gitlab").changeRequest,
119-
);
120-
expect(parsed.kind === "files" ? parsed.notice : null).toBe(
121-
"Some file contents are unavailable. Open the merge request on its provider to see the full changes.",
122-
);
123-
});
124-
125113
it("combines normal and withheld pages and refreshes counts with unchanged patch text", () => {
126114
const first = { ...diff("first.ts"), nextCursor: "second" };
127115
const withheld = withheldDiff();

‎apps/mobile/src/features/threads/threadListV2.test.ts‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import {
4242
resolveThreadListV2SnoozePresets,
4343
resolveThreadListV2Status,
4444
resolveThreadListV2WokeAt,
45-
sortThreadsForListV2,
4645
threadListV2ListItemsAreEqual,
4746
threadHasUnseenCompletion,
4847
type ThreadListV2ListItem,
@@ -270,17 +269,6 @@ describe("search lists ranked matches", () => {
270269
});
271270
});
272271

273-
describe("sortThreadsForListV2", () => {
274-
it("honors a saved active order and leaves new threads above it", () => {
275-
const sorted = sortThreadsForListV2([
276-
{ id: "newer-arranged", createdAt: "2026-06-01T12:00:00.000Z", activeOrderKey: "t" },
277-
{ id: "older-arranged", createdAt: "2026-06-01T08:00:00.000Z", activeOrderKey: "f" },
278-
{ id: "new", createdAt: "2026-06-01T13:00:00.000Z" },
279-
]);
280-
expect(sorted.map((thread) => thread.id)).toEqual(["new", "older-arranged", "newer-arranged"]);
281-
});
282-
});
283-
284272
describe("getThreadListV2OrderedSection", () => {
285273
it("uses each saved order and excludes settled, snoozed, and archived rows", () => {
286274
const threads = [

‎apps/mobile/src/features/threads/threadListV2.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ function parseTimestampMs(isoDate: string): number {
301301
return Number.isNaN(parsed) ? 0 : parsed;
302302
}
303303

304-
export function sortThreadsForListV2<
304+
function sortThreadsForListV2<
305305
T extends {
306306
readonly id: string;
307307
readonly createdAt: string;

‎apps/server/src/cli/consoleStdin.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe("attachConsoleStdin", () => {
8383
expect(interactiveStdin()).toBe(42);
8484
});
8585

86-
it.each(["pipe", "file"])("preserves redirected %s input", async () => {
86+
it.each(["pipe"])("preserves redirected %s input", async () => {
8787
io.stat.mockReturnValue({ isCharacterDevice: () => false });
8888
const stdin = process.stdin;
8989
const { attachConsoleStdin, interactiveStdin } = await import("./consoleStdin.ts");

0 commit comments

Comments
 (0)