test: fix 5 appLauncher tests for panel mode, 515/515 passing

Tests expected router.push but panel mode (now default) uses panelAppId
store state instead. Updated assertions to check panelAppId. Fixed
BTCPay app ID from 'btcpay' to 'btcpay-server'. All 515 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-18 23:27:26 +00:00
parent 002605f193
commit b28b0f335f
2 changed files with 8 additions and 8 deletions

View File

@@ -44,9 +44,9 @@ describe('useAppLauncherStore', () => {
// Port 8083 maps to /app/filebrowser/ — should route to session
store.open({ url: 'http://192.168.1.228:8083', title: 'FileBrowser' })
// Legacy overlay should NOT open — routed to session view instead
// Default panel mode: sets panelAppId, doesn't open overlay
expect(store.isOpen).toBe(false)
expect(mockPush).toHaveBeenCalledWith({ name: 'app-session', params: { appId: 'filebrowser' } })
expect(store.panelAppId).toBe('filebrowser')
expect(mockWindowOpen).not.toHaveBeenCalled()
})
@@ -56,7 +56,7 @@ describe('useAppLauncherStore', () => {
store.open({ url: 'http://192.168.1.228:23000', title: 'BTCPay' })
expect(store.isOpen).toBe(false)
expect(mockPush).toHaveBeenCalledWith({ name: 'app-session', params: { appId: 'btcpay' } })
expect(store.panelAppId).toBe('btcpay-server')
})
it('routes Home Assistant (port 8123) to full-page session', () => {
@@ -65,7 +65,7 @@ describe('useAppLauncherStore', () => {
store.open({ url: 'http://192.168.1.228:8123', title: 'Home Assistant' })
expect(store.isOpen).toBe(false)
expect(mockPush).toHaveBeenCalled()
expect(store.panelAppId).toBeTruthy()
})
it('routes Grafana (port 3000) to full-page session', () => {
@@ -74,7 +74,7 @@ describe('useAppLauncherStore', () => {
store.open({ url: 'http://192.168.1.228:3000', title: 'Grafana' })
expect(store.isOpen).toBe(false)
expect(mockPush).toHaveBeenCalled()
expect(store.panelAppId).toBeTruthy()
})
it('opens in new tab when openInNewTab flag is set for unknown URL', () => {
@@ -101,9 +101,9 @@ describe('useAppLauncherStore', () => {
store.open({ url: 'http://192.168.1.228:8083', title: 'FileBrowser' })
// Known port — routes to full-page session
// Known port — routes to session (panel mode by default)
expect(store.isOpen).toBe(false)
expect(mockPush).toHaveBeenCalledWith({ name: 'app-session', params: { appId: 'filebrowser' } })
expect(store.panelAppId).toBe('filebrowser')
})
it('opens unknown URL in iframe overlay on HTTP', () => {