import HelpScout from './HelpScout' describe('HelpScout', () => { describe('getInstallationIds', () => { it('should return single installation ID from window.name', () => { window.name = 'app-aGsdsa556AD' const result = new HelpScout().getInstallationIds() expect(result).toEqual(['aGsdsa556AD']) }) it('should return multiple installation IDs from window.name', () => { window.name = 'app-aGsdsa556AD-JHGF65hgjGH' const result = new HelpScout().getInstallationIds() expect(result).toEqual(['aGsdsa556AD', 'JHGF65hgjGH']) }) it('should return empty array when no ID in window.name', () => { window.name = 'app-' const result = new HelpScout().getInstallationIds() expect(result).toEqual([]) }) it('should return empty array when window.name has no "app-" prefix', () => { window.name = 'something else' const result = new HelpScout().getInstallationIds() expect(result).toEqual([]) }) }) })