From b15a3893a539c8c49dfaf743a5c8697bf1628b6f Mon Sep 17 00:00:00 2001 From: Manuel Date: Tue, 26 Sep 2023 09:01:05 +0200 Subject: [PATCH] feat(chore): add avatar test --- src/components/avatar/avatar.test.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/components/avatar/avatar.test.tsx diff --git a/src/components/avatar/avatar.test.tsx b/src/components/avatar/avatar.test.tsx new file mode 100644 index 00000000..3f50aef8 --- /dev/null +++ b/src/components/avatar/avatar.test.tsx @@ -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(Test User); + + // ASSERT + const alert = screen.getByRole("button"); + expect(alert).toBeInTheDocument(); + expect(getByText(alert, "Te")).toBeInTheDocument(); + }); +});