diff --git a/test/visits/TagVisitsHeader.test.js b/test/visits/TagVisitsHeader.test.js new file mode 100644 index 00000000..d35d3b50 --- /dev/null +++ b/test/visits/TagVisitsHeader.test.js @@ -0,0 +1,33 @@ +import React from 'react'; +import { shallow } from 'enzyme'; +import Tag from '../../src/tags/helpers/Tag'; +import TagVisitsHeader from '../../src/visits/TagVisitsHeader'; + +describe('', () => { + let wrapper; + const tagVisits = { + tag: 'foo', + visits: [{}, {}, {}], + }; + const goBack = jest.fn(); + + beforeEach(() => { + wrapper = shallow( + + ); + }); + afterEach(() => wrapper.unmount()); + + it('shows expected visits', () => { + expect(wrapper.prop('visits')).toEqual(tagVisits.visits); + }); + + it('shows title for tag', () => { + const title = shallow(wrapper.prop('title')); + const tag = title.find(Tag).first(); + + expect(tag.prop('text')).toEqual(tagVisits.tag); + + title.unmount(); + }); +});