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';
import { shallow } from 'enzyme';
import * as UtilMethods from 'ducks/utilMethods';
import { updateSearchState } from 'ducks/search/reducer';
import { mapDispatchToProps, TagInfo, TagInfoProps } from '.';
const logClickSpy = jest.spyOn(UtilMethods, 'logClick');
logClickSpy.mockImplementation(() => null);
jest.mock('ducks/search/reducer', () => ({
updateSearchState: jest.fn(),
}));
describe('TagInfo', () => {
const setup = (propOverrides?: Partial<TagInfoProps>) => {
const props = {
......@@ -109,7 +115,8 @@ describe('mapDispatchToProps', () => {
result = mapDispatchToProps(dispatch);
});
it('sets searchTag on the props', () => {
expect(result.searchTag).toBeInstanceOf(Function);
it('sets searchTag on the props to trigger desired action', () => {
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