33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { NEW_TAB_APPS, resolveAppUrl } from '../appSessionConfig'
|
|
|
|
describe('appSessionConfig', () => {
|
|
it('keeps new-tab apps marked on every viewport', () => {
|
|
expect(NEW_TAB_APPS.has('btcpay-server')).toBe(true)
|
|
expect(NEW_TAB_APPS.has('grafana')).toBe(true)
|
|
expect(NEW_TAB_APPS.has('vaultwarden')).toBe(true)
|
|
})
|
|
|
|
it('resolves direct app ports against the current browser host', () => {
|
|
Object.defineProperty(window, 'location', {
|
|
value: { hostname: '192.168.1.228' },
|
|
writable: true,
|
|
configurable: true,
|
|
})
|
|
|
|
expect(resolveAppUrl('mempool')).toBe('http://192.168.1.228:4080')
|
|
expect(resolveAppUrl('indeedhub')).toBe('http://192.168.1.228:7778')
|
|
expect(resolveAppUrl('saleor')).toBe('http://192.168.1.228:9011')
|
|
})
|
|
|
|
it('keeps NetBird on the unified dashboard proxy port', () => {
|
|
Object.defineProperty(window, 'location', {
|
|
value: { hostname: '192.168.1.228' },
|
|
writable: true,
|
|
configurable: true,
|
|
})
|
|
|
|
expect(resolveAppUrl('netbird', undefined, 'http://localhost:8086')).toBe('http://192.168.1.228:8087')
|
|
})
|
|
})
|