test(e2e): cover data export request flow
This commit is contained in:
parent
a9f8fbaba8
commit
8bcdc314b1
|
|
@ -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()
|
||||
})
|
||||
})
|
||||
Loading…
Reference in New Issue