Visitar URL original
fix(desktop): hold the GitHub credential check open while the e2e asserts its pending state by waleedlatif1 · Pull Request #9420 · simstudioai/sim · GitHub
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(desktop): hold the GitHub credential check open while the e2e ass…
…erts its pending state
  • Loading branch information
waleedlatif1 committed Oct 28, 2026
commit 5c9bf11be74307e7c1e5bfa586daf5e60e65222e
24 changes: 17 additions & 7 deletions apps/desktop/e2e/source-connect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ test('source authorization returns to its desktop screen and refreshes live', as
const githubStartSessions: string[] = []
const githubInventorySessions: string[] = []
let nativeCredentialVisible = false
let githubInventoryHold: Promise<void> | undefined
let installed = false
let holdSlackStart = false
let canceledSlackRequests = 0
Expand Down Expand Up @@ -304,7 +305,7 @@ test('source authorization returns to its desktop screen and refreshes live', as
}
if (path === '/api/organization-credentials/oauth') {
githubInventorySessions.push(session)
await sleep(500)
await githubInventoryHold
json({
credentials: nativeCredentialVisible
? [
Expand Down Expand Up @@ -545,12 +546,21 @@ test('source authorization returns to its desktop screen and refreshes live', as
await expect(page.getByLabel('GitHub error')).toContainText('not available')
await expect(page.getByLabel('GitHub credential')).toHaveText('')
nativeCredentialVisible = true
await page.getByRole('button', { name: 'Connect GitHub' }).click()
await expect.poll(async () => (await opened()).length).toBe(6)
await external.goto((await opened())[5])
await external.getByRole('link', { name: 'Authorize GitHub' }).click()
await expect.poll(() => githubInventorySessions.length).toBe(2)
await expect(page.getByLabel('GitHub pending')).toHaveText('true')
let releaseGithubInventory = () => {}
githubInventoryHold = new Promise<void>((resolve) => {
releaseGithubInventory = resolve
})
try {
await page.getByRole('button', { name: 'Connect GitHub' }).click()
await expect.poll(async () => (await opened()).length).toBe(6)
await external.goto((await opened())[5])
await external.getByRole('link', { name: 'Authorize GitHub' }).click()
await expect.poll(() => githubInventorySessions.length).toBe(2)
await expect(page.getByLabel('GitHub pending')).toHaveText('true')
} finally {
githubInventoryHold = undefined
releaseGithubInventory()
}
await expect(page.getByLabel('GitHub credential')).toHaveText('fixture-github-credential')
expect(githubStartSessions).toEqual(['browser-fixture', 'browser-fixture'])
expect(githubInventorySessions).toEqual(['desktop-fixture', 'desktop-fixture'])
Expand Down
Loading