From b29a54298dea6d8732391586031f1f527ce2f783 Mon Sep 17 00:00:00 2001 From: sowmya-AS <76809502+sowmya-AS@users.noreply.github.com> Date: Tue, 31 Oct 2023 20:19:57 +0530 Subject: [PATCH] test : Adds test for Divider and GridFluid component (#127) Co-authored-by: sowmya198 --- .../Divider/__snapshots__/test.tsx.snap | 15 +++++++++++++++ src/packages/Divider/test.tsx | 11 +++++++++++ .../GridFluid/__snapshots__/test.tsx.snap | 18 ++++++++++++++++++ src/packages/GridFluid/test.tsx | 15 +++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 src/packages/Divider/__snapshots__/test.tsx.snap create mode 100644 src/packages/Divider/test.tsx create mode 100644 src/packages/GridFluid/__snapshots__/test.tsx.snap create mode 100644 src/packages/GridFluid/test.tsx diff --git a/src/packages/Divider/__snapshots__/test.tsx.snap b/src/packages/Divider/__snapshots__/test.tsx.snap new file mode 100644 index 0000000..b53a79d --- /dev/null +++ b/src/packages/Divider/__snapshots__/test.tsx.snap @@ -0,0 +1,15 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` should render Divider correctly 1`] = ` +.c0 { + height: 0.01rem; + background: #808080; + border: 0; +} + +
+
+
+`; diff --git a/src/packages/Divider/test.tsx b/src/packages/Divider/test.tsx new file mode 100644 index 0000000..fb633bb --- /dev/null +++ b/src/packages/Divider/test.tsx @@ -0,0 +1,11 @@ +import React from 'react' +import { render } from '../../utils/testUtils' + +import Divider from '.' + +describe('', () => { + it('should render Divider correctly', () => { + const { container } = render() + expect(container).toMatchSnapshot() + }) +}) diff --git a/src/packages/GridFluid/__snapshots__/test.tsx.snap b/src/packages/GridFluid/__snapshots__/test.tsx.snap new file mode 100644 index 0000000..5bfbf4a --- /dev/null +++ b/src/packages/GridFluid/__snapshots__/test.tsx.snap @@ -0,0 +1,18 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` should render GridFluid correctly with children 1`] = ` +.c0 { + grid-column: 1/4; + width: 100%; +} + +
+
+
+ GridFluid +
+
+
+`; diff --git a/src/packages/GridFluid/test.tsx b/src/packages/GridFluid/test.tsx new file mode 100644 index 0000000..9892417 --- /dev/null +++ b/src/packages/GridFluid/test.tsx @@ -0,0 +1,15 @@ +import React from 'react' +import { render } from '../../utils/testUtils' + +import GridFluid from '.' + +describe('', () => { + it('should render GridFluid correctly with children', () => { + const { container } = render( + +
GridFluid
+
+ ) + expect(container).toMatchSnapshot() + }) +})