From 7145440fe6694484fbd88ebc2b0db1934d647855 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 21 Apr 2026 11:02:34 +0200 Subject: [PATCH] test(e2e): assert wrong password blocks email change --- .../tests/e2e/user/email-confirmation.spec.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/tests/e2e/user/email-confirmation.spec.ts b/frontend/tests/e2e/user/email-confirmation.spec.ts index a19ff4b7f..7762376b0 100644 --- a/frontend/tests/e2e/user/email-confirmation.spec.ts +++ b/frontend/tests/e2e/user/email-confirmation.spec.ts @@ -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() + }) +})