Files
openworker/surfaces/gui/e2e/composer-platform.spec.ts
T
Rohit C Prasad 628b6a82d3 gui: gate the macOS overlay layout to macOS
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.
2026-07-21 23:16:40 -07:00

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();
});