feat(ai-character): 관리자 인증 셸 구현
This commit is contained in:
21
src/shared/ui/__tests__/icon-only-action.test.tsx
Normal file
21
src/shared/ui/__tests__/icon-only-action.test.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { render, screen } from "@testing-library/react";
|
||||
|
||||
import { IconOnlyAction } from "@/shared/ui/icon-only-action";
|
||||
|
||||
describe("IconOnlyAction", () => {
|
||||
test("has an accessible name and a tooltip without duplicating the name as description", () => {
|
||||
render(
|
||||
<IconOnlyAction label="새로고침">
|
||||
<span aria-hidden="true">R</span>
|
||||
</IconOnlyAction>,
|
||||
);
|
||||
|
||||
const button = screen.getByRole("button", { name: "새로고침" });
|
||||
const tooltip = screen.getByRole("tooltip");
|
||||
|
||||
expect(tooltip).toHaveTextContent("새로고침");
|
||||
expect(button).not.toHaveAccessibleDescription("새로고침");
|
||||
expect(button).not.toHaveAttribute("aria-describedby");
|
||||
expect(button).toHaveAttribute("type", "button");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user