mirror of
https://github.com/stablyai/orca.git
synced 2026-10-01 08:01:56 +00:00
test: await scoped GitLab preflight before URL transition checks
This commit is contained in:
@@ -203,6 +203,12 @@ async function installHeldGitLabLookup(
|
||||
__releaseGitLabUrlLookup?: () => void
|
||||
}
|
||||
fixture.__gitlabUrlLookupStarted = false
|
||||
ipcMain.removeHandler('preflight:check')
|
||||
ipcMain.handle('preflight:check', () => ({
|
||||
git: { installed: true },
|
||||
gh: { installed: true, authenticated: true },
|
||||
glab: { installed: true, authenticated: true }
|
||||
}))
|
||||
ipcMain.removeHandler('gitlab:listMRs')
|
||||
ipcMain.handle('gitlab:listMRs', () => ({
|
||||
items: [wrongItem],
|
||||
@@ -221,23 +227,12 @@ async function installHeldGitLabLookup(
|
||||
},
|
||||
{ wrongItem: GITLAB_WRONG_ITEM, targetItem: GITLAB_TARGET_ITEM }
|
||||
)
|
||||
await page.evaluate(() => {
|
||||
await page.evaluate(async () => {
|
||||
const store = window.__store
|
||||
if (!store) {
|
||||
throw new Error('window.__store is not available')
|
||||
}
|
||||
const state = store.getState()
|
||||
if (!state.preflightStatusContextKey) {
|
||||
throw new Error('preflight context is not ready')
|
||||
}
|
||||
store.setState({
|
||||
preflightStatus: {
|
||||
git: state.preflightStatus?.git ?? { installed: true },
|
||||
gh: state.preflightStatus?.gh ?? { installed: true, authenticated: true },
|
||||
glab: { installed: true, authenticated: true }
|
||||
},
|
||||
preflightStatusChecked: true
|
||||
})
|
||||
await store.getState().refreshPreflightStatus({ force: true })
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user