Skip to content
Merged
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
18 changes: 13 additions & 5 deletions apps/web/src/components/files/fileSaveSessions.browser.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { render, fakeTimers } from "../../../test/render";
import { EnvironmentId } from "@t3tools/contracts";
import { type AuthSessionState, EnvironmentId } from "@t3tools/contracts";
import { AsyncResult } from "effect/reactivity";
import { StrictMode } from "react";
import { describe, expect, it, vi } from "vite-plus/test";
Expand All @@ -12,10 +12,18 @@ vi.mock(import("@t3tools/client-runtime/state/runtime"), async (original) => ({
...(await original()),
runAtomCommand: runAtomCommand as never,
}));
vi.mock(import("~/state/session"), async (original) => ({
...(await original()),
readEnvironmentScope: () => true,
}));
// The real session atom boots the connection runtime, whose endless discovery poll
// would keep vi.runAllTimersAsync from ever draining once its timers are faked.
vi.mock(import("~/state/session"), async (original) => {
const actual = await original();
const reactivity = await import("effect/reactivity");
const signedOut = reactivity.Atom.make(reactivity.AsyncResult.initial<AuthSessionState>());
return {
...actual,
environmentSession: { ...actual.environmentSession, sessionStateAtom: () => signedOut },
readEnvironmentScope: () => true,
};
});
vi.mock(import("./projectFilesQueryState"), async (original) => ({
...(await original()),
confirmProjectFileQueryData: () => true,
Expand Down
Loading