@centreon/js-config 23.10.56 → 23.10.58

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.
@@ -96,20 +96,32 @@ Cypress.Commands.add(
96
96
  }
97
97
  );
98
98
 
99
- Cypress.Commands.add('moveSortableElement', ({ element, direction }): void => {
100
- const key = `{${direction}arrow}`;
99
+ interface MoveSortableElementProps {
100
+ direction: 'up' | 'down' | 'left' | 'right';
101
+ element: Cypress.Chainable<JQuery<HTMLElement>>;
102
+ times?: number;
103
+ }
101
104
 
102
- element.type(' ', {
103
- force: true,
104
- scrollBehavior: false
105
- });
106
- element.eq(-1).type(key, {
107
- scrollBehavior: false
108
- });
109
- element.eq(-1).type(' ', {
110
- scrollBehavior: false
111
- });
112
- });
105
+ Cypress.Commands.add(
106
+ 'moveSortableElement',
107
+ ({ element, direction, times = 1 }: MoveSortableElementProps): void => {
108
+ const key = `{${direction}arrow}`;
109
+
110
+ element.type(' ', {
111
+ force: true,
112
+ scrollBehavior: false
113
+ });
114
+
115
+ Array.from({ length: times }).forEach(() => {
116
+ element.eq(-1).type(key, {
117
+ scrollBehavior: false
118
+ });
119
+ });
120
+ element.eq(-1).type(' ', {
121
+ scrollBehavior: false
122
+ });
123
+ }
124
+ );
113
125
 
114
126
  Cypress.Commands.add(
115
127
  'moveSortableElementUsingAriaLabel',
@@ -150,7 +162,11 @@ declare global {
150
162
  interceptRequest: (method, path, mock, alias) => Cypress.Chainable;
151
163
  makeSnapshot: (title?: string) => void;
152
164
  mount: ({ Component, options }: MountProps) => Cypress.Chainable;
153
- moveSortableElement: ({ element, direction }) => void;
165
+ moveSortableElement: ({
166
+ element,
167
+ direction,
168
+ times
169
+ }: MoveSortableElementProps) => void;
154
170
  moveSortableElementUsingAriaLabel: ({ ariaLabel, direction }) => void;
155
171
  waitForRequest: (alias) => Cypress.Chainable;
156
172
  }
@@ -178,13 +178,11 @@ Cypress.Commands.add(
178
178
  .getByLabel({ label: 'Connect', tag: 'button' })
179
179
  .click();
180
180
 
181
- return cy
182
- .get('.SnackbarContent-root > .MuiPaper-root')
183
- .then(($snackbar) => {
184
- if ($snackbar.text().includes('Login succeeded')) {
185
- cy.wait('@getNavigationList');
186
- }
187
- });
181
+ return cy.get('.MuiAlert-message').then(($snackbar) => {
182
+ if ($snackbar.text().includes('Login succeeded')) {
183
+ cy.wait('@getNavigationList');
184
+ }
185
+ });
188
186
  }
189
187
  );
190
188
 
package/jest/index.js CHANGED
@@ -5,7 +5,6 @@ module.exports = {
5
5
  'jest-transform-stub',
6
6
  '^react($|/.+)': '<rootDir>/node_modules/react$1'
7
7
  },
8
- setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
9
8
  testEnvironment: 'jsdom',
10
9
  testPathIgnorePatterns: ['/node_modules/', '!*.cypress.spec.tsx'],
11
10
  transform: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@centreon/js-config",
3
3
  "description": "Centreon Frontend shared build configuration",
4
- "version": "23.10.56",
4
+ "version": "23.10.58",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/centreon/centreon-frontend.git"
@@ -1,5 +1,5 @@
1
1
  const excludeNodeModulesExceptCentreonUi =
2
- /node_modules(\\|\/)\.pnpm(\\|\/)(?!(@centreon))/;
2
+ /node_modules(\\|\/)\.pnpm(\\|\/)(?!(@centreon|file\+packages\+ui-context))/;
3
3
 
4
4
  module.exports = {
5
5
  cache: false,
@@ -29,19 +29,17 @@ const getBaseConfiguration = ({
29
29
  shared: [
30
30
  {
31
31
  '@centreon/ui-context': {
32
- requiredVersion: '22.10.0',
33
32
  singleton: true
34
33
  }
35
34
  },
36
35
  {
37
36
  jotai: {
38
- requiredVersion: '1.x',
37
+ requiredVersion: '2.x',
39
38
  singleton: true
40
39
  }
41
40
  },
42
41
  {
43
42
  'jotai-suspense': {
44
- requiredVersion: '0.1.x',
45
43
  singleton: true
46
44
  }
47
45
  },
@@ -75,10 +73,10 @@ const getBaseConfiguration = ({
75
73
  ].filter(Boolean),
76
74
  resolve: {
77
75
  alias: {
78
- react: path.resolve('./node_modules/react'),
79
76
  '@centreon/ui/fonts': path.resolve(
80
77
  './node_modules/@centreon/ui/public/fonts'
81
- )
78
+ ),
79
+ react: path.resolve('./node_modules/react')
82
80
  },
83
81
  extensions: ['.js', '.jsx', '.ts', '.tsx']
84
82
  }