diff --git a/__tests__/components/search/Input.test.tsx b/__tests__/components/search/Input.test.tsx new file mode 100644 index 00000000..111b6986 --- /dev/null +++ b/__tests__/components/search/Input.test.tsx @@ -0,0 +1,18 @@ +import React from 'react' +import { render } from '@testing-library/react' +import renderer from 'react-test-renderer' +import Input from '../../../components/search/Input' + +test('📸 of Input component with empty', () => { + const query = {} + const tree = renderer.create().toJSON() + expect(tree).toMatchSnapshot() +}) + +test('📸 of Input component with query', () => { + const query = { + q: 'gdp' + } + const tree = renderer.create().toJSON() + expect(tree).toMatchSnapshot() +}) diff --git a/__tests__/components/search/Item.test.tsx b/__tests__/components/search/Item.test.tsx deleted file mode 100644 index cda1194c..00000000 --- a/__tests__/components/search/Item.test.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react' -import { render } from '@testing-library/react' -import renderer from 'react-test-renderer' -import Item from '../../../components/search/Item' - -test('📸 of Item component', () => { - const datapackage = { - name: 'test', - title: 'Title', - description: 'A description.', - organization: { - title: 'test org', - name: 'test-org' - } - } - const tree = renderer.create().toJSON() - expect(tree).toMatchSnapshot() -}) diff --git a/__tests__/components/search/List.test.tsx b/__tests__/components/search/List.test.tsx new file mode 100644 index 00000000..3a47743c --- /dev/null +++ b/__tests__/components/search/List.test.tsx @@ -0,0 +1,20 @@ +import React from 'react' +import { render } from '@testing-library/react' +import renderer from 'react-test-renderer' +import List from '../../../components/search/List' + +test('📸 of Input component with empty', () => { + const datapackages = [ + { + name: 'test', + title: 'Title', + description: 'A description.', + organization: { + title: 'test org', + name: 'test-org' + } + } + ] + const tree = renderer.create().toJSON() + expect(tree).toMatchSnapshot() +}) diff --git a/__tests__/components/search/Sort.test.tsx b/__tests__/components/search/Sort.test.tsx new file mode 100644 index 00000000..179811fe --- /dev/null +++ b/__tests__/components/search/Sort.test.tsx @@ -0,0 +1,9 @@ +import React from 'react' +import { render } from '@testing-library/react' +import renderer from 'react-test-renderer' +import Sort from '../../../components/search/Sort' + +test('📸 of Input component with empty', () => { + const tree = renderer.create().toJSON() + expect(tree).toMatchSnapshot() +}) diff --git a/__tests__/components/search/__snapshots__/Input.test.tsx.snap b/__tests__/components/search/__snapshots__/Input.test.tsx.snap new file mode 100644 index 00000000..b8e409a6 --- /dev/null +++ b/__tests__/components/search/__snapshots__/Input.test.tsx.snap @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`📸 of Input component with empty 1`] = ` +
+ + +
+`; + +exports[`📸 of Input component with query 1`] = ` +
+ + +
+`; diff --git a/__tests__/components/search/__snapshots__/Item.test.tsx.snap b/__tests__/components/search/__snapshots__/Item.test.tsx.snap deleted file mode 100644 index 12170243..00000000 --- a/__tests__/components/search/__snapshots__/Item.test.tsx.snap +++ /dev/null @@ -1,33 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`📸 of Item component 1`] = ` -
-

- - Title - -

- - test org - -
- A description. -
-
-`; diff --git a/__tests__/components/search/__snapshots__/List.test.tsx.snap b/__tests__/components/search/__snapshots__/List.test.tsx.snap new file mode 100644 index 00000000..452ebe70 --- /dev/null +++ b/__tests__/components/search/__snapshots__/List.test.tsx.snap @@ -0,0 +1,35 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`📸 of Input component with empty 1`] = ` + +`; diff --git a/__tests__/components/search/__snapshots__/Sort.test.tsx.snap b/__tests__/components/search/__snapshots__/Sort.test.tsx.snap new file mode 100644 index 00000000..44dbe74d --- /dev/null +++ b/__tests__/components/search/__snapshots__/Sort.test.tsx.snap @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`📸 of Input component with empty 1`] = ` +
+ + +
+`; diff --git a/__tests__/pages/__snapshots__/index.test.tsx.snap b/__tests__/pages/__snapshots__/index.test.tsx.snap index b65c9a23..8f1a5aa8 100644 --- a/__tests__/pages/__snapshots__/index.test.tsx.snap +++ b/__tests__/pages/__snapshots__/index.test.tsx.snap @@ -1,24 +1,27 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`📸 of Home page 1`] = ` -Array [ +
, +
- -
-

Find, Share and Publish
@@ -95,23 +84,126 @@ Array [

At Datahub, we have over thousands of datasets for free and a Premium Data Service for additional or customised data with guaranteed updates.

+
-
, -] +
+ +
+ +
+

+ Recent Datasets +

+
+
+

+ Our World in Data - COVID 19 +

+

+ Dataset +

+

+ data collected and managed by Our World in Data - COVID 19 pulled from GitHub on 06/10/2020 https://ourworldindata.org/coronavirus +

+ + View Dataset + +
+
+

+ Our World in Data - COVID 19 +

+

+ Dataset +

+

+ data collected and managed by Our World in Data - COVID 19 pulled from GitHub on 06/10/2020 https://ourworldindata.org/coronavirus +

+ + View Dataset + +
+
+

+ Our World in Data - COVID 19 +

+

+ Dataset +

+

+ data collected and managed by Our World in Data - COVID 19 pulled from GitHub on 06/10/2020 https://ourworldindata.org/coronavirus +

+ + View Dataset + +
+
+
+
`;