From 3cbb67475e4a777440d442bc4e769cfc9d4405a8 Mon Sep 17 00:00:00 2001 From: Balsa Asanovic Date: Mon, 26 Feb 2024 23:11:22 +0100 Subject: [PATCH] updated tests for suggestions algorithm --- web/src/components/users/utils.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/components/users/utils.test.js b/web/src/components/users/utils.test.js index e3711388de..0b188a4537 100644 --- a/web/src/components/users/utils.test.js +++ b/web/src/components/users/utils.test.js @@ -23,7 +23,7 @@ import { suggestUsernames } from "./utils"; describe('suggestUsernames', () => { test('handles basic single name', () => { - expect(suggestUsernames('John')).toEqual(expect.arrayContaining(['john', 'j'])); + expect(suggestUsernames('John')).toEqual(expect.arrayContaining(['john'])); }); test('handles basic two-part name', () => { @@ -31,7 +31,7 @@ describe('suggestUsernames', () => { }); test('handles name with middle initial', () => { - expect(suggestUsernames('John Q. Doe')).toEqual(expect.arrayContaining(['john', 'jq', 'jqdoe', 'johnqd', 'johnqdoe'])); + expect(suggestUsernames('John Q. Doe')).toEqual(expect.arrayContaining(['john', 'jqdoe', 'johnqd', 'johnqdoe'])); }); test('normalizes accented characters', () => { @@ -47,7 +47,7 @@ describe('suggestUsernames', () => { }); test('handles long name with multiple parts', () => { - expect(suggestUsernames("Maria del Carmen Fernandez Vega")).toEqual(expect.arrayContaining(['maria', 'mdel', 'mdelcarmenfernandezvega', 'mariadcfv', 'mdcfvega', 'mariadelcarmenfernandezvega'])); + expect(suggestUsernames("Maria del Carmen Fernandez Vega")).toEqual(expect.arrayContaining(['maria', 'mdelcarmenfernandezvega', 'mariadcfv', 'mdcfvega', 'mariadelcarmenfernandezvega'])); }); test('handles empty or invalid input', () => {