test(e2e): cover data export request flow

This commit is contained in:
kolaente 2026-04-21 11:13:25 +02:00 committed by kolaente
parent a9f8fbaba8
commit 8bcdc314b1
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
import {test, expect} from '../../../support/fixtures'
import {gotoUserSettings} from '../../../support/userSettings'
import {TEST_PASSWORD} from '../../../support/constants'
test.describe('Data export', () => {
test('requests an export with correct password', async ({authenticatedPage: page}) => {
await gotoUserSettings(page, 'data-export')
await page.locator('#currentPasswordDataExport').fill(TEST_PASSWORD)
const resp = page.waitForResponse(r => r.url().includes('/user/export/request'))
await page.getByRole('button', {name: /request/i}).click()
const r = await resp
expect(r.ok()).toBe(true)
await expect(page.locator('.global-notification .vue-notification.success')).toBeVisible()
})
test('rejects export with wrong password', async ({authenticatedPage: page}) => {
await gotoUserSettings(page, 'data-export')
await page.locator('#currentPasswordDataExport').fill('WRONG')
const resp = page.waitForResponse(r => r.url().includes('/user/export/request'))
await page.getByRole('button', {name: /request/i}).click()
const r = await resp
expect(r.ok()).toBe(false)
await expect(page.locator('.global-notification .vue-notification.error')).toBeVisible()
})
})