Skip to content

Commit

Permalink
feat(chore): add avatar test
Browse files Browse the repository at this point in the history
  • Loading branch information
mnlfischer committed Sep 26, 2023
1 parent 2a06c6d commit b15a389
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/components/avatar/avatar.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { describe, expect, it } from "vitest";
import { getByText, render, screen } from "@testing-library/react";
import React from "react";
import { Avatar } from "./avatar";

describe("Avatar", () => {
it("renders an avatar with substring of child", () => {
// ARRANGE
render(<Avatar color="primary">Test User</Avatar>);

// ASSERT
const alert = screen.getByRole("button");
expect(alert).toBeInTheDocument();
expect(getByText(alert, "Te")).toBeInTheDocument();
});
});

0 comments on commit b15a389

Please sign in to comment.