Skip to content

Commit ede5ffb

Browse files
committed
test(org): assert the visible description and wait for the People prefetch
1 parent ce3d8ab commit ede5ffb

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎apps/sim/scripts/org-redesign-e2e/checks/people.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ export async function peoplePhaseChecks() {
3232
if (route.request().headers()['next-router-prefetch'] === undefined) await hold.promise
3333
await route.continue()
3434
})
35-
const prefetched = page.waitForResponse(
36-
async (response) =>
37-
isPeoplePayload(new URL(response.url())) &&
38-
(await response.text().catch(() => '')).includes('Loading people')
35+
// The router can only show a loading boundary a prefetch has already delivered.
36+
const prefetched = page.waitForResponse((response) =>
37+
isPeoplePayload(new URL(response.url()))
3938
)
4039
await page.goto(orgUrl('/home'))
40+
const link = mainNav(page).getByRole('link', { name: 'People', exact: true })
41+
await link.hover()
4142
await prefetched
42-
await mainNav(page).getByRole('link', { name: 'People', exact: true }).click()
43+
await link.click()
4344
const rows = page.getByRole('status', { name: 'Loading people…' })
4445
await expect(rows).toBeVisible()
4546
const heading = await page.getByRole('heading', { name: 'People', exact: true }).boundingBox()

‎apps/sim/scripts/org-redesign-e2e/checks/settings.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ export async function settingsChecks() {
553553
)
554554
await page.goto(orgUrl('/settings/usage/events'))
555555
await expect(page.getByRole('columnheader', { name: 'Description' })).toBeVisible()
556-
await expect(page.getByText('A described charge')).toBeVisible()
556+
await expect(page.getByText('A described charge').filter({ visible: true })).toHaveCount(1)
557557
})
558558
})
559559
await check('Credential groups: a bad address leaves the valid one sent', async () => {

0 commit comments

Comments
 (0)