Skip to content

Commit

Permalink
Fixed check for not hidpi
Browse files Browse the repository at this point in the history
  • Loading branch information
verlok committed Apr 2, 2024
1 parent 31b6610 commit b088313
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions tests/e2e/background_image.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/background_image_multi.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b088313

Please sign in to comment.