()
| 66 | |
| 67 | it('accepts a dispatch function in options', () => { |
| 68 | function TestOptions() { |
| 69 | const { trackEvent } = useTracking(testDataContext, { dispatch }); |
| 70 | |
| 71 | const blah = () => { |
| 72 | trackEvent(testData); |
| 73 | }; |
| 74 | |
| 75 | blah(); |
| 76 | return <div />; |
| 77 | } |
| 78 | |
| 79 | mount(<TestOptions />); |
| 80 | |
| 81 | expect(dispatchTrackingEvent).not.toHaveBeenCalled(); |
| 82 | expect(dispatch).toHaveBeenCalledWith({ |
| 83 | ...testDataContext, |
| 84 | ...testData, |
| 85 | }); |
| 86 | }); |
| 87 | |
| 88 | it('will use dispatch fn passed in from further up in context', () => { |
| 89 | const testChildData = { page: 'TestChild' }; |
nothing calls this directly
no test coverage detected
searching dependent graphs…