@centreon/js-config 23.10.45 → 23.10.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,8 +11,6 @@ import { ThemeProvider } from '@centreon/ui';
|
|
|
11
11
|
import '@testing-library/cypress/add-commands';
|
|
12
12
|
import 'cypress-msw-interceptor';
|
|
13
13
|
|
|
14
|
-
import disableMotion from './disableCssTransitions';
|
|
15
|
-
|
|
16
14
|
interface MountProps {
|
|
17
15
|
Component: React.ReactNode;
|
|
18
16
|
options?: object;
|
|
@@ -134,16 +132,9 @@ Cypress.Commands.add('makeSnapshot', (title?: string) => {
|
|
|
134
132
|
cy.matchImageSnapshot(title);
|
|
135
133
|
});
|
|
136
134
|
|
|
137
|
-
Cypress.Commands.add('cssDisableMotion', (): void => {
|
|
138
|
-
Cypress.on('window:before:load', (cyWindow) => {
|
|
139
|
-
disableMotion(cyWindow);
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
|
|
143
135
|
declare global {
|
|
144
136
|
namespace Cypress {
|
|
145
137
|
interface Chainable {
|
|
146
|
-
cssDisableMotion: () => Cypress.Chainable;
|
|
147
138
|
interceptAPIRequest: <T extends object>(
|
|
148
139
|
props: InterceptAPIRequestProps<T>
|
|
149
140
|
) => Cypress.Chainable;
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const disableMotion = (win): void => {
|
|
2
|
-
const injectedStyleEl = win.document.getElementById('__cy_disable_motion__');
|
|
3
|
-
if (injectedStyleEl) {
|
|
4
|
-
return;
|
|
5
|
-
}
|
|
6
|
-
win.document.head.insertAdjacentHTML(
|
|
7
|
-
'beforeend',
|
|
8
|
-
`
|
|
9
|
-
<style id="__cy_disable_motion__">
|
|
10
|
-
/* Disable CSS transitions. */
|
|
11
|
-
*, *::before, *::after { -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; -ms-transition: none !important; transition: none !important; }
|
|
12
|
-
/* Disable CSS animations. */
|
|
13
|
-
*, *::before, *::after { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; -ms-animation: none !important; animation: none !important; }
|
|
14
|
-
</style>
|
|
15
|
-
`.trim()
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default disableMotion;
|