mirror of
https://github.com/andrewyng/openworker.git
synced 2026-09-10 22:20:27 +00:00
Shell injects the OS; Windows/Linux keep the native title bar with no traffic-light insets. Thin scrollbars on Windows/Linux so panels stop losing width to classic scrollbars.
24 lines
1000 B
TypeScript
24 lines
1000 B
TypeScript
import { test, expect } from "./fixtures";
|
|
|
|
// The macOS overlay layout (traffic-light insets) must never apply on Windows —
|
|
// Windows keeps its native title bar (alignment bug, 2026-07-21). The shell injects
|
|
// __OCW_PLATFORM__; this simulates each platform and checks the overlay class.
|
|
test("windows platform gets no tauri-overlay layout", async ({ page }) => {
|
|
await page.addInitScript(() => {
|
|
(window as any).__TAURI__ = {}; // simulate the desktop shell
|
|
(window as any).__OCW_PLATFORM__ = "windows";
|
|
});
|
|
await page.goto("/");
|
|
await expect(page.locator("html")).toHaveAttribute("data-platform", "windows");
|
|
await expect(page.locator(".app.tauri-overlay")).toHaveCount(0);
|
|
});
|
|
|
|
test("macos platform keeps the overlay layout", async ({ page }) => {
|
|
await page.addInitScript(() => {
|
|
(window as any).__TAURI__ = {};
|
|
(window as any).__OCW_PLATFORM__ = "macos";
|
|
});
|
|
await page.goto("/");
|
|
await expect(page.locator(".app.tauri-overlay").first()).toBeVisible();
|
|
});
|