mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-05-21 10:41:50 -05:00
test(e2e): assert wrong password blocks email change
This commit is contained in:
@@ -163,3 +163,18 @@ test.describe('Email Confirmation', () => {
|
||||
await expect(page.locator('body')).toContainText(user.username)
|
||||
})
|
||||
})
|
||||
|
||||
test.describe('Email change', () => {
|
||||
test('rejects email change with wrong current password', async ({authenticatedPage: page}) => {
|
||||
await page.goto('/user/settings/email-update')
|
||||
await page.locator('#newEmail').fill('new@example.com')
|
||||
await page.locator('#currentPasswordEmail').fill('WRONG_PASSWORD')
|
||||
|
||||
const resp = page.waitForResponse(r => r.url().includes('/user/settings/email'))
|
||||
await page.getByRole('button', {name: 'Save'}).last().click()
|
||||
const r = await resp
|
||||
expect(r.status()).toBeGreaterThanOrEqual(400)
|
||||
|
||||
await expect(page.locator('.global-notification .vue-notification.error')).toBeVisible()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user