Skip to content

Commit fd4c8e9

Browse files
committed
test: fix window.getComputedStyle arguments
1 parent 737085a commit fd4c8e9

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

packages/calcite-components/src/components/alert/alert.e2e.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ describe("calcite-alert", () => {
353353
await page.setContent(alertSnippet);
354354
await page.waitForTimeout(alertQueueTimeoutMs);
355355
alertDismissProgressBar = await page.find(`calcite-alert[open] >>> .${CSS.dismissProgress}`);
356-
progressBarStyles = await alertDismissProgressBar.getComputedStyle(":after");
356+
progressBarStyles = await alertDismissProgressBar.getComputedStyle("::after");
357357
expect(await progressBarStyles.getPropertyValue("background-color")).toEqual("rgba(255, 255, 255, 0.8)");
358358
});
359359
});
@@ -365,7 +365,7 @@ describe("calcite-alert", () => {
365365
await page.setContent(html`<div class="calcite-mode-dark">${alertSnippet}</div>`);
366366
await page.waitForTimeout(alertQueueTimeoutMs);
367367
alertDismissProgressBar = await page.find(`calcite-alert[open] >>> .${CSS.dismissProgress}`);
368-
progressBarStyles = await alertDismissProgressBar.getComputedStyle(":after");
368+
progressBarStyles = await alertDismissProgressBar.getComputedStyle("::after");
369369
expect(await progressBarStyles.getPropertyValue("background-color")).toEqual("rgba(43, 43, 43, 0.8)");
370370
});
371371
});
@@ -384,7 +384,7 @@ describe("calcite-alert", () => {
384384
);
385385
await page.waitForTimeout(alertQueueTimeoutMs);
386386
alertDismissProgressBar = await page.find(`calcite-alert[open] >>> .${CSS.dismissProgress}`);
387-
progressBarStyles = await alertDismissProgressBar.getComputedStyle(":after");
387+
progressBarStyles = await alertDismissProgressBar.getComputedStyle("::after");
388388
expect(await progressBarStyles.getPropertyValue("background-color")).toEqual(overrideStyle);
389389
});
390390
});

packages/calcite-components/src/components/button/button.e2e.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -533,12 +533,12 @@ describe("calcite-button", () => {
533533
buttonEl = await page.find("calcite-button >>> button");
534534
await buttonEl.focus();
535535
await page.waitForChanges();
536-
buttonFocusStyle = await buttonEl.getComputedStyle(":focus");
536+
buttonFocusStyle = await buttonEl.getComputedStyle();
537537
expect(buttonFocusStyle.getPropertyValue("background-color")).toEqual("rgba(0, 0, 0, 0.04)");
538538

539539
await buttonEl.hover();
540540
await page.waitForChanges();
541-
buttonHoverStyle = await buttonEl.getComputedStyle(":hover");
541+
buttonHoverStyle = await buttonEl.getComputedStyle();
542542
expect(buttonHoverStyle.getPropertyValue("background-color")).toEqual("rgba(0, 0, 0, 0.04)");
543543
});
544544
});
@@ -551,12 +551,12 @@ describe("calcite-button", () => {
551551
buttonEl = await page.find("calcite-button >>> button");
552552
await buttonEl.focus();
553553
await page.waitForChanges();
554-
buttonFocusStyle = await buttonEl.getComputedStyle(":focus");
554+
buttonFocusStyle = await buttonEl.getComputedStyle();
555555
expect(buttonFocusStyle.getPropertyValue("background-color")).toEqual("rgba(255, 255, 255, 0.04)");
556556

557557
await buttonEl.hover();
558558
await page.waitForChanges();
559-
buttonHoverStyle = await buttonEl.getComputedStyle(":hover");
559+
buttonHoverStyle = await buttonEl.getComputedStyle();
560560
expect(buttonHoverStyle.getPropertyValue("background-color")).toEqual("rgba(255, 255, 255, 0.04)");
561561
});
562562
});
@@ -575,12 +575,12 @@ describe("calcite-button", () => {
575575
buttonEl = await page.find("calcite-button >>> button");
576576
await buttonEl.focus();
577577
await page.waitForChanges();
578-
buttonFocusStyle = await buttonEl.getComputedStyle(":focus");
578+
buttonFocusStyle = await buttonEl.getComputedStyle();
579579
expect(buttonFocusStyle.getPropertyValue("background-color")).toEqual(overrideStyle);
580580

581581
await buttonEl.hover();
582582
await page.waitForChanges();
583-
buttonHoverStyle = await buttonEl.getComputedStyle(":hover");
583+
buttonHoverStyle = await buttonEl.getComputedStyle();
584584
expect(buttonHoverStyle.getPropertyValue("background-color")).toEqual(overrideStyle);
585585
});
586586
});

