Skip to content

Commit b1c9548

Browse files
committed
test(org): make checks do what their names promise
1 parent a69857a commit b1c9548

1 file changed

Lines changed: 13 additions & 16 deletions

File tree

‎apps/sim/scripts/test-org-redesign-e2e.ts‎

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,14 @@ async function homeChecks() {
13941394
await expect(email.getByText('Parts recall notice')).toBeVisible()
13951395
await expect(email.getByText('Connect your email')).toHaveCount(0)
13961396
await expect(page.getByRole('region', { name: 'Calendar schedule' })).toBeVisible()
1397-
await expect(homeRegion(page, 'Calendar').getByText(/^Standup /)).toBeVisible()
1397+
const calendar = homeRegion(page, 'Calendar')
1398+
const standup = calendar.getByText(/^Standup /)
1399+
await expect(standup).toBeVisible()
1400+
const today = await standup.innerText()
1401+
await calendar.getByRole('button', { name: 'Next day', exact: true }).click()
1402+
await expect(page).toHaveURL((address) => address.searchParams.has('day'))
1403+
await expect(standup).not.toHaveText(today)
1404+
await expect(standup).toBeVisible()
13981405
})
13991406
})
14001407
await check('a member gets no Tasks run chart rather than a broken one', async () => {
@@ -1516,20 +1523,10 @@ async function homeChecks() {
15161523
})
15171524
await check('the handoff search params restore a results tab on Home', async () => {
15181525
await withSession(ADMIN, async ({ page }) => {
1519-
await page.route('**/api/knowledge/search', (route) =>
1520-
route.fulfill({
1521-
json: {
1522-
success: true,
1523-
data: {
1524-
query: 'parts',
1525-
results: [],
1526-
retrieval: { status: 'complete', timedOutLegs: [] },
1527-
},
1528-
},
1529-
})
1530-
)
1526+
await stubSearch(page)
15311527
await page.goto(orgUrl('/home?q=parts'))
15321528
await expect(composer(page)).toBeVisible()
1529+
await expect(page.getByText('Service bulletin', { exact: true }).first()).toBeVisible()
15331530
})
15341531
})
15351532
notProvable('Plan chip', 'Only for platform superusers, which needs a platform admin fixture')
@@ -1751,7 +1748,7 @@ async function searchChecks() {
17511748
await page.keyboard.press('Escape')
17521749
await links.first().focus()
17531750
await page.keyboard.press('ArrowDown')
1754-
await expect(page.locator('a[data-source-link]:focus')).toHaveCount(1)
1751+
await expect(links.nth(1)).toBeFocused()
17551752
})
17561753
})
17571754
await check('Summarize moves to Assistant and sends a turn scoped to that document', async () => {
@@ -1893,7 +1890,7 @@ async function searchChecks() {
18931890
},
18941891
{ allow: [/500 GET \/api\//] }
18951892
)
1896-
await check('New search and Search draft for a query come back on return', async () => {
1893+
await check('a query keeps its edited draft on return', async () => {
18971894
await withSession(MEMBER, async ({ page }) => {
18981895
await stubSearch(page)
18991896
await page.goto(orgUrl('/search?mode=search&q=recall'))
@@ -3231,7 +3228,7 @@ async function peoplePhaseChecks() {
32313228
await expect(page.getByRole('button', { name: /Import/ }).first()).toBeVisible()
32323229
})
32333230
})
3234-
await check('the directory lists the organization with paging', async () => {
3231+
await check('the directory lists the organization', async () => {
32353232
await withSession(MEMBER, async ({ page }) => {
32363233
await page.goto(orgUrl('/people?view=directory'))
32373234
await expect(page.getByText(ADMIN.name).first()).toBeVisible()

0 commit comments

Comments
 (0)