Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/mobile/plugins/withAndroidFbjniVersion.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ describe("withAndroidFbjniVersion", () => {
expect(twice).toBe(once);
});

// regression: #20118 fresh Android builds no longer crash on launch
it("writes Kotlin syntax into a Kotlin build script", async () => {
const result = await prebuildRootGradle("build.gradle.kts", "plugins {}\n");

Expand Down
36 changes: 0 additions & 36 deletions apps/mobile/src/components/ui/headerMenu.test.ts

This file was deleted.

32 changes: 0 additions & 32 deletions apps/mobile/src/connection/environment-cache-store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
type OrchestrationV2ShellSnapshot,
type OrchestrationV2ThreadDetailSnapshot,
type ThreadPullRequestLink,
type VcsListRefsResult,
} from "@t3tools/contracts";
import { describe, expect, it } from "@effect/vitest";
import * as DateTime from "effect/DateTime";
Expand Down Expand Up @@ -144,20 +143,6 @@ const THREAD_SNAPSHOT: OrchestrationV2ThreadDetailSnapshot = {
updatedAt: NOW,
},
};
const REFS: VcsListRefsResult = {
refs: [
{
name: "main",
current: true,
isDefault: true,
worktreePath: "/repo",
},
],
isRepo: true,
hasPrimaryRemote: true,
nextCursor: null,
totalCount: 1,
};

function cacheId(
environmentId: EnvironmentId,
Expand Down Expand Up @@ -334,21 +319,4 @@ describe("mobile SQLite environment cache store", () => {
expect(memory.removed).toEqual([id]);
}),
);

