feat: full screen onboarding with a plugin picker and per step versions

This commit is contained in:
LukeGus committed 2026-10-06 17:44:25 -05:00
1 parent 1e74ce4827
commit b9dd3488a5
59 files changed
+5413 -643

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import {
isEmbeddedAuthFrame,
isInElectronWebView,
isInMobileWebView,
} from "@/lib/embedded-frame";
type TestWindow = Window & {
ReactNativeWebView?: unknown;
IS_ELECTRON_WEBVIEW?: boolean;
};
afterEach(() => {
vi.restoreAllMocks();
delete (window as TestWindow).ReactNativeWebView;
delete (window as TestWindow).IS_ELECTRON_WEBVIEW;
});
describe("embedded frame detection", () => {
it("is false for a normal browser tab", () => {
expect(isInMobileWebView()).toBe(false);
expect(isInElectronWebView()).toBe(false);
expect(isEmbeddedAuthFrame()).toBe(false);
});
it("spots the mobile app by user agent or bridge", () => {
vi.spyOn(navigator, "userAgent", "get").mockReturnValue(
"Mozilla/5.0 Termix-Mobile/Android",
);
expect(isInMobileWebView()).toBe(true);
vi.restoreAllMocks();
(window as TestWindow).ReactNativeWebView = { postMessage() {} };
expect(isInMobileWebView()).toBe(true);
expect(isInElectronWebView()).toBe(false);
expect(isEmbeddedAuthFrame()).toBe(true);
});
it("spots the desktop link window by flag", () => {
(window as TestWindow).IS_ELECTRON_WEBVIEW = true;
expect(isInElectronWebView()).toBe(true);
expect(isEmbeddedAuthFrame()).toBe(true);
});
});