From 01cf5ef3cf3cb81afd346fdf5d05c8943fefc9ed Mon Sep 17 00:00:00 2001 From: Quentin Date: Wed, 6 Nov 2024 22:56:12 +0100 Subject: [PATCH] Cypress: use data-testid instead of data-test --- .../landscape-loader/LandscapeLoader.html | 2 +- .../LandscapeMiniMap.component.ts | 2 +- .../landscape-minimap/LandscapeMiniMap.html | 8 ++++---- .../landscape-module/LandscapeModule.html | 4 ++-- .../LandscapePresetConfiguration.html | 4 ++-- .../module/primary/landscape/Landscape.html | 18 +++++++++--------- .../module-parameters/ModuleParameters.html | 6 +++--- .../ModulePropertiesForm.html | 14 ++++++++------ .../ModulesPatchLoader.html | 2 +- .../primary/modules-patch/ModulesPatch.html | 14 +++++++------- .../project-actions/ProjectActions.html | 4 ++-- .../module/primary/tag-filter/TagFilter.html | 2 +- .../infrastructure/primary/ThemeButton.vue | 2 +- .../toast/infrastructure/primary/Toast.vue | 4 ++-- .../unit/common/primary/toast/Toast.spec.ts | 6 +++--- 15 files changed, 47 insertions(+), 45 deletions(-) diff --git a/src/main/webapp/app/module/primary/landscape-loader/LandscapeLoader.html b/src/main/webapp/app/module/primary/landscape-loader/LandscapeLoader.html index af15b705996..006c53360e7 100644 --- a/src/main/webapp/app/module/primary/landscape-loader/LandscapeLoader.html +++ b/src/main/webapp/app/module/primary/landscape-loader/LandscapeLoader.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/main/webapp/app/module/primary/landscape-minimap/LandscapeMiniMap.component.ts b/src/main/webapp/app/module/primary/landscape-minimap/LandscapeMiniMap.component.ts index 686b596741b..fb038181c50 100644 --- a/src/main/webapp/app/module/primary/landscape-minimap/LandscapeMiniMap.component.ts +++ b/src/main/webapp/app/module/primary/landscape-minimap/LandscapeMiniMap.component.ts @@ -42,7 +42,7 @@ export default defineComponent({ }); const removeDataSelectorAttrs = (data: string): string => { - const regex = /data-test="[^"]*"/g; + const regex = /data-testid="[^"]*"/g; return data.replace(regex, ''); }; diff --git a/src/main/webapp/app/module/primary/landscape-minimap/LandscapeMiniMap.html b/src/main/webapp/app/module/primary/landscape-minimap/LandscapeMiniMap.html index 46db1bd0e6f..1df69fa96b5 100644 --- a/src/main/webapp/app/module/primary/landscape-minimap/LandscapeMiniMap.html +++ b/src/main/webapp/app/module/primary/landscape-minimap/LandscapeMiniMap.html @@ -1,11 +1,11 @@
- + @@ -17,8 +17,8 @@ @mousemove="grabbing" @mouseup="stopGrabbing" @mouseleave="stopGrabbing" - data-test="minimap-viewer" + data-testid="minimap-viewer" >
-
+
diff --git a/src/main/webapp/app/module/primary/landscape-module/LandscapeModule.html b/src/main/webapp/app/module/primary/landscape-module/LandscapeModule.html index 93c30f5941f..2c034be2d93 100644 --- a/src/main/webapp/app/module/primary/landscape-module/LandscapeModule.html +++ b/src/main/webapp/app/module/primary/landscape-module/LandscapeModule.html @@ -2,7 +2,7 @@ class="jhlite-chip" :class="moduleClass()" :ref="el => landscapeElements.set(module.slugString(), el)" - :data-test="`${module.slugString()}-module`" + :data-testid="`${module.slugString()}-module`" @mouseover="emphasizeModule()" @mouseleave="deEmphasizeModule()" @click="clickedModule()" @@ -15,7 +15,7 @@ name="ccw" aria-label="Reapply" title="Re-apply module" - :data-test="`module-${module.slug}-application-icon`" + :data-testid="`module-${module.slug}-application-icon`" />
{{ module.operation() }}
diff --git a/src/main/webapp/app/module/primary/landscape-preset-configuration/LandscapePresetConfiguration.html b/src/main/webapp/app/module/primary/landscape-preset-configuration/LandscapePresetConfiguration.html index 9f560354b42..92910a23f1c 100644 --- a/src/main/webapp/app/module/primary/landscape-preset-configuration/LandscapePresetConfiguration.html +++ b/src/main/webapp/app/module/primary/landscape-preset-configuration/LandscapePresetConfiguration.html @@ -4,7 +4,7 @@ class="jhlite-button-main -small" @click="openPresetConfiguration" title="Show presets configurations" - data-test="show-preset-configuration-btn" + data-testid="show-preset-configuration-btn" > @@ -13,7 +13,7 @@ v-if="isPresetConfigurationOpen" @click="closePresetConfiguration" title="Hide presets configurations" - data-test="hide-preset-configuration-btn" + data-testid="hide-preset-configuration-btn" > diff --git a/src/main/webapp/app/module/primary/landscape/Landscape.html b/src/main/webapp/app/module/primary/landscape/Landscape.html index 7fada78a0c9..7a26fd98163 100644 --- a/src/main/webapp/app/module/primary/landscape/Landscape.html +++ b/src/main/webapp/app/module/primary/landscape/Landscape.html @@ -1,5 +1,5 @@ -
+
@@ -7,7 +7,7 @@ class="jhlite-button-switch" :class="modeSwitchClass('COMPACTED')" @click="selectMode('COMPACTED')" - data-test="compacted-mode-button" + data-testid="compacted-mode-button" > Compacted @@ -15,7 +15,7 @@ class="jhlite-button-switch" :class="modeSwitchClass('EXTENDED')" @click="selectMode('EXTENDED')" - data-test="extended-mode-button" + data-testid="extended-mode-button" > Extended @@ -36,7 +36,7 @@ class="jhlite-input-text" placeholder="Search modules..." @input="performSearch($event.target.value)" - data-test="landscape-search-input" + data-testid="landscape-search-input" />
@@ -46,7 +46,7 @@
@@ -95,7 +95,7 @@

