aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/templates/page/page-section.test.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/templates/page/page-section.test.tsx')
-rw-r--r--src/components/templates/page/page-section.test.tsx43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/components/templates/page/page-section.test.tsx b/src/components/templates/page/page-section.test.tsx
new file mode 100644
index 0000000..b372ab7
--- /dev/null
+++ b/src/components/templates/page/page-section.test.tsx
@@ -0,0 +1,43 @@
+import { describe, expect, it } from '@jest/globals';
+import { render, screen as rtlScreen } from '@testing-library/react';
+import { PageSection } from './page-section';
+
+describe('PageSection', () => {
+ it('renders its children', () => {
+ const body = 'a voluptas iste';
+
+ render(<PageSection>{body}</PageSection>);
+
+ expect(rtlScreen.getByText(body)).toBeInTheDocument();
+ });
+
+ it('can use the light variant', () => {
+ const body = 'a voluptas iste';
+
+ render(<PageSection variant="light">{body}</PageSection>);
+
+ expect(rtlScreen.getByText(body).parentElement).toHaveClass(
+ 'section--light'
+ );
+ });
+
+ it('can use the dark variant', () => {
+ const body = 'a voluptas iste';
+
+ render(<PageSection variant="dark">{body}</PageSection>);
+
+ expect(rtlScreen.getByText(body).parentElement).toHaveClass(
+ 'section--dark'
+ );
+ });
+
+ it('can have a border at the bottom', () => {
+ const body = 'a voluptas iste';
+
+ render(<PageSection hasBorder>{body}</PageSection>);
+
+ expect(rtlScreen.getByText(body).parentElement).toHaveClass(
+ 'section--bordered'
+ );
+ });
+});