aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/layout/widget.test.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/molecules/layout/widget.test.tsx')
-rw-r--r--src/components/molecules/layout/widget.test.tsx19
1 files changed, 19 insertions, 0 deletions
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);
+ });
+});