From 7f2daa668e8ddf4fbd78f4bdb26e83d7e7158e74 Mon Sep 17 00:00:00 2001 From: mgreminger Date: Sun, 28 Apr 2024 15:50:43 -0500 Subject: [PATCH] tests: update tests to check for hidden stale results Previous tests look for stale results to be detached, now they are hidden to prevent layout jumps --- tests/test_basic.spec.mjs | 4 ++-- tests/test_file_save_open.spec.mjs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_basic.spec.mjs b/tests/test_basic.spec.mjs index 838ff552..6bbba7f7 100644 --- a/tests/test_basic.spec.mjs +++ b/tests/test_basic.spec.mjs @@ -1288,9 +1288,9 @@ test('Check parsing error handling impact on displayed results', async () => { content = await page.textContent('#result-value-1'); expect(parseLatexFloat(content)).toBeCloseTo(5.11, precision); - // leave cell, result should dissapear + // leave cell, result should be made hidden await page.keyboard.press('Escape'); - await page.locator('#result-value-1').waitFor({state: "detached", timeout: 500}); + await page.locator('#cell-1 >> math-field:not(.editable)').waitFor({state: "hidden", timeout: 500}); }); diff --git a/tests/test_file_save_open.spec.mjs b/tests/test_file_save_open.spec.mjs index 31480fa3..58dca4d3 100644 --- a/tests/test_file_save_open.spec.mjs +++ b/tests/test_file_save_open.spec.mjs @@ -184,7 +184,7 @@ test('Test clearing results on valid input after page initial load form file', a await page.setLatex(0, '1='); // ensure that result is not displayed even though it is in file - await page.locator('#result-value-0').waitFor({state: "detached", timeout: 1000}); + await page.locator('#cell-0 >> math-field:not(.editable)').waitFor({state: "hidden", timeout: 1000}); });