Skip to content

Commit

Permalink
test: fix window.getComputedStyle arguments (#10424)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfranco authored Sep 28, 2024
1 parent 3bc2e15 commit def59bb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions packages/calcite-components/src/components/alert/alert.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ describe("calcite-alert", () => {
await page.setContent(alertSnippet);
await page.waitForTimeout(alertQueueTimeoutMs);
alertDismissProgressBar = await page.find(`calcite-alert[open] >>> .${CSS.dismissProgress}`);
progressBarStyles = await alertDismissProgressBar.getComputedStyle(":after");
progressBarStyles = await alertDismissProgressBar.getComputedStyle("::after");
expect(await progressBarStyles.getPropertyValue("background-color")).toEqual("rgba(255, 255, 255, 0.8)");
});
});
Expand All @@ -365,7 +365,7 @@ describe("calcite-alert", () => {
await page.setContent(html`<div class="calcite-mode-dark">${alertSnippet}</div>`);
await page.waitForTimeout(alertQueueTimeoutMs);
alertDismissProgressBar = await page.find(`calcite-alert[open] >>> .${CSS.dismissProgress}`);
progressBarStyles = await alertDismissProgressBar.getComputedStyle(":after");
progressBarStyles = await alertDismissProgressBar.getComputedStyle("::after");
expect(await progressBarStyles.getPropertyValue("background-color")).toEqual("rgba(43, 43, 43, 0.8)");
});
});
Expand All @@ -384,7 +384,7 @@ describe("calcite-alert", () => {
);
await page.waitForTimeout(alertQueueTimeoutMs);
alertDismissProgressBar = await page.find(`calcite-alert[open] >>> .${CSS.dismissProgress}`);
progressBarStyles = await alertDismissProgressBar.getComputedStyle(":after");
progressBarStyles = await alertDismissProgressBar.getComputedStyle("::after");
expect(await progressBarStyles.getPropertyValue("background-color")).toEqual(overrideStyle);
});
});
Expand Down
12 changes: 6 additions & 6 deletions packages/calcite-components/src/components/button/button.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,12 @@ describe("calcite-button", () => {
buttonEl = await page.find("calcite-button >>> button");
await buttonEl.focus();
await page.waitForChanges();
buttonFocusStyle = await buttonEl.getComputedStyle(":focus");
buttonFocusStyle = await buttonEl.getComputedStyle();
expect(buttonFocusStyle.getPropertyValue("background-color")).toEqual("rgba(0, 0, 0, 0.04)");

await buttonEl.hover();
await page.waitForChanges();
buttonHoverStyle = await buttonEl.getComputedStyle(":hover");
buttonHoverStyle = await buttonEl.getComputedStyle();
expect(buttonHoverStyle.getPropertyValue("background-color")).toEqual("rgba(0, 0, 0, 0.04)");
});
});
Expand All @@ -551,12 +551,12 @@ describe("calcite-button", () => {
buttonEl = await page.find("calcite-button >>> button");
await buttonEl.focus();
await page.waitForChanges();
buttonFocusStyle = await buttonEl.getComputedStyle(":focus");
buttonFocusStyle = await buttonEl.getComputedStyle();
expect(buttonFocusStyle.getPropertyValue("background-color")).toEqual("rgba(255, 255, 255, 0.04)");

await buttonEl.hover();
await page.waitForChanges();
buttonHoverStyle = await buttonEl.getComputedStyle(":hover");
buttonHoverStyle = await buttonEl.getComputedStyle();
expect(buttonHoverStyle.getPropertyValue("background-color")).toEqual("rgba(255, 255, 255, 0.04)");
});
});
Expand All @@ -575,12 +575,12 @@ describe("calcite-button", () => {
buttonEl = await page.find("calcite-button >>> button");
await buttonEl.focus();
await page.waitForChanges();
buttonFocusStyle = await buttonEl.getComputedStyle(":focus");
buttonFocusStyle = await buttonEl.getComputedStyle();
expect(buttonFocusStyle.getPropertyValue("background-color")).toEqual(overrideStyle);

await buttonEl.hover();
await page.waitForChanges();
buttonHoverStyle = await buttonEl.getComputedStyle(":hover");
buttonHoverStyle = await buttonEl.getComputedStyle();
expect(buttonHoverStyle.getPropertyValue("background-color")).toEqual(overrideStyle);
});
});
Expand Down
12 changes: 6 additions & 6 deletions packages/calcite-components/src/components/chip/chip.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ describe("calcite-chip", () => {
chipCloseButton = await page.find("calcite-chip >>> button");
await chipCloseButton.focus();
await page.waitForChanges();
chipCloseButtonFocusStyle = await chipCloseButton.getComputedStyle(":focus");
chipCloseButtonFocusStyle = await chipCloseButton.getComputedStyle();
expect(chipCloseButtonFocusStyle.getPropertyValue("background-color")).toEqual("rgba(0, 0, 0, 0.04)");

await chipCloseButton.hover();
await page.waitForChanges();
chipCloseButtonHoverStyle = await chipCloseButton.getComputedStyle(":hover");
chipCloseButtonHoverStyle = await chipCloseButton.getComputedStyle();
expect(chipCloseButtonHoverStyle.getPropertyValue("background-color")).toEqual("rgba(0, 0, 0, 0.04)");
});
});
Expand All @@ -176,12 +176,12 @@ describe("calcite-chip", () => {
chipCloseButton = await page.find("calcite-chip >>> button");
await chipCloseButton.focus();
await page.waitForChanges();
chipCloseButtonFocusStyle = await chipCloseButton.getComputedStyle(":focus");
chipCloseButtonFocusStyle = await chipCloseButton.getComputedStyle();
expect(chipCloseButtonFocusStyle.getPropertyValue("background-color")).toEqual("rgba(255, 255, 255, 0.04)");

await chipCloseButton.hover();
await page.waitForChanges();
chipCloseButtonHoverStyle = await chipCloseButton.getComputedStyle(":hover");
chipCloseButtonHoverStyle = await chipCloseButton.getComputedStyle();
expect(chipCloseButtonHoverStyle.getPropertyValue("background-color")).toEqual("rgba(255, 255, 255, 0.04)");
});
});
Expand All @@ -200,12 +200,12 @@ describe("calcite-chip", () => {
chipCloseButton = await page.find("calcite-chip >>> button");
await chipCloseButton.focus();
await page.waitForChanges();
chipCloseButtonFocusStyle = await chipCloseButton.getComputedStyle(":focus");
chipCloseButtonFocusStyle = await chipCloseButton.getComputedStyle();
expect(chipCloseButtonFocusStyle.getPropertyValue("background-color")).toEqual(overrideStyle);

await chipCloseButton.hover();
await page.waitForChanges();
chipCloseButtonHoverStyle = await chipCloseButton.getComputedStyle(":hover");
chipCloseButtonHoverStyle = await chipCloseButton.getComputedStyle();
expect(chipCloseButtonHoverStyle.getPropertyValue("background-color")).toEqual(overrideStyle);
});

Expand Down

0 comments on commit def59bb

Please sign in to comment.