test(e2e): await DELETE in session revoke test to avoid race

This commit is contained in:
kolaente 2026-04-21 12:26:39 +02:00 committed by kolaente
parent c0101afb59
commit be28ec70d8
1 changed files with 4 additions and 0 deletions

View File

@ -35,7 +35,11 @@ test.describe('Sessions', () => {
await gotoUserSettings(page, 'sessions')
await page.locator('tr', {hasText: /192\.0\.2\.5/})
.getByRole('button', {name: 'Delete'}).click()
const deleted = page.waitForResponse(r =>
/\/user\/sessions\/[^/]+/.test(r.url()) && r.request().method() === 'DELETE',
)
await page.locator('dialog[open] .modal-content .actions .button').filter({hasText: 'Do it!'}).click()
await deleted
await expect(page.locator('table.table tbody tr')).toHaveCount(1)
// After revoke, the refresh request must fail. Refresh tokens live in the