Open History to see the last commit
1import { renderToStaticMarkup } from "react-dom/server";
2import { describe, expect, it } from "vite-plus/test";
3
4import { ThreadErrorBanner } from "./ThreadErrorBanner";
5
6describe("ThreadErrorBanner", () => {
7 it("aligns the warning and dismiss icons with the first line of a multi-line error", () => {
8 const markup = renderToStaticMarkup(
9 <ThreadErrorBanner
10 error={"The first error line\ncontinues on a second line"}
11 onDismiss={() => {}}
12 />,
13 );
14
15 expect(markup).toContain('role="alert"');
16 expect(markup).toContain('aria-label="Dismiss error"');
17 expect(markup).not.toContain("controlAlignment");
18 expect(markup).toContain("flex gap-2 items-start");
19 expect(markup).toContain("min-h-7 pt-1 sm:min-h-6 sm:pt-0.5");
20 expect(markup).toContain("h-lh w-4");
21 expect(markup).toContain("h-lh self-start");
22 });
23});