deer-flow/frontend/tests/unit/components/workspace/channels/channel-provider-icon.dom.test.tsx
Ryker_Feng 1e8cedb9f4
feat(channels): polish Buzz frontend (#4727)
* feat(channels): complete Buzz frontend copy

* feat(channels): add official Buzz provider icon

* test(i18n): clarify translation suite scope
2026-08-12 08:33:35 +08:00

33 lines
948 B
TypeScript

import { afterEach, expect, test } from "@rstest/core";
import { cleanup, render } from "@testing-library/react";
import { ChannelProviderIcon } from "@/components/workspace/channels/channel-provider-icon";
afterEach(cleanup);
test("renders collision-safe official Buzz marks", () => {
const { container } = render(
<>
<ChannelProviderIcon provider="buzz" />
<ChannelProviderIcon provider="BUZZ" />
</>,
);
const icons = Array.from(container.querySelectorAll("svg"));
expect(icons).toHaveLength(2);
expect(icons.map((icon) => icon.getAttribute("viewBox"))).toEqual([
"0 0 466 309",
"0 0 466 309",
]);
expect(icons.map((icon) => icon.getAttribute("fill"))).toEqual([
"currentColor",
"currentColor",
]);
const maskIds = Array.from(container.querySelectorAll("mask"), (mask) =>
mask.getAttribute("id"),
);
expect(maskIds).toHaveLength(2);
expect(new Set(maskIds).size).toBe(2);
});