From 20b5accf6ee6e0c2dbbdcdcb2201575010eb74db Mon Sep 17 00:00:00 2001 From: huishi3 Date: Fri, 8 May 2026 07:40:26 -0700 Subject: [PATCH] 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. --- web/e2e/profile-settings.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/e2e/profile-settings.spec.ts b/web/e2e/profile-settings.spec.ts index b13fc91e..687e49d0 100644 --- a/web/e2e/profile-settings.spec.ts +++ b/web/e2e/profile-settings.spec.ts @@ -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 }) => {