aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/overlay/overlay.test.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/atoms/overlay/overlay.test.tsx')
-rw-r--r--src/components/atoms/overlay/overlay.test.tsx21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/components/atoms/overlay/overlay.test.tsx b/src/components/atoms/overlay/overlay.test.tsx
new file mode 100644
index 0000000..fcc694f
--- /dev/null
+++ b/src/components/atoms/overlay/overlay.test.tsx
@@ -0,0 +1,21 @@
+import { describe, expect, it } from '@jest/globals';
+import { render, screen as screenTL } from '@testing-library/react';
+import { Overlay } from './overlay';
+
+describe('overlay', () => {
+ it('renders its children in front of an overlay', () => {
+ const body = 'perferendis voluptatibus ut';
+
+ render(<Overlay>{body}</Overlay>);
+
+ expect(screenTL.getByText(body)).toHaveClass('overlay--visible');
+ });
+
+ it('can be hidden', () => {
+ const body = 'vel aspernatur mollitia';
+
+ render(<Overlay isVisible={false}>{body}</Overlay>);
+
+ expect(screenTL.getByText(body)).toHaveClass('overlay--hidden');
+ });
+});