Browse Source

Tests for Loading

Kirk Trombley 5 years ago
parent
commit
1e3b9935e4

+ 1 - 0
client/package.json

@@ -16,6 +16,7 @@
     "build": "react-scripts build",
     "test": "react-scripts test",
     "test:ci": "CI=true yarn test",
+    "test:cov": "yarn test --coverage --watchAll=false",
     "eject": "react-scripts eject",
     "deploy": "scp -r build hiram:/opt/terrassumptions/srv/build-$(date +'%Y-%m-%dT%H:%M:%S')"
   },

+ 10 - 0
client/src/components/util/__tests__/Loading.test.js

@@ -0,0 +1,10 @@
+import React from 'react';
+import { shallow } from 'enzyme';
+import Loading from '../Loading';
+
+describe('Loading icon', () => {
+  it('renders', () => {
+    const loading = shallow(<Loading />);
+    expect(loading).toMatchSnapshot();
+  })
+})

+ 12 - 0
client/src/components/util/__tests__/__snapshots__/Loading.test.js.snap

@@ -0,0 +1,12 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Loading icon renders 1`] = `
+<div
+  className="loading"
+>
+  <div />
+  <div />
+  <div />
+  <div />
+</div>
+`;