Chatwoot/app/javascript/shared/helpers/specs/CustomEventHelper.spec.js
Pranav Raj S 12ee7e5d82
feat: Add chatwoot:ready event listener on window (#1091)
* feat: Add `chatwoot:ready` event listener on window

* Add specs

* Rename customEventHelper.js -> CustomEventHelper.js
2020-07-25 21:54:58 +05:30

9 lines
279 B
JavaScript

import { dispatchWindowEvent } from '../CustomEventHelper';
describe('dispatchWindowEvent', () => {
it('dispatches correct event', () => {
window.dispatchEvent = jest.fn();
dispatchWindowEvent('chatwoot:ready');
expect(dispatchEvent).toHaveBeenCalled();
});
});