Files
minecraft-account-manager/apps/web/src/components/nickname-notice.test.tsx
T
dmg b7c0083647
CI / validate (push) Successful in 5m20s
Release / release (push) Successful in 6m56s
feat(portal): add SSR operations and exclusive groups
2026-08-01 19:21:23 -04:00

21 lines
858 B
TypeScript

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(<NicknameNotice nickname="Dani · Steve" />);
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(<NicknameNotice error="Discord rejected the update." />);
expect(markup).toContain('role="alert"');
expect(markup).toContain("Discord rejected the update.");
});
});