mirror of
https://github.com/stablyai/orca.git
synced 2026-11-17 11:24:37 +00:00
26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
import type { Page } from '@stablyai/playwright-test'
|
||
import { expect } from '@stablyai/playwright-test'
|
||
import { getRepoExecutionHostId } from '../../../src/shared/execution-host'
|
||
import { getRepoHostIdentityForParts } from '../../../src/shared/repository/repo-host-identity'
|
||
|
||
// Dismiss every loaded repo’s setup prompt through its action; workspace switches can re-inspect and show it between visibility checks.
|
||
export async function dismissSetupScriptPrompts(page: Page): Promise<void> {
|
||
const repos = await page.evaluate(() =>
|
||
(window.__store?.getState().repos ?? []).map((repo) => ({
|
||
id: repo.id,
|
||
connectionId: repo.connectionId ?? null,
|
||
executionHostId: repo.executionHostId ?? null
|
||
}))
|
||
)
|
||
const identities = repos.map((repo) =>
|
||
getRepoHostIdentityForParts(repo.id, getRepoExecutionHostId(repo))
|
||
)
|
||
await page.evaluate((keys) => {
|
||
const state = window.__store?.getState()
|
||
for (const key of keys) {
|
||
state?.dismissSetupScriptPrompt(key)
|
||
}
|
||
}, identities)
|
||
await expect(page.locator('[data-setup-script-prompt-layer]')).toHaveCount(0)
|
||
}
|