mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
- Fix 80 E2E test failures across 6 root causes (channel auto-select, settings overlay wiring, QuickSwitcher Ctrl+K, voice widget visibility, member list rendering, status dot positioning) - Add Tauri credential storage (Rust + TS bridge) and window-state persistence - Add ConnectedOverlay component and settings-overlay/window-state unit tests - Expand profiles and rate-limiter with comprehensive test coverage - Add CODE_REVIEW.md documenting 4 Critical + 3 High server-side issues - Add Playwright E2E suite (135 tests across 14 spec files) - All 586 tests passing (451 unit/integration + 135 E2E)
35 lines
812 B
TypeScript
35 lines
812 B
TypeScript
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
|
|
// Mock logger
|
|
vi.mock("@lib/logger", () => ({
|
|
createLogger: () => ({
|
|
debug: vi.fn(),
|
|
info: vi.fn(),
|
|
warn: vi.fn(),
|
|
error: vi.fn(),
|
|
}),
|
|
}));
|
|
|
|
// Mock Tauri APIs as unavailable by default
|
|
vi.mock("@tauri-apps/api/core", () => {
|
|
throw new Error("Not in Tauri");
|
|
});
|
|
|
|
vi.mock("@tauri-apps/api/window", () => {
|
|
throw new Error("Not in Tauri");
|
|
});
|
|
|
|
describe("window-state", () => {
|
|
beforeEach(() => {
|
|
vi.resetModules();
|
|
});
|
|
|
|
it("initWindowState returns a cleanup function when Tauri unavailable", async () => {
|
|
const { initWindowState } = await import("@lib/window-state");
|
|
const cleanup = await initWindowState();
|
|
expect(typeof cleanup).toBe("function");
|
|
// Should be a no-op
|
|
cleanup();
|
|
});
|
|
});
|