Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export function IdentityKeyHelpDialog() {
<DialogContent
className="buzz-onboarding-neutral-theme max-w-[47.5rem] -translate-y-5"
closeButtonClassName={ONBOARDING_INK_ICON_CLASS}
data-system-color-scheme="light"
data-testid="identity-key-help-dialog"
overlayVariant="transparent"
surface="textured"
Expand Down
35 changes: 35 additions & 0 deletions desktop/tests/e2e/identity-key-help.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,38 @@ test("identity key help explains the first-run choice", async ({ page }) => {
"1",
);
});

test("identity key help stays readable when the app resolves dark mode", async ({
page,
}) => {
await page.emulateMedia({ colorScheme: "dark" });
await installMockBridge(page, undefined, {
skipCommunitySeed: true,
skipOnboardingSeed: true,
});
await page.goto("/");

// Fresh profiles follow the system scheme, so the emulated dark scheme is
// the first-run repro: the app resolves the dark theme while onboarding.
await expect
.poll(() =>
page.evaluate(() => document.documentElement.classList.contains("dark")),
)
.toBe(true);

const trigger = page.getByTestId("identity-key-help-trigger");
await expect(trigger).toHaveCSS("opacity", "1", { timeout: 5000 });
await trigger.click();

const dialog = page.getByTestId("identity-key-help-dialog");
await expect(dialog).toBeVisible();
await waitForAnimations(page);

// The textured powder card is baked light in both themes, so the dialog pins
// the neutral onboarding theme to its light variant. Without the pin the
// dark theme flips --foreground to near-white and the title disappears
// against the white card.
await expect(
dialog.getByRole("heading", { name: "What’s an identity key?" }),
).toHaveCSS("color", "rgb(23, 23, 23)");
});
Loading