Skip to content

Commit 2edddbc

Browse files
test(desktop): prune low-value tests in desktop (second pass) (pingdotgg#22589)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 7c16a40 commit 2edddbc

58 files changed

Lines changed: 21 additions & 2010 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/desktop/gnome-extension/captureFeedback.test.js‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,6 @@ it("waits for T3 to remap and cancels that wait when disabled", async () => {
151151
expect(shell.mapped.size).toBe(0);
152152
});
153153

154-
it("does not animate under reduced motion but still activates T3", async () => {
155-
shell.animations = false;
156-
shell.windows = [target()];
157-
const { feedback, started } = begin();
158-
expect(started).toBe(false);
159-
expect(shell.actors).toHaveLength(0);
160-
await feedback.activate(":1.23", "T3");
161-
expect(shell.activate).toHaveBeenCalledOnce();
162-
feedback.dispose();
163-
});
164-
165154
it("rejects another sender and locked-session activation", async () => {
166155
shell.windows = [target()];
167156
const { feedback } = begin();

‎apps/desktop/gnome-extension/captureService.test.js‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ it("rejects other clients before looking at the active window", async () => {
2828
expect(await service.capture(":1.23")).toBe("pixels");
2929
});
3030

31-
it.each(CLIENT_NAMES)("accepts the current owner of %s", async (client) => {
32-
const { service } = fixture({ getNameOwner: async (name) => (name === client ? ":1.23" : null) });
33-
expect(await service.capture(":1.23")).toBe("pixels");
34-
});
35-
3631
it("rechecks the name owner on each capture", async () => {
3732
let owner = ":1.23";
3833
const { service } = fixture({ getNameOwner: async () => owner });

‎apps/desktop/scripts/electron-launcher.mjs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function runChecked(command, args) {
9494
throw new Error(`Failed to run ${command} ${args.join(" ")}: ${details}`.trim());
9595
}
9696

97-
export function resolveMacCodeSignArguments(appBundlePath) {
97+
function resolveMacCodeSignArguments(appBundlePath) {
9898
return ["--force", "--deep", "--sign", "-", "--timestamp=none", appBundlePath];
9999
}
100100

@@ -201,7 +201,7 @@ function registerMacLauncherBundle(appBundlePath) {
201201
}
202202

203203
// Bundle-internal paths are macOS paths whatever host builds them.
204-
export function resolveMacLauncherIconPaths(runtimeDir, development = isDevelopment) {
204+
function resolveMacLauncherIconPaths(runtimeDir, development = isDevelopment) {
205205
return {
206206
sourceIconPath: development ? developmentMacIconPngPath : productionMacIconPngPath,
207207
generatedIconPath: NodePath.posix.join(
@@ -260,7 +260,7 @@ function ensureMacIconIcns(runtimeDir) {
260260
}
261261
}
262262

263-
export function resolveMacBundleInfoPlistStrings(executableName) {
263+
function resolveMacBundleInfoPlistStrings(executableName) {
264264
return {
265265
CFBundleDisplayName: APP_DISPLAY_NAME,
266266
CFBundleName: APP_DISPLAY_NAME,

‎apps/desktop/scripts/electron-launcher.test.mjs‎

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ import {
1111
makeDevelopmentEnvironmentScript,
1212
makeDevelopmentLauncherScript,
1313
resolveElectronBinaryPath,
14-
resolveMacBundleInfoPlistStrings,
15-
resolveMacCodeSignArguments,
16-
resolveMacLauncherIconPaths,
1714
resolveMacLauncherPaths,
1815
writeDevelopmentLauncherScript,
1916
} from "./electron-launcher.mjs";
@@ -106,30 +103,6 @@ describe("electron development launcher", () => {
106103
assert.notInclude(script, "node_modules/electron");
107104
});
108105

109-
it("declares why the macOS app needs protected access", () => {
110-
const values = resolveMacBundleInfoPlistStrings("T3 Code (Dev) Launcher");
111-
112-
assert.equal(
113-
values.NSScreenCaptureUsageDescription,
114-
"T3 Code captures the active window when you use the snapshot shortcut.",
115-
);
116-
assert.equal(
117-
values.NSDocumentsFolderUsageDescription,
118-
"T3 Code reads project files you open in the desktop app.",
119-
);
120-
});
121-
122-
it("ad-hoc signs the complete development app bundle", () => {
123-
assert.deepEqual(resolveMacCodeSignArguments("/runtime/T3 Code (Dev).app"), [
124-
"--force",
125-
"--deep",
126-
"--sign",
127-
"-",
128-
"--timestamp=none",
129-
"/runtime/T3 Code (Dev).app",
130-
]);
131-
});
132-
133106
it("restores execute permissions on an unchanged launcher", () => {
134107
const directory = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-launcher-"));
135108
const launcherPath = NodePath.join(directory, "launcher");
@@ -143,16 +116,6 @@ describe("electron development launcher", () => {
143116
NodeFS.rmSync(directory, { recursive: true, force: true });
144117
}
145118
});
146-
147-
it("derives launcher icons from canonical development and production assets", () => {
148-
const development = resolveMacLauncherIconPaths("/runtime", true);
149-
const production = resolveMacLauncherIconPaths("/runtime", false);
150-
151-
assert.match(development.sourceIconPath, /assets[\\/]dev[\\/]blueprint-macos-1024\.png$/);
152-
assert.equal(development.generatedIconPath, "/runtime/icon-dev.icns");
153-
assert.match(production.sourceIconPath, /assets[\\/]prod[\\/]black-macos-1024\.png$/);
154-
assert.equal(production.generatedIconPath, "/runtime/icon-prod.icns");
155-
});
156119
});
157120

158121
async function startupCleanupPattern(desktopDir) {

‎apps/desktop/scripts/verify-preload-bundle.test.mjs‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,26 +60,13 @@ describe("desktop preload bundle verifier", () => {
6060
);
6161
});
6262

63-
it("ignores import-like text in strings", () => {
64-
assert.doesNotThrow(() =>
65-
verifyPreloadBundle(`${validPreload}\nconst message = 'import /* comment */("module")';`),
66-
);
67-
});
68-
6963
it("rejects unsupported require calls with comments before the opening parenthesis", () => {
7064
assert.throws(
7165
() => verifyPreloadBundle(`${validPreload}\nrequire /* @__PURE__ */ ("node:fs");`),
7266
/unsupported sandbox imports: node:fs/,
7367
);
7468
});
7569

76-
it("rejects unsupported optional require calls", () => {
77-
assert.throws(
78-
() => verifyPreloadBundle(`${validPreload}\nrequire?.("node:fs");`),
79-
/unsupported sandbox imports: node:fs/,
80-
);
81-
});
82-
8370
it("accepts Electron sandbox module aliases", () => {
8471
assert.doesNotThrow(() =>
8572
verifyPreloadBundle(`

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

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -49,31 +49,6 @@ describe("DesktopAppActivationBroker", () => {
4949
broker.close();
5050
});
5151

52-
it("queues requests after unsubscribe until a new renderer registers", async () => {
53-
const previousSend = vi.fn();
54-
const nextSend = vi.fn();
55-
const broker = new DesktopAppActivationBroker({ requestTimeoutMs: 1_000, activate: vi.fn() });
56-
broker.registerRenderer(previousSend);
57-
broker.clearRenderer();
58-
59-
const response = broker.request(request);
60-
expect(previousSend).not.toHaveBeenCalled();
61-
expect(nextSend).not.toHaveBeenCalled();
62-
63-
broker.registerRenderer(nextSend);
64-
expect(nextSend).toHaveBeenCalledWith(request);
65-
broker.complete({
66-
version: 1,
67-
requestId: request.requestId,
68-
ok: true,
69-
projectId: ProjectId.make("project-1"),
70-
threadId: ThreadId.make("thread-1"),
71-
});
72-
73-
await expect(response).resolves.toMatchObject({ ok: true });
74-
broker.close();
75-
});
76-
7752
it("never sends a canceled request that was queued behind another request", async () => {
7853
const send = vi.fn();
7954
const broker = new DesktopAppActivationBroker({ requestTimeoutMs: 1_000, activate: vi.fn() });

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

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as FileSystem from "effect/FileSystem";
88
import * as Path from "effect/Path";
99
import * as Layer from "effect/Layer";
1010
import * as Option from "effect/Option";
11-
import * as PlatformError from "effect/PlatformError";
1211
import * as Ref from "effect/Ref";
1312
import * as Schema from "effect/Schema";
1413

@@ -267,44 +266,6 @@ describe("DesktopConnectionCatalogStore", () => {
267266
),
268267
);
269268

270-
it.effect("surfaces catalog filesystem failures instead of treating them as missing", () =>
271-
Effect.gen(function* () {
272-
const path = yield* Path.Path;
273-
const baseFileSystem = yield* FileSystem.FileSystem;
274-
const baseDir = yield* baseFileSystem.makeTempDirectoryScoped({
275-
prefix: "t3-desktop-connection-catalog-test-",
276-
});
277-
const permissionError = PlatformError.systemError({
278-
_tag: "PermissionDenied",
279-
module: "FileSystem",
280-
method: "readFileString",
281-
pathOrDescriptor: path.join(baseDir, "userdata", "connection-catalog.json"),
282-
});
283-
const layerFileSystem = Layer.succeed(
284-
FileSystem.FileSystem,
285-
FileSystem.makeNoop({
286-
readFileString: () => Effect.fail(permissionError),
287-
}),
288-
);
289-
const store = yield* DesktopConnectionCatalogStore.DesktopConnectionCatalogStore.pipe(
290-
Effect.provide(layerFor(baseDir, true, null, layerFileSystem)),
291-
);
292-
293-
const error = yield* store.get.pipe(Effect.flip);
294-
assert.instanceOf(
295-
error,
296-
DesktopConnectionCatalogStore.DesktopConnectionCatalogStoreReadError,
297-
);
298-
assert.equal(error.catalogPath, path.join(baseDir, "userdata", "connection-catalog.json"));
299-
assert.strictEqual(error.cause, permissionError);
300-
assert.equal(
301-
error.message,
302-
`Failed to read the desktop connection catalog at ${path.join(baseDir, "userdata", "connection-catalog.json")}.`,
303-
);
304-
assert.notEqual(error.message, permissionError.message);
305-
}).pipe(Effect.provide(NodeServices.layer), Effect.scoped),
306-
);
307-
308269
it.effect("surfaces a catalog that can no longer be decrypted without deleting it", () =>
309270
Effect.gen(function* () {
310271
const path = yield* Path.Path;

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

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ describe("DesktopEarlyElectronStartup", () => {
5757
const releaseCommits: Record<string, string> = {
5858
"0.48.0": "5ee35f914f921e5696030698e74fb5566a804768",
5959
"0.48.1": "29e2e59fdbab8ed2cc23a20e3c6043d5decb5cdc",
60-
"0.49.0": "9958d297641b5c84dcff93f9039d80a5ad37ab00",
61-
"0.50.0": "c4a4c341568944bd4fb9cd503558b2de602c0213",
6260
"0.50.1": "4e242d086e20b32951fdc0ebcbfb4d41b5be8dcc",
6361
};
6462
const hyprctlVersion =
@@ -80,18 +78,15 @@ describe("DesktopEarlyElectronStartup", () => {
8078
readHyprctlVersionJson: hyprctlVersion("0.48.1"),
8179
};
8280

83-
it.each(["0.48.0", "0.48.1", "0.49.0", "0.50.0", "0.50.1"])(
84-
"disables the color manager on Hyprland %s",
85-
(version) => {
86-
assert.equal(
87-
resolveLinuxDisableFeaturesSwitch({
88-
...brokenHyprland,
89-
readHyprctlVersionJson: hyprctlVersion(version),
90-
}),
91-
"WaylandWpColorManagerV1",
92-
);
93-
},
94-
);
81+
it.each(["0.48.0", "0.50.1"])("disables the color manager on Hyprland %s", (version) => {
82+
assert.equal(
83+
resolveLinuxDisableFeaturesSwitch({
84+
...brokenHyprland,
85+
readHyprctlVersionJson: hyprctlVersion(version),
86+
}),
87+
"WaylandWpColorManagerV1",
88+
);
89+
});
9590

9691
it.each([
9792
{ label: "case-insensitive desktop tokens", env: { XDG_CURRENT_DESKTOP: "foo:HYPRLAND" } },

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -280,30 +280,6 @@ describe("DesktopObservability", () => {
280280
),
281281
);
282282

283-
it.effect("stays off the network when no endpoint is configured", () => {
284-
const requests: Array<ExportedRequest> = [];
285-
return Effect.gen(function* () {
286-
const fileSystem = yield* FileSystem.FileSystem;
287-
const baseDir = yield* fileSystem.makeTempDirectoryScoped({
288-
prefix: "t3-desktop-observability-test-",
289-
});
290-
291-
yield* Effect.scoped(
292-
Effect.logInfo("desktop log stays local").pipe(
293-
Effect.withSpan("desktop-offline-test"),
294-
Effect.provide(
295-
DesktopObservability.layer.pipe(Layer.provideMerge(layerEnvironmentFor(baseDir))),
296-
),
297-
),
298-
);
299-
300-
assert.lengthOf(requests, 0);
301-
}).pipe(
302-
Effect.scoped,
303-
Effect.provide(Layer.mergeAll(NodeServices.layer, layerCollector(requests), layerEmptyEnv)),
304-
);
305-
});
306-
307283
it.effect("stops every export when the OpenTelemetry SDK is disabled", () => {
308284
const requests: Array<ExportedRequest> = [];
309285
return Effect.gen(function* () {

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import * as HostProcess from "@t3tools/shared/HostProcess";
44
import * as Effect from "effect/Effect";
55
import * as Exit from "effect/Exit";
66
import * as FileSystem from "effect/FileSystem";
7-
import * as Path from "effect/Path";
87

98
import * as DesktopPreReadyFileSystem from "./DesktopPreReadyFileSystem.ts";
109
import * as DesktopUserData from "./DesktopUserData.ts";
@@ -17,21 +16,6 @@ const resolveWindowsUserData = (appDataDirectory: string) =>
1716
}).pipe(Effect.provide(DesktopPreReadyFileSystem.layer));
1817

1918
it.layer(NodeServices.layer)("DesktopPreReadyFileSystem", (it) => {
20-
it.effect("migrates the legacy Windows profile state", () =>
21-
Effect.gen(function* () {
22-
const fileSystem = yield* FileSystem.FileSystem;
23-
const path = yield* Path.Path;
24-
const root = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-pre-ready-fs-" });
25-
yield* fileSystem.makeDirectory(path.join(root, "T3 Code (Alpha)"));
26-
yield* fileSystem.writeFileString(path.join(root, "T3 Code (Alpha)", "Local State"), "keys");
27-
28-
const userData = yield* resolveWindowsUserData(root);
29-
30-
assert.equal(userData, path.join(root, "t3code-v2"));
31-
assert.equal(yield* fileSystem.readFileString(path.join(userData, "Local State")), "keys");
32-
}),
33-
);
34-
3519
it.effect.skipIf(HostProcess.Platform.defaultValue() === "win32" || process.getuid?.() === 0)(
3620
"fails instead of treating an unreadable profile as missing",
3721
() =>

0 commit comments

Comments
 (0)