Unverified Commit e186227b authored by Tamika Tannis's avatar Tamika Tannis Committed by GitHub

Update a test (#525)

parent 94330854
...@@ -5,11 +5,17 @@ import * as React from 'react'; ...@@ -5,11 +5,17 @@ import * as React from 'react';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import * as UtilMethods from 'ducks/utilMethods'; import * as UtilMethods from 'ducks/utilMethods';
import { updateSearchState } from 'ducks/search/reducer';
import { mapDispatchToProps, TagInfo, TagInfoProps } from '.'; import { mapDispatchToProps, TagInfo, TagInfoProps } from '.';
const logClickSpy = jest.spyOn(UtilMethods, 'logClick'); const logClickSpy = jest.spyOn(UtilMethods, 'logClick');
logClickSpy.mockImplementation(() => null); logClickSpy.mockImplementation(() => null);
jest.mock('ducks/search/reducer', () => ({
updateSearchState: jest.fn(),
}));
describe('TagInfo', () => { describe('TagInfo', () => {
const setup = (propOverrides?: Partial<TagInfoProps>) => { const setup = (propOverrides?: Partial<TagInfoProps>) => {
const props = { const props = {
...@@ -109,7 +115,8 @@ describe('mapDispatchToProps', () => { ...@@ -109,7 +115,8 @@ describe('mapDispatchToProps', () => {
result = mapDispatchToProps(dispatch); result = mapDispatchToProps(dispatch);
}); });
it('sets searchTag on the props', () => { it('sets searchTag on the props to trigger desired action', () => {
expect(result.searchTag).toBeInstanceOf(Function); result.searchTag();
expect(updateSearchState).toHaveBeenCalled();
}); });
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment