- Move the Tauri app (React frontend + Rust backend) into desktop/ via git mv — configs unchanged (relative paths: tauri.conf.json, vite.config.ts) - Root package.json becomes a private bun workspace container with orchestration scripts; desktop package renamed gridline-desktop - Scaffold www/ with Astro 7 + Tailwind v4 (hand-wired vite plugin, static output, ready for Dokploy) - Update release.yml for the new layout: projectPath: desktop, desktop/src-tauri resource paths, rust-cache workspace path - Update README + AGENTS.md structure trees and dev commands - Verified: vitest (1074), cargo test (354), desktop build, tauri dev (window launches), tauri build (dmg + app bundles), Astro build
23 lines
733 B
TypeScript
23 lines
733 B
TypeScript
import { describe, it, expect, vi, afterEach } from "vitest";
|
|
import { isMacOS } from "./platform";
|
|
|
|
describe("isMacOS", () => {
|
|
afterEach(() => {
|
|
vi.stubGlobal("navigator", undefined);
|
|
});
|
|
|
|
it("true on MacIntel/Mac platform", () => {
|
|
vi.stubGlobal("navigator", { platform: "MacIntel", userAgent: "Mozilla/5.0 (Macintosh; X)" });
|
|
expect(isMacOS()).toBe(true);
|
|
});
|
|
|
|
it("false on Win32", () => {
|
|
vi.stubGlobal("navigator", { platform: "Win32", userAgent: "Mozilla/5.0 (Windows NT 10.0)" });
|
|
expect(isMacOS()).toBe(false);
|
|
});
|
|
|
|
it("false on Linux", () => {
|
|
vi.stubGlobal("navigator", { platform: "Linux x86_64", userAgent: "Mozilla/5.0 (X11; Linux)" });
|
|
expect(isMacOS()).toBe(false);
|
|
});
|
|
}); |