feat(release): stage GitWorkshop and next node updates
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import { describe, it, expect, afterEach } from 'vitest'
|
||||
import { isCompanionApp } from '../openExternal'
|
||||
import { describe, it, expect, afterEach, vi } from 'vitest'
|
||||
import {
|
||||
installCertificateInCompanion,
|
||||
isCompanionApp,
|
||||
openInAppOrNewTab,
|
||||
} from '../openExternal'
|
||||
|
||||
// isCompanionApp() is the single companion-detection source used to skip the
|
||||
// demo intro (App.vue + RootRedirect.vue) and by appLauncher — it must be true
|
||||
@@ -26,4 +30,21 @@ describe('isCompanionApp', () => {
|
||||
w.ArchipelagoNative = { openExternal: () => {} }
|
||||
expect(isCompanionApp()).toBe(false)
|
||||
})
|
||||
|
||||
it('absolutizes same-origin paths before handing them to the native WebView', () => {
|
||||
const openInApp = vi.fn()
|
||||
w.ArchipelagoNative = { openInApp }
|
||||
|
||||
openInAppOrNewTab('/app/archipelago-source/')
|
||||
|
||||
expect(openInApp).toHaveBeenCalledWith(`${window.location.origin}/app/archipelago-source/`)
|
||||
})
|
||||
|
||||
it('hands a certificate to the native installer when available', () => {
|
||||
const installNodeCertificate = vi.fn()
|
||||
w.ArchipelagoNative = { openInApp: () => {}, installNodeCertificate }
|
||||
|
||||
expect(installCertificateInCompanion()).toBe(true)
|
||||
expect(installNodeCertificate).toHaveBeenCalledOnce()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user