test: await scoped GitLab preflight before URL transition checks

This commit is contained in:
Neil
2026-09-05 14:05:36 -07:00
parent f67b004653
commit 77b99120cc
@@ -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 })
})
}