Files
WRNexusJS/packages/ui/test/tooltip-closed.test.ts
T
ClintchizandClaude Opus 5.5 c2e1f8b3d1
Quality / quality (ubuntu-latest) (push) Failing after 1s
Quality / quality (windows-latest) (push) Canceled after 0s
fix(ui): keep closed tooltips hidden before hydration
Tooltip content was hidden only by data-show, which the client applies
after hydration, so server HTML showed every tooltip for a moment on page
load. A closed tooltip ([data-open="false"]) is now hidden in CSS too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 16:27:39 +05:30

9 lines
487 B
TypeScript

import { expect, test } from "bun:test";
// Server HTML renders tooltip content before the client applies data-show, so
// a closed tooltip must also be hidden by CSS or it flashes on every page load.
test("closed tooltip content is hidden by CSS before hydration", async () => {
const source = await Bun.file(new URL("../components/tooltip.wrn", import.meta.url)).text();
expect(source).toMatch(/\.wrn-tooltip\[data-open="false"\] \.wrn-tooltip__content \{\s*display: none;/);
});