diff --git a/packages/kiwi-core/src/Grid/grid.test.js b/packages/kiwi-core/src/Grid/grid.test.js deleted file mode 100644 index ffc9fb4d..00000000 --- a/packages/kiwi-core/src/Grid/grid.test.js +++ /dev/null @@ -1,3 +0,0 @@ -it.todo('should have style property of display: grid when rendered') -it.todo('should apply gap property calues in gutter') -// ... diff --git a/packages/kiwi-core/src/Grid/test/Grid.test.js b/packages/kiwi-core/src/Grid/test/Grid.test.js new file mode 100644 index 00000000..c475166c --- /dev/null +++ b/packages/kiwi-core/src/Grid/test/Grid.test.js @@ -0,0 +1,25 @@ +import Grid from '../' +import { render } from '@/packages/kiwi-core/src/test-utils' + +const renderComponent = (props) => { + const inlineAttrs = (props && props.inlineAttrs) || '' + const base = { + components: { Grid }, + template: `Grid Me`, + ...props + } + return render(base) +} + +it('should render correctly', () => { + const { asFragment } = renderComponent() + + expect(asFragment()).toMatchSnapshot() +}) + +it('should change gap', () => { + const inlineAttrs = 'w="600px" template-columns="repeat(5, 1fr)" gap="6"' + const { asFragment } = renderComponent({ inlineAttrs }) + + expect(asFragment()).toMatchSnapshot() +}) diff --git a/packages/kiwi-core/src/Grid/test/__snapshots__/Grid.test.js.snap b/packages/kiwi-core/src/Grid/test/__snapshots__/Grid.test.js.snap new file mode 100644 index 00000000..d402e195 --- /dev/null +++ b/packages/kiwi-core/src/Grid/test/__snapshots__/Grid.test.js.snap @@ -0,0 +1,21 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should change gap 1`] = ` + +
+ Grid Me +
+
+`; + +exports[`should render correctly 1`] = ` + +
+ Grid Me +
+
+`;