Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
289 stars 76 forks source link

Alert: refactor queue timeout to get timeout value from the CSS var `--calcite-internal-animation-timing-slow` #10098

Open driskull opened 2 months ago

driskull commented 2 months ago

Description

Currently, the alert tests need to set a fixed timeout to account for animations even when animations are disabled. This is because the alert uses a fixed timeout for 300ms to wait for an animation to complete.

Proposed Advantages

Instead, it should get the timeout MS value from the animation CSS variable.

Then, in tests await page.waitForTimeout(animationDurationInMs); should be able to be removed.

Which Component

alert

Relevant Info

https://github.com/Esri/calcite-design-system/pull/10029#discussion_r1720467890

Calcite package

driskull commented 2 months ago

Looked into this a bit. One issue is that the CSS variable --calcite-internal-animation-timing-slow uses calc.

Since it uses calc, we can't get the calculated value in order to find out the real timeout. That might make this a bit tough.