mirror of
https://github.com/stablyai/orca
synced 2026-04-21 14:17:16 +00:00
fix: update tests for Safari/Firefox browser detection and ZDOTDIR (#788)
This commit is contained in:
parent
68e3a00ddf
commit
be7ee2fc38
2 changed files with 13 additions and 3 deletions
|
|
@ -217,14 +217,17 @@ describe('detectInstalledBrowsers', () => {
|
|||
expect(browser).toHaveProperty('family')
|
||||
expect(browser).toHaveProperty('label')
|
||||
expect(browser).toHaveProperty('cookiesPath')
|
||||
expect(browser).toHaveProperty('keychainService')
|
||||
expect(browser).toHaveProperty('keychainAccount')
|
||||
// keychainService/keychainAccount are only present for Chromium-based browsers
|
||||
if (['chrome', 'edge', 'arc', 'chromium'].includes(browser.family)) {
|
||||
expect(browser).toHaveProperty('keychainService')
|
||||
expect(browser).toHaveProperty('keychainAccount')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
it('each detected browser has a valid family', () => {
|
||||
const browsers = detectInstalledBrowsers()
|
||||
const validFamilies = ['chrome', 'edge', 'arc', 'chromium']
|
||||
const validFamilies = ['chrome', 'edge', 'arc', 'chromium', 'firefox', 'safari']
|
||||
for (const browser of browsers) {
|
||||
expect(validFamilies).toContain(browser.family)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -493,12 +493,14 @@ describe('registerPtyHandlers', () => {
|
|||
it('spawns a plain POSIX login shell and queues startup commands for the live session', () => {
|
||||
const originalPlatform = process.platform
|
||||
const originalShell = process.env.SHELL
|
||||
const originalZdotdir = process.env.ZDOTDIR
|
||||
|
||||
Object.defineProperty(process, 'platform', {
|
||||
configurable: true,
|
||||
value: 'darwin'
|
||||
})
|
||||
process.env.SHELL = '/bin/zsh'
|
||||
delete process.env.ZDOTDIR
|
||||
|
||||
try {
|
||||
const [shell, args, options] = spawnAndGetCall({ cwd: '/tmp', command: 'printf "hello"' })
|
||||
|
|
@ -516,6 +518,11 @@ describe('registerPtyHandlers', () => {
|
|||
} else {
|
||||
process.env.SHELL = originalShell
|
||||
}
|
||||
if (originalZdotdir === undefined) {
|
||||
delete process.env.ZDOTDIR
|
||||
} else {
|
||||
process.env.ZDOTDIR = originalZdotdir
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue