From 4e483dc5d4a93c157861b5903601ec02cd1e1a79 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 10 May 2020 20:30:19 +0200 Subject: [PATCH] Created TagVisits test --- test/visits/TagVisits.test.js | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 test/visits/TagVisits.test.js diff --git a/test/visits/TagVisits.test.js b/test/visits/TagVisits.test.js new file mode 100644 index 00000000..8a871dae --- /dev/null +++ b/test/visits/TagVisits.test.js @@ -0,0 +1,44 @@ +import React from 'react'; +import { shallow } from 'enzyme'; +import { identity } from 'ramda'; +import createTagVisits from '../../src/visits/TagVisits'; +import TagVisitsHeader from '../../src/visits/TagVisitsHeader'; + +describe('', () => { + let wrapper; + const getTagVisitsMock = jest.fn(); + const match = { + params: { tag: 'foo' }, + }; + const history = { + goBack: jest.fn(), + }; + const realTimeUpdates = { enabled: true }; + const VisitsStats = jest.fn(); + + beforeEach(() => { + const TagVisits = createTagVisits(VisitsStats, {}); + + wrapper = shallow( + + ); + }); + + afterEach(() => wrapper.unmount()); + afterEach(jest.resetAllMocks); + + it('renders visit stats and visits header', () => { + const visitStats = wrapper.find(VisitsStats); + const visitHeader = wrapper.find(TagVisitsHeader); + + expect(visitStats).toHaveLength(1); + expect(visitHeader).toHaveLength(1); + }); +});