test(e2e): cover sessions list with current marker

This commit is contained in:
kolaente 2026-04-21 11:05:37 +02:00 committed by kolaente
parent 7145440fe6
commit cf9d0a26ab
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
import {test, expect} from '../../../support/fixtures'
import {SessionFactory} from '../../../factories/session'
import {gotoUserSettings} from '../../../support/userSettings'
test.describe('Sessions', () => {
test('lists the current session and other sessions', async ({
authenticatedPage: page, currentUser,
}) => {
// The auth fixture already created one session row (the login).
// Seed one additional session with truncate=false so we don't wipe it.
await SessionFactory.create(1, {
user_id: currentUser.id,
device_info: 'Firefox on Linux',
ip_address: '192.0.2.5',
}, false)
await gotoUserSettings(page, 'sessions')
const rows = page.locator('table.table tbody tr')
await expect(rows).toHaveCount(2)
await expect(page.locator('.tag.is-primary')).toContainText('Current')
await expect(page.locator('tr', {hasText: 'Firefox on Linux'})).toContainText('192.0.2.5')
})
})