From 5ed363146fa5532e711678dc6e3ba0ce7966ae4f Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Fri, 17 Mar 2023 23:05:30 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Add=20test=20for=20AppAvatar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AppAvatar.test.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/components/AppAvatar.test.tsx diff --git a/src/components/AppAvatar.test.tsx b/src/components/AppAvatar.test.tsx new file mode 100644 index 000000000..b5cb29eaf --- /dev/null +++ b/src/components/AppAvatar.test.tsx @@ -0,0 +1,16 @@ +import { render } from '@testing-library/react'; +import { describe, expect, it } from 'vitest'; +import { AppAvatar } from './AppAvatar'; + +describe(AppAvatar.name, () => { + it.concurrent('display placeholder when no url', () => { + const { container } = render(); + + expect(container.firstElementChild).not.toBeNull(); + expect(container.firstElementChild!.className).contain('mantine-Avatar-root'); + + const svgElement = container.querySelector('svg'); + expect(svgElement).not.toBeNull(); + expect(svgElement?.getAttribute('fill')).not.toBeNull(); + }); +});