Files
orca/src/shared/cloud-service-url.test.ts
T
Jinwoo Hong 74cc9b5039 feat(desktop): native mobile push integration (2/3) (#19935)
* feat(desktop): integrate native mobile push delivery and lifecycle

* fix(desktop): preserve notification replay policy and review invariants

* fix(desktop): correct notification locale namespace and auto-ack tests
2026-09-10 20:16:56 -04:00

14 lines
676 B
TypeScript

import { expect, it } from 'vitest'
import { cleanCloudServiceOrigin } from './cloud-service-url'
it.each(['ftp://localhost', 'file://localhost', 'ws://localhost', 'http://example.com'])(
'rejects %s even with the development loopback exception',
(url) => {
expect(cleanCloudServiceOrigin(url, true)).toBeNull()
}
)
it('allows HTTP only for explicitly enabled loopback development', () => {
expect(cleanCloudServiceOrigin('http://localhost:8080', true)).toBe('http://localhost:8080')
expect(cleanCloudServiceOrigin('http://localhost:8080', false)).toBeNull()
expect(cleanCloudServiceOrigin('https://push.onorca.dev', false)).toBe('https://push.onorca.dev')
})