Files
hapi/e2e/session-mention-groups.spec.ts
T
KiyoshiandGitHub 49c22d73a1 feat(web): group and collapse inactive session mentions (#2271)
* feat(web): filter session mentions to active sessions

* feat(web): group and collapse inactive session mentions
2026-11-04 15:58:01 +08:00

31 lines
1.8 KiB
TypeScript

import { expect, test } from '@playwright/test'
test('groups mentions, toggles inactive sessions with keyboard, and remembers the choice', async ({ page }) => {
await page.goto('/e2e-fixtures/mention-groups-fixture.html')
const callout = page.getByRole('button', { name: 'Got it' })
if (await callout.isVisible()) await callout.click()
const input = page.getByRole('textbox').first()
await input.fill('@')
await expect(page.getByRole('button', { name: /@Project archived/ })).toBeVisible()
await input.fill('@project')
await expect(page.getByRole('button', { name: /@Project active/ })).toBeVisible()
const toggle = page.getByRole('button', { name: 'Inactive sessions' })
await expect(toggle).toHaveAttribute('aria-expanded', 'true')
await expect(page.getByRole('button', { name: /@Project archived/ })).toBeVisible()
await expect(page.getByRole('button', { name: '@project.ts' })).toBeVisible()
await input.press('ArrowDown')
await input.press('Enter')
await expect(toggle).toHaveAttribute('aria-expanded', 'false')
await expect(page.getByRole('button', { name: /@Project archived/ })).toHaveCount(0)
await expect(page.getByRole('button', { name: '@project.ts' })).toBeVisible()
await expect(input).toHaveText('@project')
await page.reload()
const reloadedInput = page.getByRole('textbox').first()
await reloadedInput.fill('@project')
await expect(page.getByRole('button', { name: 'Inactive sessions' })).toHaveAttribute('aria-expanded', 'false')
await page.getByRole('button', { name: 'Inactive sessions' }).click()
await expect(page.getByRole('button', { name: /@Project archived/ })).toBeVisible()
await page.getByRole('button', { name: /@Project archived/ }).click()
await expect(reloadedInput).toContainText('@Project archived')
})