During integration testing you can face with problem of flaky tests caused by animation. It is especially
- crucial if you are writing screenshot tests.
-
-
-
- For example, you want to make screenshot of dialog content: you click button which opens dialog and make
- screenshot. Sometimes screenshots can be made too early (before dialog fully opens) and test fails.
+ crucial if you are writing screenshot tests. For example, you want to make screenshot of dialog content: you
+ click button which opens dialog and make screenshot. Sometimes screenshots can be made too early (before dialog
+ fully opens) and test fails.
@@ -15,32 +12,49 @@
- For example, we use
-
- Cypress
-
- for screenshot testing of our ui-kit components.
+ @taiga-ui/cdk
+ used
+
+
+ {{ ref.type }}
+
+
+
+ token which disables all animations for taiga-ui components. That token based on
+ prefers-reduced-motion
+ . The prefers-reduced-motion CSS media feature is used to detect if a user has enabled a setting on their device
+ to minimize the amount of non-essential motion.. The setting is used to convey to the browser on the device that
+ the user prefers an interface that removes, reduces, or replaces motion-based animations.
-
-
- To detect if app is running under Cypress we use token
- TUI_IS_CYPRESS
- .
-
-
- To disable animation in ALL Taiga UI components we use token
- TUI_ANIMATIONS_DURATION
- .
-