️(frontend) search users with at least 5 characters

We now only search for users when the query
is at least 5 characters long.
This commit is contained in:
Anthony LC
2025-03-21 15:30:31 +01:00
committed by Manuel Raynaud
parent 8473facbee
commit fb5400c26b
4 changed files with 12 additions and 9 deletions

View File

@@ -80,11 +80,11 @@ export const addNewMember = async (
page: Page,
index: number,
role: 'Administrator' | 'Owner' | 'Member' | 'Editor' | 'Reader',
fillText: string = 'user',
fillText: string = 'user ',
) => {
const responsePromiseSearchUser = page.waitForResponse(
(response) =>
response.url().includes(`/users/?q=${fillText}`) &&
response.url().includes(`/users/?q=${encodeURIComponent(fillText)}`) &&
response.status() === 200,
);
@@ -97,7 +97,7 @@ export const addNewMember = async (
// Intercept response
const responseSearchUser = await responsePromiseSearchUser;
const users = (await responseSearchUser.json()).results as {
const users = (await responseSearchUser.json()) as {
email: string;
}[];