import { renderToStaticMarkup } from "react-dom/server"; import { describe, expect, it } from "vitest"; import { NicknameNotice } from "./nickname-notice"; describe("NicknameNotice", () => { it("announces a synchronized nickname and provides a dismissal action", () => { const markup = renderToStaticMarkup(); expect(markup).toContain('role="status"'); expect(markup).toContain("We updated your Discord nickname to"); expect(markup).toContain("Dani · Steve"); expect(markup).toContain("Awesome, thanks!"); }); it("announces synchronization errors assertively", () => { const markup = renderToStaticMarkup(); expect(markup).toContain('role="alert"'); expect(markup).toContain("Discord rejected the update."); }); });