feat(back-button): add dark variant and update tests for BackButton component

This commit is contained in:
2026-07-13 16:10:10 +08:00
parent 3362fafa1c
commit 19857e8b9b
4 changed files with 40 additions and 26 deletions
@@ -13,6 +13,9 @@ describe("shared Tailwind components", () => {
const actionHtml = renderToStaticMarkup(
<BackButton onClick={() => undefined} variant="ghost" />,
);
const darkHtml = renderToStaticMarkup(
<BackButton href="/splash" variant="dark" ariaLabel="Back to home" />,
);
expect(linkHtml).toContain('href="/chat"');
expect(linkHtml).toContain('aria-label="Back to chat"');
@@ -22,6 +25,10 @@ describe("shared Tailwind components", () => {
expect(actionHtml).toContain("<button");
expect(actionHtml).toContain("size-8");
expect(actionHtml).toContain("hover:opacity-70");
expect(darkHtml).toContain('href="/splash"');
expect(darkHtml).toContain('aria-label="Back to home"');
expect(darkHtml).toContain("bg-[rgba(13,11,20,0.7)]");
expect(darkHtml).toContain("text-white");
});
it("renders CharacterAvatar with dynamic sizing and image utilities", () => {