it.effect("clears one environment without touching another", () =>
Effect.gen(function* () {
const memory = makeDatabase();
const store = yield* make().pipe(
Effect.provideService(MobileDatabase.MobileDatabase, memory.database),
);
const otherEnvironmentId = EnvironmentId.make("environment-2");
yield* store.saveVcsRefs(ENVIRONMENT_ID, "/repo", REFS);
yield* store.saveVcsRefs(otherEnvironmentId, "/repo", REFS);

yield* store.clear(ENVIRONMENT_ID);

expect(yield* store.loadVcsRefs(ENVIRONMENT_ID, "/repo")).toEqual(Option.none());
expect(yield* store.loadVcsRefs(otherEnvironmentId, "/repo")).toEqual(Option.some(REFS));
}),
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,6 @@ afterEach(() => {
});

describe("consumeLastAgentNotificationResponse", () => {
it("routes a response before reporting a clear failure", async () => {
const cause = new Error("notification clear unavailable");
const consoleError = vi.spyOn(console, "error").mockImplementation(() => undefined);
const response = responseWithData({}, "notification-clear") as NotificationResponse;
const handleResponse = vi.fn();

await consumeLastAgentNotificationResponse({
getLastResponse: () => Promise.resolve(response),
clearLastResponse: () => Promise.reject(cause),
handleResponse,
});

expect(handleResponse).toHaveBeenCalledWith(response);
expect(consoleError).toHaveBeenCalledWith(
expect.objectContaining({
_tag: "NotificationNavigationError",
operation: "clear",
notificationId: "notification-clear",
}),
);
});

it("reports routing failures before clearing the response", async () => {
const cause = new Error("notification routing unavailable");
const consoleError = vi.spyOn(console, "error").mockImplementation(() => undefined);
Expand Down Expand Up @@ -86,16 +64,6 @@ describe("extractAgentNotificationDeepLink", () => {
).toBe("/threads/env/thread");
});

it("normalizes explicit thread deep links from APNs payload data", () => {
expect(
extractAgentNotificationDeepLink(
responseWithData({
deepLink: "/threads/env%201/thread%2F2",
}),
),
).toBe("/threads/env%201/thread%2F2");
});

it("falls back to the thread route from environment and thread ids", () => {
expect(
extractAgentNotificationDeepLink(
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -598,21 +598,6 @@ describe("makeRelayDeviceRegistrationRequest", () => {
}).pipe(Effect.provide(layerRelayTest));
});

it.effect("re-registers when the stored account identity differs", () => {
Constants.expoConfig!.extra = {
relay: {
url: "https://relay.example.test/",
},
};
registrationRecordStore.current = { identity: "someone-else", signature: "stale" };
setAgentAwarenessRelayTokenProvider(() => Promise.resolve("clerk-token-user-a"));

return Effect.gen(function* () {
yield* refreshAgentAwarenessRegistration();
expect(saveAgentAwarenessRegistrationRecord).toHaveBeenCalledTimes(1);
}).pipe(Effect.provide(layerRelayTest));
});

it.effect("continues queued device registration after a failed auth lookup", () => {
Constants.expoConfig!.extra = {
relay: {
Expand Down
17 changes: 0 additions & 17 deletions apps/mobile/src/features/connection/environmentSections.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,6 @@ describe("mobile environment settings sections", () => {
expect(sections.availableCloudEnvironments).toEqual([]);
});

it("does not duplicate a saved relay environment in the available cloud listing", () => {
const cloud = connectedEnvironment({
environmentId: "environment-cloud",
isRelayManaged: true,
connectionState: "available",
});
const listedCloud = cloudEnvironment("environment-cloud");

const sections = splitEnvironmentSections({
connectedEnvironments: [cloud],
cloudEnvironments: [listedCloud],
});

expect(sections.connectedCloudEnvironments).toEqual([cloud]);
expect(sections.availableCloudEnvironments).toEqual([]);
});

it("still offers a cloud environment saved directly as a local backend", () => {
const local = connectedEnvironment({
environmentId: "environment-cloud",
Expand Down
8 changes: 0 additions & 8 deletions apps/mobile/src/features/diagnostics/crash-log-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,4 @@ describe("parseStartupCrashRecords", () => {
]);
expect(records.map((record) => record.timestamp)).toEqual([20, 10]);
});

it("skips a runtime error entry without a description line", () => {
expect(
parseStartupCrashRecords([
{ ...FATAL, message: "ErrorRecovery fatal exception: Fatal exception: Name: x" },
]),
).toEqual([]);
});
});
23 changes: 5 additions & 18 deletions apps/mobile/src/features/home/useThreadListActions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,24 +219,6 @@ describe("thread list operation permissions", () => {
expect(state.requests).toEqual([]);
});

it.each(mutationCases)(
"%s works when the target environment gains only task permission",
async (handler, action) => {
state.scopes.get(primaryEnvironmentId)!.clear();
const actions = useThreadListActions();
state.scopes.get(otherEnvironmentId)!.add(AuthOrchestrationOperateScope);

await actions[handler](
makeThread({ environmentId: otherEnvironmentId }),
"2099-01-01T00:00:00.000Z",
);

expect(state.requests).toEqual([
expect.objectContaining({ action, environmentId: otherEnvironmentId }),
]);
},
);

it("rechecks permission after a retained delete confirmation", async () => {
useThreadListActions().confirmDeleteThread(makeThread());
const confirm = state.dialogs[0]?.onConfirm;
Expand Down Expand Up @@ -368,6 +350,7 @@ describe("thread action undo", () => {
expect(readThreadUndoNotice()).toBeNull();
});

// regression: #21401 restore archive and thread action undo
it("wakes a snoozed thread through the undo action", async () => {
const thread = makeThread();
await useThreadListActions().snoozeThread(thread, "2099-01-01T09:00:00.000Z");
Expand Down Expand Up @@ -410,6 +393,7 @@ describe("thread action undo", () => {
},
);

// regression: #21401 restore archive and thread action undo
it("does not restore snooze if undoing an unpin fails", async () => {
const thread = makeThread({
pinnedAt: "2026-09-02T00:00:00.000Z",
Expand All @@ -431,6 +415,7 @@ describe("thread action undo", () => {
expect(readThreadUndoNotice()).toBeNull();
});

// regression: #21401 restore archive and thread action undo
it("does not offer undo for a failed action", async () => {
state.failedAction = "settle";
expect(await useThreadListActions().settleThread(makeThread())).toBe(false);
Expand All @@ -456,6 +441,7 @@ describe("thread action undo", () => {
expect(state.requests.map(({ action }) => action)).toEqual(["unpin"]);
});

// regression: #21401 restore archive and thread action undo
it("expires undo after five seconds", async () => {
vi.useFakeTimers();
await useThreadListActions().unpinThread(makeThread());
Expand All @@ -466,6 +452,7 @@ describe("thread action undo", () => {
expect(state.requests.map(({ action }) => action)).toEqual(["unpin"]);
});

// regression: #21401 restore archive and thread action undo
it("refreshes the archive after archiving on a settlement-capable server", async () => {
await useThreadListActions().archiveThread(makeThread());
expect(state.requests.map(({ action }) => action)).toEqual(["archive"]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ function workspaceState(overrides: Partial<WorkspaceState> = {}): WorkspaceState

describe("workspace connection status", () => {
it.each([
["connecting", null],
["reconnecting", null],
["connecting", "Could not reach sleeping laptop"],
["reconnecting", "Could not reach sleeping laptop"],
["error", "Could not reach sleeping laptop"],
] as const)(
Expand Down
Loading
Loading