From 016041ff93a24078fd26c108ee4c9996e1e8470a Mon Sep 17 00:00:00 2001 From: Frederic COLLONVAL Date: Sun, 15 Oct 2023 13:20:23 +0200 Subject: [PATCH] Fix integration tests --- ui-tests/tests/search.spec.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui-tests/tests/search.spec.ts b/ui-tests/tests/search.spec.ts index aa68716..e0d6c9f 100644 --- a/ui-tests/tests/search.spec.ts +++ b/ui-tests/tests/search.spec.ts @@ -51,9 +51,10 @@ test('should get 5 matches', async ({ page, tmpPath }) => { // Check the match is selected in the editor await page.getByLabel('conftest.py').getByRole('textbox').waitFor(); - expect(await page.evaluate(() => `${window.getSelection()}`)).toEqual( - 'strange' + const selection = await page.waitForFunction( + () => `${window.getSelection()}` ); + expect(selection).toEqual('strange'); }); test('should get no matches', async ({ page }) => { @@ -271,7 +272,7 @@ test('should replace results on replace-all button', async ({ page }) => { await page .getByRole('textbox', { name: 'Search Files for Text' }) - .fill('hola'); + .fill('hello'); await Promise.all([ page.waitForResponse( response =>