mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-04 13:07:55 +00:00 
			
		
		
		
	* feat: Add `chatwoot:ready` event listener on window * Add specs * Rename customEventHelper.js -> CustomEventHelper.js
		
			
				
	
	
		
			10 lines
		
	
	
		
			279 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			10 lines
		
	
	
		
			279 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import { dispatchWindowEvent } from '../CustomEventHelper';
 | 
						|
 | 
						|
describe('dispatchWindowEvent', () => {
 | 
						|
  it('dispatches correct event', () => {
 | 
						|
    window.dispatchEvent = jest.fn();
 | 
						|
    dispatchWindowEvent('chatwoot:ready');
 | 
						|
    expect(dispatchEvent).toHaveBeenCalled();
 | 
						|
  });
 | 
						|
});
 |