From ddb6127519e8d13f15444b913531e199bf9db237 Mon Sep 17 00:00:00 2001 From: Paul Armstrong Date: Tue, 9 Feb 2021 20:13:19 -0800 Subject: [PATCH] test(web): add ActivityIndicator test --- .../__tests__/ActivityIndicator.test.jsx | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 web/src/components/__tests__/ActivityIndicator.test.jsx diff --git a/web/src/components/__tests__/ActivityIndicator.test.jsx b/web/src/components/__tests__/ActivityIndicator.test.jsx new file mode 100644 index 000000000..582be24af --- /dev/null +++ b/web/src/components/__tests__/ActivityIndicator.test.jsx @@ -0,0 +1,47 @@ +import { h } from 'preact'; +import ActivityIndicator from '../ActivityIndicator'; +import { render, screen } from '@testing-library/preact'; + +describe('ActivityIndicator', () => { + test('renders an ActivityIndicator with default size md', async () => { + render(); + expect(screen.getByLabelText('Loading…')).toMatchInlineSnapshot(` +
+
+
+ `); + }); + + test('renders an ActivityIndicator with size sm', async () => { + render(); + expect(screen.getByLabelText('Loading…')).toMatchInlineSnapshot(` +
+
+
+ `); + }); + + test('renders an ActivityIndicator with size lg', async () => { + render(); + expect(screen.getByLabelText('Loading…')).toMatchInlineSnapshot(` +
+
+
+ `); + }); +});