Skip to content

Commit 20469a5

Browse files
committed
test(platform): read the windowed run list by row index, leave branch and iteration steps unmarked, and count the masked API key field
1 parent 287347f commit 20469a5

2 files changed

Lines changed: 20 additions & 7 deletions

File tree

‎apps/sim/platform/checks/integrations.spec.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,11 @@ test('Granola connects with its API key and keeps every template in page flow',
218218
await main.getByRole('button', { name: 'Create credential', exact: true }).click()
219219
await page.getByRole('menuitem', { name: 'Add API key', exact: true }).click()
220220
const connect = page.getByRole('dialog', { name: 'Connect Granola', exact: true })
221-
// Display name and description; the API key is a masked secret field.
222-
await expect(connect.getByRole('textbox')).toHaveCount(2)
221+
// Display name, description and the API key, which stays masked until revealed.
222+
await expect(connect.getByRole('textbox')).toHaveCount(3)
223+
await expect(connect.getByRole('textbox', { name: 'API key', exact: true })).toHaveAttribute(
224+
'data-masked'
225+
)
223226
// The catalog lists no reads for Granola's key, so the dialog has no access list to show.
224227
await expect(connect.getByRole('region', { name: 'Connection access', exact: true })).toHaveCount(
225228
0
@@ -244,7 +247,7 @@ test('Granola connects with its API key and keeps every template in page flow',
244247
page
245248
.getByRole('dialog', { name: 'Reconnect Meeting follow-ups', exact: true })
246249
.getByRole('textbox')
247-
).toHaveCount(2)
250+
).toHaveCount(3)
248251
})
249252

250253
test('shared family credential edits and access changes propagate without removing the last explicit admin', async ({

‎apps/sim/platform/checks/workspace-pages.spec.ts‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,20 @@ test('chart points open the shared tooltip by pointer and by keyboard', async ({
172172
test('long lists page quietly with edge fades only where content continues', async ({ page }) => {
173173
await page.goto(fixtureUrl('/workspace/workspace-0/logs?state=stress'))
174174
const rows = main(page).getByRole('list', { name: 'Runs' }).getByRole('listitem')
175-
await expect(rows).toHaveCount(50)
175+
// The list mounts only the rows near view; each row's `data-index` is its place among those read.
176+
const lastRead = () =>
177+
rows.evaluateAll((items) =>
178+
Math.max(-1, ...items.map((item) => Number(item.getAttribute('data-index'))))
179+
)
180+
await expect(rows.first()).toBeVisible()
181+
expect(await lastRead()).toBeLessThan(50)
176182
const region = page
177183
.locator('[data-scroll-axis="vertical"]')
178184
.filter({ has: page.locator('main:visible') })
179185
await expect(region).toHaveAttribute('data-edges', 'end')
180186
await page.mouse.move(700, 500)
181187
for (let step = 0; step < 6; step += 1) await page.mouse.wheel(0, 4000)
182-
await expect.poll(() => rows.count()).toBeGreaterThan(50)
188+
await expect.poll(lastRead).toBeGreaterThanOrEqual(50)
183189
await expect(region).toHaveAttribute('data-edges', /both|start/)
184190
await expect(main(page).getByText(/Loading|Load more/)).toHaveCount(0)
185191
})
@@ -232,7 +238,7 @@ test('a run opens its trace and selected step, with its execution ID among its f
232238
}) => {
233239
await page.goto(fixtureUrl('/workspace/it/logs?state=full'))
234240
const rows = main(page).getByRole('list', { name: 'Runs' }).getByRole('listitem')
235-
await expect(rows).toHaveCount(50)
241+
await expect(rows.nth(4)).toBeVisible()
236242
await rows.nth(4).getByRole('link').click()
237243
await expect(
238244
main(page).getByRole('heading', { level: 1, name: /^Run [0-9a-f]{8}$/ })
@@ -279,6 +285,7 @@ test('trace rows share one disclosure-to-name gap and hang guides under open par
279285
)
280286
const guide = guides.at(-1)
281287
return {
288+
name: target?.querySelector('[data-type="T060"]')?.textContent ?? '',
282289
marked: (target?.firstElementChild?.childElementCount ?? 0) > 0,
283290
gap: name && disclosure ? Math.round(name.left - disclosure.left) : null,
284291
disclosureCenter: disclosure ? disclosure.left + disclosure.width / 2 : null,
@@ -290,7 +297,10 @@ test('trace rows share one disclosure-to-name gap and hang guides under open par
290297
}
291298
})
292299
)
293-
expect(rows.every((row) => row.marked)).toBe(true)
300+
// Every step carries its mark except a parallel's branches and a loop's iterations, as legacy.
301+
expect(rows.some((row) => /^(Branch|Iteration) \d+$/.test(row.name))).toBe(true)
302+
for (const row of rows)
303+
expect(row.marked, row.name).toBe(!/^(Branch|Iteration) \d+$/.test(row.name))
294304
expect(new Set(rows.map((row) => row.gap)).size).toBe(1)
295305
for (const [index, row] of rows.entries()) {
296306
if (!row.depth) continue

0 commit comments

Comments
 (0)