diff --git a/src/__tests__/components/TravelTimer.test.js b/src/__tests__/components/TravelTimer.test.js new file mode 100644 index 0000000..f529e91 --- /dev/null +++ b/src/__tests__/components/TravelTimer.test.js @@ -0,0 +1,25 @@ +import { customRender } from '../../test-utils' +import TravelTimer from '../../components/TravelTimer' +import { defaultState } from '../../fixtures' + +const customState = { + ...defaultState, + ship: { + ...defaultState.ship, + destination: { + name: 'Test Planet 2', + value: 50 + }, + isShipTraveling: true + } +} + +describe('', () => { + it('Should render the component.', () => { + const container = customRender({ + component: TravelTimer, + state: customState + }) + expect(container.asFragment()).toMatchSnapshot() + }) +}) diff --git a/src/__tests__/components/__snapshots__/TravelTimer.test.js.snap b/src/__tests__/components/__snapshots__/TravelTimer.test.js.snap new file mode 100644 index 0000000..4f3fdef --- /dev/null +++ b/src/__tests__/components/__snapshots__/TravelTimer.test.js.snap @@ -0,0 +1,18 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` Should render the component. 1`] = ` + +
+

+ Travel Timer +

+ + 8 minutes 20 seconds + +
+
+`;