test(e2e): use exact text match for profile field labels

getByText('Display Name') is a substring match by default, so it also
matched the description paragraph "Manage your display name and
personal information." (strict mode violation: resolved to 2 elements).
Use { exact: true } to match the field label only.
This commit is contained in:
huishi3 2026-05-08 07:40:26 -07:00
parent 7175063d83
commit 20b5accf6e

View file

@ -12,8 +12,8 @@ test.describe('Profile Settings (Real API)', () => {
await page.goto('/settings/profile')
await expect(page.getByRole('heading', { name: 'Profile Settings' })).toBeVisible()
await expect(page.getByText('Display Name')).toBeVisible()
await expect(page.getByText('Email')).toBeVisible()
await expect(page.getByText('Display Name', { exact: true })).toBeVisible()
await expect(page.getByText('Email', { exact: true })).toBeVisible()
})
test('TC_PROFILE_002: edit button toggles to save and cancel', async ({ page }) => {