Skip to content

Commit

Permalink
Merge pull request #40 from abusix/pla-507-hailstorm-component-tests-…
Browse files Browse the repository at this point in the history
…avatar

feat(chore): add avatar test
  • Loading branch information
mnlfischer authored Sep 27, 2023
2 parents 31f1945 + 9375da7 commit 03d1b84
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/avatar/avatar.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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", () => {
const text = "Test User";
// ARRANGE
render(<Avatar color="primary">{text}</Avatar>);

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

0 comments on commit 03d1b84

Please sign in to comment.