From b08831324f738c7289ae915f89a4dd186c1efb74 Mon Sep 17 00:00:00 2001 From: Andrea Verlicchi Date: Tue, 2 Apr 2024 18:05:55 +0200 Subject: [PATCH] Fixed check for not hidpi --- tests/e2e/background_image.spec.js | 10 +++++----- tests/e2e/background_image_multi.spec.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/e2e/background_image.spec.js b/tests/e2e/background_image.spec.js index 6a0768b..bc3e568 100644 --- a/tests/e2e/background_image.spec.js +++ b/tests/e2e/background_image.spec.js @@ -19,12 +19,12 @@ for (const { url, description } of pagesWithSimpleImages) { await element.scrollIntoViewIfNeeded(); // Set expectations - const expectedBg = `background-image: url("${await element.getAttribute("data-bg")}");`; - const expectedHiDpiBg = `background-image: url("${await element.getAttribute( - "data-bg-hidpi" - )}");`; + const dataBg = await element.getAttribute("data-bg"); + const dataBgHidpi = await element.getAttribute("data-bg-hidpi"); + const expectedBg = `background-image: url("${dataBg}");`; + const expectedHiDpiBg = `background-image: url("${dataBgHidpi}");`; - if (!expectedHiDpiBg) { + if (!dataBgHidpi) { await expect(element).toHaveAttribute("style", expectedBg); continue; } diff --git a/tests/e2e/background_image_multi.spec.js b/tests/e2e/background_image_multi.spec.js index 6d129bb..4c56c5e 100644 --- a/tests/e2e/background_image_multi.spec.js +++ b/tests/e2e/background_image_multi.spec.js @@ -19,12 +19,12 @@ for (const { url, description } of pagesWithSimpleImages) { await element.scrollIntoViewIfNeeded(); // Set expectations - const expectedBg = `background-image: ${await element.getAttribute("data-bg-multi")};`; - const expectedHiDpiBg = `background-image: ${await element.getAttribute( - "data-bg-multi-hidpi" - )};`; + const dataBgMulti = await element.getAttribute("data-bg-multi"); + const dataBgMultiHidpi = await element.getAttribute("data-bg-multi-hidpi"); + const expectedBg = `background-image: ${dataBgMulti};`; + const expectedHiDpiBg = `background-image: ${dataBgMultiHidpi};`; - if (!expectedHiDpiBg) { + if (!dataBgMultiHidpi) { await expect(element).toHaveAttribute("style", expectedBg); continue; }