test(e2e): assert wrong password blocks email change

This commit is contained in:
kolaente
2026-04-21 11:02:34 +02:00
committed by kolaente
parent 3dfbcae4d5
commit 7145440fe6

View File

@@ -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()
})
})