feat: Add chatwoot:ready event listener on window (#1091)

* feat: Add `chatwoot:ready` event listener on window

* Add specs

* Rename customEventHelper.js -> CustomEventHelper.js
This commit is contained in:
Pranav Raj S 2020-07-25 21:54:58 +05:30 committed by GitHub
parent 80b083c7fc
commit 12ee7e5d82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 0 deletions

View file

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