Create tests and stories for createflownav

This commit is contained in:
adilallo
2026-02-07 23:35:22 -07:00
parent 37555b2725
commit 8d9b9d6ff3
6 changed files with 348 additions and 129 deletions
+11 -4
View File
@@ -46,19 +46,26 @@ describe("Logo (behavioral tests)", () => {
});
it("hides text when showText is false", () => {
render(<Logo showText={false} />);
expect(screen.queryByText("CommunityRule")).not.toBeInTheDocument();
const { container } = render(<Logo showText={false} />);
const textElement = container.querySelector('.hidden');
expect(textElement).toBeInTheDocument();
expect(screen.getByAltText("CommunityRule Logo Icon")).toBeInTheDocument();
});
it("renders with different size variants", () => {
const { rerender } = render(<Logo size="header" />);
const { rerender } = render(<Logo size="default" />);
expect(screen.getByRole("link")).toBeInTheDocument();
rerender(<Logo size="footer" />);
expect(screen.getByRole("link")).toBeInTheDocument();
rerender(<Logo size="homeHeaderMd" />);
rerender(<Logo size="createFlow" />);
expect(screen.getByRole("link")).toBeInTheDocument();
rerender(<Logo size="topNavFolderTop" />);
expect(screen.getByRole("link")).toBeInTheDocument();
rerender(<Logo size="topNavHeader" />);
expect(screen.getByRole("link")).toBeInTheDocument();
});
});