@mtes-mct/monitor-ui 12.1.0 → 12.1.2

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,40 @@
1
+ ## [12.1.1](https://github.com/MTES-MCT/monitor-ui/compare/v12.1.0...v12.1.1) (2024-02-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **cypress:** fix inner findElementParentBySelector() util ([a2dc379](https://github.com/MTES-MCT/monitor-ui/commit/a2dc37935989c54f4151d5fc47fde6956707cdf0))
7
+ * **cypress:** handle nested fieldsets in fill() command ([b5cb9f2](https://github.com/MTES-MCT/monitor-ui/commit/b5cb9f2ae1dff27e9d17d76022299ba36e9b2f19))
8
+
9
+
10
+ ### Buid System & Dependencies
11
+
12
+ * **dev-deps:** bump @commitlint/cli from 18.4.3 to 19.0.1 ([65e3b1c](https://github.com/MTES-MCT/monitor-ui/commit/65e3b1cbf6ff50ab61683e649638ca982074e993))
13
+ * **dev-deps:** bump @storybook/addon-storysource ([e5de861](https://github.com/MTES-MCT/monitor-ui/commit/e5de861a5710c119a68d17ca4c1e077893f79aef))
14
+ * **dev-deps:** bump @types/node in /e2e/release/sample ([e2f88b0](https://github.com/MTES-MCT/monitor-ui/commit/e2f88b0db3e73c9336c232e9e09f7b8cb614c729))
15
+ * **dev-deps:** bump @types/react in /e2e/release/sample ([214db7a](https://github.com/MTES-MCT/monitor-ui/commit/214db7a3a0bcac96e329808fa46d297954e35ec9))
16
+ * **dev-deps:** bump @types/react-dom in /e2e/release/sample ([8e74dd4](https://github.com/MTES-MCT/monitor-ui/commit/8e74dd4bf76753db7885244e7ebd2397faf186a1))
17
+ * **dev-deps:** bump cypress in /e2e/release/sample ([16e73ad](https://github.com/MTES-MCT/monitor-ui/commit/16e73add39ef203ea48ed782414d4f13748fa35b))
18
+ * **dev-deps:** bump prettier in /e2e/release/sample ([34d3b00](https://github.com/MTES-MCT/monitor-ui/commit/34d3b005e4a263fe6251a936282ab359c2cbb7ce))
19
+ * **dev-deps:** bump rollup-plugin-import-css from 3.4.0 to 3.5.0 ([69351ea](https://github.com/MTES-MCT/monitor-ui/commit/69351eab749ac534f267abd0e3fe2bde16bb0b54))
20
+
21
+ ## [12.1.0](https://github.com/MTES-MCT/monitor-ui/compare/v12.0.3...v12.1.0) (2024-02-27)
22
+
23
+
24
+ ### Features
25
+
26
+ * **cypress:** add logs in fill() and all its subcommands ([f9b320f](https://github.com/MTES-MCT/monitor-ui/commit/f9b320fc335745bb562da34f00b98ef78bf5ef74))
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * **cypress:** replace picker popup closure check with a wait in fill() ([9b4108b](https://github.com/MTES-MCT/monitor-ui/commit/9b4108be9479fb25d99902ca451dc329192bdb18))
32
+
33
+
34
+ ### Buid System & Dependencies
35
+
36
+ * **vite:** disable CSS minification for storybook build ([c98d7c9](https://github.com/MTES-MCT/monitor-ui/commit/c98d7c99c053f4084bec5c044a8ff1050e2029aa))
37
+
1
38
  ## [12.0.3](https://github.com/MTES-MCT/monitor-ui/compare/v12.0.2...v12.0.3) (2024-02-27)
2
39
 
3
40
 
package/cypress/index.js CHANGED
@@ -110,19 +110,25 @@ function clickLink(linkText) {
110
110
  });
111
111
  }
112
112
 
113
+ const MAX_PARENT_INDEX = 100;
113
114
  function findElementParentBySelector(element, parentSelector, index = 0) {
114
- let foundElement;
115
- let foundElementIndex = 0;
116
- const potentialParents = Cypress.$(element).parents(parentSelector);
117
- potentialParents// eslint-disable-next-line func-names
118
- .each(function() {
119
- if (foundElementIndex === index) {
120
- foundElement = this;
121
- return;
115
+ let currentParentElement = element;
116
+ let lastFoundParentIndex = 0;
117
+ let parentIndex = -1;
118
+ while(parentIndex < MAX_PARENT_INDEX){
119
+ parentIndex += 1;
120
+ currentParentElement = currentParentElement.parentElement;
121
+ if (!currentParentElement) {
122
+ return undefined;
122
123
  }
123
- foundElementIndex += 1;
124
- });
125
- return foundElement;
124
+ if (currentParentElement.matches(parentSelector)) {
125
+ if (lastFoundParentIndex === index) {
126
+ return currentParentElement;
127
+ }
128
+ lastFoundParentIndex += 1;
129
+ }
130
+ }
131
+ return undefined;
126
132
  }
127
133
 
128
134
  function checkCheckbox(fieldElement, value, _label) {
@@ -489,12 +495,8 @@ function pickMultiSelectOptions(fieldElement, values, label) {
489
495
  if (!rsuitePickerPopupElement) {
490
496
  throwError(`Could not find '.rs-picker-popup' in in field with label "${label}". Did the picker open?`);
491
497
  }
492
- const maybeSearchInput = rsuitePickerPopupElement.querySelector('input[role="searchbox"]');
493
498
  values.forEach((value)=>{
494
- // Search for the value if there is a search input
495
- if (maybeSearchInput) {
496
- cy.wrap(rsuitePickerPopupElement).find('input[role="searchbox"]').type(value).wait(250);
497
- }
499
+ cy.wrap(fieldElement).find('.rs-picker-toggle').click().wait(250).type(value).wait(250);
498
500
  cy.wrap(rsuitePickerPopupElement).find('[role="option"]').contains(value).scrollIntoView().forceClick();
499
501
  });
500
502
  // Close the picker popup by pressing the escape key
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mtes-mct/monitor-ui",
3
3
  "description": "Common React components, hooks, utilities and CSS stylesheets for MonitorFish, MonitorEnv and RapportNav.",
4
- "version": "12.1.0",
4
+ "version": "12.1.2",
5
5
  "license": "AGPL-3.0",
6
6
  "type": "module",
7
7
  "engines": {