{{ element.sl {{ element.sl

:placeholder="property.defaultValue" @input="setNumberProperty(property.key, $event.target.value)" :value="parameters.get(property.key)" - :data-test="`parameter-${property.key}-field`" + :data-testid="`parameter-${property.key}-field`" v-if="property.type === 'INTEGER'" />
-
Optional
+
+ Optional +
@@ -68,7 +70,7 @@

Properties

type="checkbox" id="commit-modules" @click="updateModuleCommit($event.target.checked)" - data-test="commit-module-application" + data-testid="commit-module-application" checked="checked" /> diff --git a/src/main/webapp/app/module/primary/modules-patch-loader/ModulesPatchLoader.html b/src/main/webapp/app/module/primary/modules-patch-loader/ModulesPatchLoader.html index 8aa27134194..5ad27d9dd69 100644 --- a/src/main/webapp/app/module/primary/modules-patch-loader/ModulesPatchLoader.html +++ b/src/main/webapp/app/module/primary/modules-patch-loader/ModulesPatchLoader.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/main/webapp/app/module/primary/modules-patch/ModulesPatch.html b/src/main/webapp/app/module/primary/modules-patch/ModulesPatch.html index cd793756d52..10e33d120e4 100644 --- a/src/main/webapp/app/module/primary/modules-patch/ModulesPatch.html +++ b/src/main/webapp/app/module/primary/modules-patch/ModulesPatch.html @@ -1,5 +1,5 @@ -
+
@@ -12,11 +12,11 @@ type="text" class="jhipster-modules-filters--filter" placeholder="Filter" - data-test="modules-filter-field" + data-testid="modules-filter-field" @input="updateSearch($event.target.value)" /> -
+
{{ displayedModulesCount() }} / {{ totalModulesCount() }}
@@ -31,7 +31,7 @@

{{ category.name }}

:class="moduleClass(module.slug)" @click="toggleModule(module.slug)" @keyup.enter="toggleModule(module.slug)" - :data-test="`${module.slug}-module-content`" + :data-testid="`${module.slug}-module-content`" >
{{ tag }}
@@ -61,13 +61,13 @@

{{ category.name }}

:class="moduleClass(module.slug)" :disabled="disabledApplication(module.slug)" @click="applyModule(module.slug)" - :data-test="`module-${module.slug}-application-button`" + :data-testid="`module-${module.slug}-application-button`" > - + - +
diff --git a/src/main/webapp/app/module/primary/project-actions/ProjectActions.html b/src/main/webapp/app/module/primary/project-actions/ProjectActions.html index d1c1377231f..cdcd941fd6b 100644 --- a/src/main/webapp/app/module/primary/project-actions/ProjectActions.html +++ b/src/main/webapp/app/module/primary/project-actions/ProjectActions.html @@ -3,13 +3,13 @@
-
- diff --git a/src/main/webapp/app/module/primary/tag-filter/TagFilter.html b/src/main/webapp/app/module/primary/tag-filter/TagFilter.html index b6a03f453f2..90bec3e12f2 100644 --- a/src/main/webapp/app/module/primary/tag-filter/TagFilter.html +++ b/src/main/webapp/app/module/primary/tag-filter/TagFilter.html @@ -1 +1 @@ - + diff --git a/src/main/webapp/app/shared/theme-button/infrastructure/primary/ThemeButton.vue b/src/main/webapp/app/shared/theme-button/infrastructure/primary/ThemeButton.vue index 2004b530b97..354f22cb980 100644 --- a/src/main/webapp/app/shared/theme-button/infrastructure/primary/ThemeButton.vue +++ b/src/main/webapp/app/shared/theme-button/infrastructure/primary/ThemeButton.vue @@ -6,7 +6,7 @@ type="checkbox" name="mode" :checked="!isDarkTheme" - data-test="theme-switch-button" + data-testid="theme-switch-button" @change="toggleTheme" />