mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-11 19:05:16 +00:00
app: fix 18 failing test files with vitest setup and stale expectations
Add vitest.setup.ts to define __DEV__, shim Expo globals, mock react-native-unistyles/expo-linking, and stub @xterm/addon-ligatures. Update stale test expectations across combined-model-selector, use-settings, tool-call-display, sidebar-project-row-model, sidebar-shortcuts, keyboard-shortcuts, host-runtime, use-agent-form-state, desktop-permissions, and voice-runtime to match current source behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
028e6ad591
commit
522d4091a9
@@ -12,7 +12,9 @@ const originalGlobals: GlobalSnapshot = {
|
||||
Notification: (globalThis as { Notification?: unknown }).Notification,
|
||||
navigatorDescriptor: Object.getOwnPropertyDescriptor(globalThis, "navigator"),
|
||||
paseoDesktop:
|
||||
typeof window === "undefined" ? undefined : (window as { paseoDesktop?: unknown }).paseoDesktop,
|
||||
typeof globalThis.window === "undefined"
|
||||
? undefined
|
||||
: (globalThis.window as { paseoDesktop?: unknown }).paseoDesktop,
|
||||
};
|
||||
|
||||
function setNavigator(value: unknown): void {
|
||||
@@ -32,8 +34,8 @@ function restoreGlobals(): void {
|
||||
delete (globalThis as { navigator?: unknown }).navigator;
|
||||
}
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
(window as { paseoDesktop?: unknown }).paseoDesktop = originalGlobals.paseoDesktop;
|
||||
if (typeof globalThis.window !== "undefined") {
|
||||
(globalThis.window as { paseoDesktop?: unknown }).paseoDesktop = originalGlobals.paseoDesktop;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +58,7 @@ describe("desktop-permissions", () => {
|
||||
|
||||
expect(shouldShowDesktopPermissionSection()).toBe(false);
|
||||
|
||||
(window as { paseoDesktop?: unknown }).paseoDesktop = {};
|
||||
globalThis.window = { paseoDesktop: {} } as unknown as Window & typeof globalThis;
|
||||
expect(shouldShowDesktopPermissionSection()).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user