Skip to content

Commit

Permalink
refactor: remove unnecessary skipAnimations delay workaround (#10614)
Browse files Browse the repository at this point in the history
**Related Issue:** N/A

## Summary

Removes workaround no longer needed after #6604.
  • Loading branch information
jcfranco authored Oct 25, 2024
1 parent af4ee25 commit dd8d8c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 3 additions & 7 deletions packages/calcite-components/src/tests/commonTests/openClose.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { E2EPage } from "@stencil/core/testing";
import { toHaveNoViolations } from "jest-axe";
import { GlobalTestProps, newProgrammaticE2EPage, toElementHandle } from "../utils";
import { GlobalTestProps, newProgrammaticE2EPage, skipAnimations, toElementHandle } from "../utils";
import { getBeforeContent, getTagAndPage, noopBeforeContent } from "./utils";
import { ComponentTag, ComponentTestSetup, WithBeforeContent } from "./interfaces";

Expand Down Expand Up @@ -71,9 +71,7 @@ export function openClose(componentTestSetup: ComponentTestSetup, options?: Open

it(`emits with animations disabled`, async () => {
const { page, tag } = await getTagAndPage(componentTestSetup);
await page.addStyleTag({
content: `:root { --calcite-duration-factor: 0; }`,
});
await skipAnimations(page);
await setUpEventListeners(tag, page);
await testOpenCloseEvents({
animationsEnabled: false,
Expand Down Expand Up @@ -122,9 +120,7 @@ openClose.initial = function openCloseInitial(

it("emits on initialization with animations disabled", async () => {
const page = await newProgrammaticE2EPage();
await page.addStyleTag({
content: `:root { --calcite-duration-factor: 0; }`,
});
await skipAnimations(page);
await beforeContent(page);
await setUpEventListeners(tag, page);
await testOpenCloseEvents({
Expand Down
4 changes: 1 addition & 3 deletions packages/calcite-components/src/tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ export async function newProgrammaticE2EPage(): Promise<E2EPage> {
*/
export async function skipAnimations(page: E2EPage): Promise<void> {
await page.addStyleTag({
// using 0.01 to ensure `openCloseComponent` utils work consistently
// this should be removed once https://github.com/Esri/calcite-design-system/issues/6604 is addressed
content: `:root { --calcite-duration-factor: 0.01; }`,
content: `:root { --calcite-duration-factor: 0; }`,
});
}

Expand Down

0 comments on commit dd8d8c7

Please sign in to comment.