packages/calcite-components/src/components/chip/chip.e2e.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ describe("calcite-chip", () => {
158158
chipCloseButton = await page.find("calcite-chip >>> button");
159159
await chipCloseButton.focus();
160160
await page.waitForChanges();
161-
chipCloseButtonFocusStyle = await chipCloseButton.getComputedStyle(":focus");
161+
chipCloseButtonFocusStyle = await chipCloseButton.getComputedStyle();
162162
expect(chipCloseButtonFocusStyle.getPropertyValue("background-color")).toEqual("rgba(0, 0, 0, 0.04)");
163163

164164
await chipCloseButton.hover();
165165
await page.waitForChanges();
166-
chipCloseButtonHoverStyle = await chipCloseButton.getComputedStyle(":hover");
166+
chipCloseButtonHoverStyle = await chipCloseButton.getComputedStyle();
167167
expect(chipCloseButtonHoverStyle.getPropertyValue("background-color")).toEqual("rgba(0, 0, 0, 0.04)");
168168
});
169169
});
@@ -176,12 +176,12 @@ describe("calcite-chip", () => {
176176
chipCloseButton = await page.find("calcite-chip >>> button");
177177
await chipCloseButton.focus();
178178
await page.waitForChanges();
179-
chipCloseButtonFocusStyle = await chipCloseButton.getComputedStyle(":focus");
179+
chipCloseButtonFocusStyle = await chipCloseButton.getComputedStyle();
180180
expect(chipCloseButtonFocusStyle.getPropertyValue("background-color")).toEqual("rgba(255, 255, 255, 0.04)");
181181

182182
await chipCloseButton.hover();
183183
await page.waitForChanges();
184-
chipCloseButtonHoverStyle = await chipCloseButton.getComputedStyle(":hover");
184+
chipCloseButtonHoverStyle = await chipCloseButton.getComputedStyle();
185185
expect(chipCloseButtonHoverStyle.getPropertyValue("background-color")).toEqual("rgba(255, 255, 255, 0.04)");
186186
});
187187
});
@@ -200,12 +200,12 @@ describe("calcite-chip", () => {
200200
chipCloseButton = await page.find("calcite-chip >>> button");
201201
await chipCloseButton.focus();
202202
await page.waitForChanges();
203-
chipCloseButtonFocusStyle = await chipCloseButton.getComputedStyle(":focus");
203+
chipCloseButtonFocusStyle = await chipCloseButton.getComputedStyle();
204204
expect(chipCloseButtonFocusStyle.getPropertyValue("background-color")).toEqual(overrideStyle);
205205

206206
await chipCloseButton.hover();
207207
await page.waitForChanges();
208-
chipCloseButtonHoverStyle = await chipCloseButton.getComputedStyle(":hover");
208+
chipCloseButtonHoverStyle = await chipCloseButton.getComputedStyle();
209209
expect(chipCloseButtonHoverStyle.getPropertyValue("background-color")).toEqual(overrideStyle);
210210
});
211211

0 commit comments

Comments
 (0)