import { isAllowedOrigin } from './index' describe('utils', () => { describe('isAllowedOrigin()', () => { it('should return true for full URL matches', () => { expect(isAllowedOrigin('https://hs-app.local.hsenv.io')).toBeTruthy() }) it('should return true for origin matches', () => { expect( isAllowedOrigin( 'https://hs-app.local.hsenv.io/conversation/123/456?folderId=789' ) ).toBeTruthy() }) it('should return false for different origin', () => { expect(isAllowedOrigin('https://www.example.test/something')).toBeFalsy() }) it('should return true for regex matches (cloud stack envs)', () => { expect(isAllowedOrigin('https://hs-app.abc123.hsenv.io/aaa')).toBeTruthy() }) it('should return true for production origin', () => { expect(isAllowedOrigin('https://secure.helpscout.net/aaa')).toBeTruthy() }) }) })