diff --git a/__mocks__/styleMock.js b/__mocks__/styleMock.js new file mode 100644 index 00000000..f053ebf7 --- /dev/null +++ b/__mocks__/styleMock.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/package.json b/package.json index 18eef1a9..0343152d 100644 --- a/package.json +++ b/package.json @@ -81,6 +81,9 @@ "jest": { "setupFiles": [ "./src/utilities/test/jestEnzyme" - ] + ], + "moduleNameMapper": { + "\\.(css|scss|sass|styl)$": "/__mocks__/styleMock.js" + } } } diff --git a/src/ErrorLogger/__snapshots__/index.test.js.snap b/src/ErrorLogger/__snapshots__/index.test.js.snap new file mode 100644 index 00000000..31717d6d --- /dev/null +++ b/src/ErrorLogger/__snapshots__/index.test.js.snap @@ -0,0 +1,178 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` on initialization renders page correctly 1`] = ` + +`; diff --git a/src/ErrorLogger/index.js b/src/ErrorLogger/index.js index c692e441..e35642d0 100644 --- a/src/ErrorLogger/index.js +++ b/src/ErrorLogger/index.js @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import 'react-table/react-table.css'; import ReactTable from 'react-table'; +import 'react-table/react-table.css'; /** * @param {object} d diff --git a/src/ErrorLogger/index.test.js b/src/ErrorLogger/index.test.js new file mode 100644 index 00000000..57fb273b --- /dev/null +++ b/src/ErrorLogger/index.test.js @@ -0,0 +1,15 @@ +import React from 'react'; +import { shallow } from 'enzyme'; +import toJson from 'enzyme-to-json'; + +import ErrorLogger from './index'; + +describe('', () => { + describe('on initialization', () => { + it('renders page correctly', () => { + const component = shallow(); + const tree = toJson(component); + expect(tree).toMatchSnapshot(); + }); + }); +});