diff --git a/spec/common/misc/utils.spec.ts b/spec/common/misc/utils.spec.ts index 13bebb31..00c0f681 100644 --- a/spec/common/misc/utils.spec.ts +++ b/spec/common/misc/utils.spec.ts @@ -58,7 +58,12 @@ describe('Utils Service', () => { expect(Utils.getDomain('localhost')).toBe('localhost'); expect(Utils.getDomain('http://localhost')).toBe('localhost'); expect(Utils.getDomain('https://localhost')).toBe('localhost'); + }); + it('should support localhost with subdomain', () => { + expect(Utils.getDomain('subdomain.localhost')).toBe('localhost'); + expect(Utils.getDomain('http://subdomain.localhost')).toBe('localhost'); + expect(Utils.getDomain('https://subdomain.localhost')).toBe('localhost'); }); it('should support IPv4', () => { @@ -127,6 +132,12 @@ describe('Utils Service', () => { expect(Utils.getHostname('https://localhost')).toBe('localhost'); }); + it('should support localhost with subdomain', () => { + expect(Utils.getHostname('subdomain.localhost')).toBe('subdomain.localhost'); + expect(Utils.getHostname('http://subdomain.localhost')).toBe('subdomain.localhost'); + expect(Utils.getHostname('https://subdomain.localhost')).toBe('subdomain.localhost'); + }); + it('should support IPv4', () => { expect(Utils.getHostname('192.168.1.1')).toBe('192.168.1.1'); expect(Utils.getHostname('http://192.168.1.1')).toBe('192.168.1.1');