From 6b3269b1c545b6b07fe9c3932889cd7e50d7413c Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sat, 23 May 2026 20:06:14 +0200 Subject: [PATCH] Fix typo in profile count test and enhance validation for filter results --- tests/e2e/web/specs/signIn.spec.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/e2e/web/specs/signIn.spec.ts b/tests/e2e/web/specs/signIn.spec.ts index 262b3cf9..9cadeeba 100644 --- a/tests/e2e/web/specs/signIn.spec.ts +++ b/tests/e2e/web/specs/signIn.spec.ts @@ -10,7 +10,7 @@ test.describe('when given valid input', () => { await app.home.verifySignedInHomePage(account.display_name) }) - test('the profile count should update sucessfully when applying a filter', async ({ + test('the profile count should update successfully when applying a filter', async ({ app, signedOutAccount: account, }) => { @@ -20,10 +20,15 @@ test.describe('when given valid input', () => { const totalProfiles = await app.people.profileCountLocator.textContent() await app.people.setConnectionTypeFilter(['Collaboration', 'collaboration']) - const filterdProfiles = await app.people.profileCountLocator.textContent() + const filteredProfiles = await app.people.profileCountLocator.textContent() - if (!totalProfiles || !filterdProfiles) return - await expect(parseInt(totalProfiles)).not.toEqual(parseInt(filterdProfiles)) + expect(totalProfiles).toBeTruthy() + expect(filteredProfiles).toBeTruthy() + const totalCount = Number.parseInt(totalProfiles!, 10) + const filteredCount = Number.parseInt(filteredProfiles!, 10) + expect(Number.isNaN(totalCount)).toBe(false) + expect(Number.isNaN(filteredCount)).toBe(false) + await expect(filteredCount).not.toEqual(totalCount) }) }) @@ -38,4 +43,4 @@ test.describe('when given invalid input', () => { page.getByText('Failed to sign in with your email and password', {exact: true}), ).toBeVisible() }) -}) \ No newline at end of file +})