import { expect } from '../../../test-utils'; import { getDashboardHost } from '../get-dashboard-host'; describe('getDashboardHost', function () { const LOCALHOST_DASHBOARD = 'http://localhost:4200'; const APP_WORKBENCH_HOST = 'https://app.workbench.rootprivatestack.com'; it('should handle localhost with port 4000', function () { const result = getDashboardHost('http://localhost:4000'); expect(result).to.equal(LOCALHOST_DASHBOARD); }); it('should handle 127.0.0.1', function () { const result = getDashboardHost('http://127.0.0.1:4000'); expect(result).to.equal(LOCALHOST_DASHBOARD); }); it('should handle https://api hosts', function () { const result = getDashboardHost('https://api.workbench.rootprivatestack.com'); expect(result).to.equal(APP_WORKBENCH_HOST); }); it('should handle https://sandbox hosts', function () { const result = getDashboardHost('https://sandbox.workbench.rootprivatestack.com'); expect(result).to.equal(APP_WORKBENCH_HOST); }); it('should handle api hosts without https prefix', function () { const result = getDashboardHost('api.workbench.rootprivatestack.com'); expect(result).to.equal(APP_WORKBENCH_HOST); }); it('should handle sandbox hosts without https prefix', function () { const result = getDashboardHost('sandbox.workbench.rootprivatestack.com'); expect(result).to.equal(APP_WORKBENCH_HOST); }); it('should return original host for unmatched patterns', function () { const result = getDashboardHost('https://custom.domain.com'); expect(result).to.equal('https://custom.domain.com'); }); });