Skip to content

Commit

Permalink
Use new box getter
Browse files Browse the repository at this point in the history
  • Loading branch information
Jym77 committed Oct 20, 2023
1 parent e9d01a5 commit da523ad
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/alfa-scraper/test/scraper.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Device } from "@siteimprove/alfa-device";
import * as path from "path";
import * as url from "url";

Expand Down Expand Up @@ -81,15 +82,13 @@ test("#scrape() scrapes a page with a delayed location change", async (t) =>
test("#scrape() scrapes layout", async (t) =>
await Scraper.with(async (scraper) => {
const url = getTestPageFileUrl("layout.html");
const result = await scraper.scrape(url);
const page = (await scraper.scrape(url)).getUnsafe();

const box = getElementDescendants(
result.getUnsafe().document,
Node.fullTree
)
const box = getElementDescendants(page.document, Node.fullTree)
.find((node) => node.id.some((id) => id === "blackbox"))
.getUnsafe()
.box.getUnsafe()
.getBoundingBox(page.device)
.getUnsafe()
.toJSON();

t.deepEqual(box, {
Expand Down

0 comments on commit da523ad

Please sign in to comment.