From 76213ecfd608fa6fcd27730fcdc30a8bbda9f4fb Mon Sep 17 00:00:00 2001 From: Mika Vilpas Date: Mon, 30 Dec 2024 21:28:05 +0200 Subject: [PATCH] refactor(tests): use shorter method of getting background-color --- .../cypress/e2e/blink-ripgrep/basic_spec.cy.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/integration-tests/cypress/e2e/blink-ripgrep/basic_spec.cy.ts b/integration-tests/cypress/e2e/blink-ripgrep/basic_spec.cy.ts index 481084f..327bceb 100644 --- a/integration-tests/cypress/e2e/blink-ripgrep/basic_spec.cy.ts +++ b/integration-tests/cypress/e2e/blink-ripgrep/basic_spec.cy.ts @@ -202,14 +202,8 @@ describe("searching inside projects", () => { // somewhere on the page (in the documentation window) cy.get("span") .filter((_, el) => el.textContent?.includes("Subtraction") ?? false) - .then((elements) => { - const matchingElements = elements.map((_, el) => { - return window.getComputedStyle(el).backgroundColor - }) - - return matchingElements.toArray() - }) - .should("contain", rgbify(flavors.macchiato.colors.mauve.rgb)) + .invoke("css", "background-color") + .should("eq", rgbify(flavors.macchiato.colors.mauve.rgb)) }) })