From 6ec16bc15cc78e62cb94e131699625fa5363437c Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 15 Apr 2022 15:34:21 +0200
Subject: chore: add a Widget component

---
 src/components/molecules/layout/widget.test.tsx | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 src/components/molecules/layout/widget.test.tsx

(limited to 'src/components/molecules/layout/widget.test.tsx')

diff --git a/src/components/molecules/layout/widget.test.tsx b/src/components/molecules/layout/widget.test.tsx
new file mode 100644
index 0000000..af561ea
--- /dev/null
+++ b/src/components/molecules/layout/widget.test.tsx
@@ -0,0 +1,19 @@
+import { render, screen } from '@test-utils';
+import Widget from './widget';
+
+const children = 'Widget body';
+const title = 'Widget title';
+const titleLevel = 2;
+
+describe('Widget', () => {
+  it('renders the widget title', () => {
+    render(
+      <Widget expanded={true} title={title} level={titleLevel}>
+        {children}
+      </Widget>
+    );
+    expect(
+      screen.getByRole('heading', { level: titleLevel })
+    ).toHaveTextContent(title);
+  });
+});
-- 
cgit v1.2.3

