Skip to content

Commit 2a1f8df

Browse files
PR Batch Testerclaude
andcommitted
test(desktop): assert attached guests get an opaque base background
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent a6d7150 commit 2a1f8df

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎apps/desktop/src/preview/Manager.test.ts‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ describe("PreviewManager", () => {
16011601
),
16021602
);
16031603

1604-
effectIt.effect("emulates prefers-color-scheme and re-applies it across webview swaps", () =>
1604+
effectIt.effect("re-applies opaque base and color scheme across webview swaps", () =>
16051605
withManager((manager) =>
16061606
Effect.gen(function* () {
16071607
const makeWebContents = (id: number) => {
@@ -1650,6 +1650,16 @@ describe("PreviewManager", () => {
16501650
yield* manager.registerWebview("tab_scheme", 42);
16511651
yield* Effect.yieldNow;
16521652

1653+
// Guests start with a transparent base; dark-scheme pages need an opaque
1654+
// one or Chromium skips their dark canvas.
1655+
const opaqueBase = {
1656+
color: { r: 255, g: 255, b: 255, a: 1 },
1657+
};
1658+
expect(first.sendCommand).toHaveBeenCalledWith(
1659+
"Emulation.setDefaultBackgroundColorOverride",
1660+
opaqueBase,
1661+
);
1662+
16531663
yield* manager.setColorScheme("tab_scheme", "dark");
16541664

16551665
expect(first.sendCommand).toHaveBeenCalledWith("Emulation.setEmulatedMedia", {
@@ -1662,6 +1672,10 @@ describe("PreviewManager", () => {
16621672
yield* manager.registerWebview("tab_scheme", 43);
16631673
yield* Effect.yieldNow;
16641674

1675+
expect(replacement.sendCommand).toHaveBeenCalledWith(
1676+
"Emulation.setDefaultBackgroundColorOverride",
1677+
opaqueBase,
1678+
);
16651679
expect(replacement.sendCommand).toHaveBeenCalledWith("Emulation.setEmulatedMedia", {
16661680
features: [{ name: "prefers-color-scheme", value: "dark" }],
16671681
});

0 commit comments

Comments
 (0)