Skip to content

Commit c528593

Browse files
authored
Merge pull request #430 from Geode-solutions/fix/tests_e2e_points_size
Fix/tests e2e points size
2 parents 26ff217 + f2417da commit c528593

29 files changed

Lines changed: 114 additions & 64 deletions

app/components/CameraManager/List.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function saveRename() {
5454
color="success"
5555
size="x-small"
5656
class="mr-1"
57-
:data-testid="'restoreCameraPosition' + position.name + 'Button'"
57+
:data-testid="`restoreCameraPosition${position.name}Button`"
5858
@click="restorePosition(position.id)"
5959
>
6060
<v-icon size="14">mdi-play</v-icon>

app/components/CameraOrientation.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ watch(hoveredFace, (newFace, oldFace) => {
212212
size="32"
213213
class="satellite-node position-absolute"
214214
:style="orientation.position"
215-
:data-testid="'cameraOrientation' + orientation.vtkKey + 'Button'"
215+
:data-testid="`cameraOrientation${orientation.vtkKey}Button`"
216216
@mouseenter="hoveredFace = orientation.face"
217217
@mouseleave="hoveredFace = undefined"
218218
@click.stop="emit('select', orientation.value)"
@@ -242,7 +242,7 @@ watch(hoveredFace, (newFace, oldFace) => {
242242
size="32"
243243
variant="text"
244244
class="ma-1"
245-
:data-testid="'cameraOrientation' + orientation.vtkKey + 'Button'"
245+
:data-testid="`cameraOrientation${orientation.vtkKey}Button`"
246246
@mouseenter="hoveredFace = orientation.face"
247247
@mouseleave="hoveredFace = undefined"
248248
@click.stop="emit('select', orientation.value)"

app/components/FileUploader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ watch(
129129
/>
130130
<DragAndDrop
131131
ref="dragAndDropRef"
132-
class="d-none"
133132
:multiple
134133
:accept
134+
:inline="false"
135135
@files-selected="processSelectedFiles"
136136
/>
137137
</template>

app/components/HybridRenderingView.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,13 @@ async function handleClick(event) {
9595
</ClientOnly>
9696
</template>
9797
98-
<style scoped>
99-
:deep(img) {
100-
pointer-events: none;
98+
<style>
99+
[data-testid="hybridViewer"] img {
100+
pointer-events: none !important;
101101
}
102+
</style>
103+
104+
<style scoped>
102105
.picking-cursor {
103106
cursor: crosshair !important;
104107
}

app/components/HybridViewerTooltip.vue

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ const originalIndex = computed(() => {
6363
}
6464
return Math.floor(Number(originalId));
6565
});
66+
const RESERVED_ATTRIBUTE_KEYS = new Set([
67+
"coordinates",
68+
"vtkOriginalCellIds",
69+
"vtkOriginalPointIds",
70+
]);
6671
6772
const hasOtherAttributes = computed(() => {
6873
const attributes = hybridViewerStore.hoverData?.attributes || {};
@@ -71,6 +76,16 @@ const hasOtherAttributes = computed(() => {
7176
);
7277
});
7378
79+
const sortedAttributes = computed(() => {
80+
const attributes = hybridViewerStore.hoverData?.attributes || {};
81+
return (
82+
Object.entries(attributes)
83+
.filter(([key]) => !RESERVED_ATTRIBUTE_KEYS.has(key))
84+
// oxlint-disable-next-line unicorn/no-array-sort
85+
.sort(([keyA], [keyB]) => keyA.localeCompare(keyB))
86+
);
87+
});
88+
7489
function capitalize(val) {
7590
if (!val) {
7691
return "";
@@ -156,15 +171,8 @@ function formatAttributeValue(val) {
156171
{{ Number(hybridViewerStore.hoverData.attributes.coordinates[2]).toFixed(3) }} ]
157172
</span>
158173
</v-col>
159-
<template v-for="(val, name) in hybridViewerStore.hoverData.attributes" :key="name">
160-
<v-col
161-
v-if="
162-
name !== 'coordinates' &&
163-
name !== 'vtkOriginalCellIds' &&
164-
name !== 'vtkOriginalPointIds'
165-
"
166-
class="d-flex justify-space-between ga-3"
167-
>
174+
<template v-for="[name, val] in sortedAttributes" :key="name">
175+
<v-col class="d-flex justify-space-between ga-3">
168176
<span class="tooltip-label">{{ capitalize(name) }}:</span>
169177
<span class="tooltip-value font-mono">
170178
{{ formatAttributeValue(val) }}
@@ -183,7 +191,7 @@ function formatAttributeValue(val) {
183191
pointer-events: none;
184192
z-index: 4;
185193
min-width: 200px;
186-
max-width: 450px;
194+
max-width: max-content;
187195
transition: opacity 0.15s ease;
188196
}
189197
.font-mono {
@@ -197,10 +205,12 @@ function formatAttributeValue(val) {
197205
.tooltip-label {
198206
color: #bdbdbd;
199207
font-weight: bold;
208+
white-space: nowrap;
200209
}
201210
.tooltip-value {
202211
color: #a7ffeb;
203212
font-weight: 500;
213+
white-space: nowrap;
204214
}
205215
.tooltip-value-dim {
206216
color: #eeeeee;

app/components/Screenshot.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ watch(screenshot_type, (value) => {
102102
File
103103
</v-btn>
104104
<v-btn
105+
data-testid="screenshotClipboardButton"
105106
value="clipboard"
106107
prepend-icon="mdi-content-copy"
107108
size="small"
108-
data-testid="screenshotClipboardButton"
109109
class="text-caption text-none"
110110
>
111111
Clipboard
@@ -117,11 +117,11 @@ watch(screenshot_type, (value) => {
117117
<v-row dense v-if="screenshot_type === 'file'">
118118
<v-col cols="12" class="py-1">
119119
<v-text-field
120+
data-testid="screenshotFileNameInput"
120121
v-model="filename"
121122
label="File name"
122123
variant="outlined"
123124
density="compact"
124-
data-testid="screenshotFileNameInput"
125125
hide-details
126126
class="text-caption"
127127
></v-text-field>
@@ -144,10 +144,10 @@ watch(screenshot_type, (value) => {
144144
<v-row dense>
145145
<v-col cols="12" class="py-1">
146146
<v-switch
147+
data-testid="screenshotIncludeBackgroundSwitch"
147148
v-model="include_background"
148149
:disabled="screenshot_type === 'file' && output_extension !== 'png'"
149150
label="Include background"
150-
data-testid="screenshotIncludeBackgroundSwitch"
151151
density="compact"
152152
hide-details
153153
inset
@@ -170,10 +170,10 @@ watch(screenshot_type, (value) => {
170170
Cancel
171171
</v-btn>
172172
<v-btn
173+
data-testid="screenshotActionButton"
173174
variant="outlined"
174175
size="small"
175176
class="text-caption text-none"
176-
data-testid="screenshotActionButton"
177177
:disabled="(screenshot_type === 'file' && !filename) || !output_extension"
178178
color="white"
179179
@click="takeScreenshot()"

app/components/ViewToolbar.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ const camera_options = computed(() => [
6262
menu: [
6363
{
6464
title: "Cells",
65-
icon: "mdi-select-all",
6665
testId: "highlightOnHoverCellsButton",
66+
icon: "mdi-select-all",
6767
action: () => {
6868
if (
6969
hybridViewerStore.is_hover_highlight &&
@@ -79,8 +79,8 @@ const camera_options = computed(() => [
7979
},
8080
{
8181
title: "Points",
82-
icon: "mdi-select-drag",
8382
testId: "highlightOnHoverPointsButton",
83+
icon: "mdi-select-drag",
8484
action: () => {
8585
if (
8686
hybridViewerStore.is_hover_highlight &&
@@ -180,9 +180,9 @@ const camera_options = computed(() => [
180180
<v-row dense>
181181
<v-col v-for="item in camera_option.menu" :key="item.title">
182182
<ActionButton
183+
:data-testid="item.testId"
183184
:icon="item.icon"
184185
:tooltip="item.title"
185-
:data-testid="item.testId"
186186
:color="
187187
hybridViewerStore.is_hover_highlight &&
188188
hybridViewerStore.hover_highlight_field_type ===

app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const edge_attribute_color_map = computed({
121121
<ViewerOptionsVisibilitySwitch data-testid="meshEdgesVisibilitySwitch" v-model="visibility" />
122122
<template v-if="visibility">
123123
<v-divider class="my-2" />
124-
<ViewerOptionsWidthSlider v-model="width" />
124+
<ViewerOptionsWidthSlider data-testid="meshEdgesWidthSlider" v-model="width" />
125125
<ViewerOptionsColoringTypeSelector
126126
:id="id"
127127
v-model:coloring_style_key="coloring_style_key"

app/components/Viewer/Generic/Mesh/CellsOptions.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ const cell_attribute_color_map = computed({
121121
<template #options>
122122
<ViewerOptionsVisibilitySwitch data-testid="meshCellsVisibilitySwitch" v-model="visibility" />
123123
<template v-if="visibility">
124+
<v-divider />
124125
<ViewerOptionsColoringTypeSelector
125126
:id="id"
126127
v-model:coloring_style_key="coloring_style_key"

app/components/Viewer/Generic/Mesh/EdgesOptions.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@ const color = computed({
6666
:btnImage="btnImage"
6767
>
6868
<template #options>
69-
<ViewerOptionsVisibilitySwitch data-testid="meshEdgesVisibilitySwitch" v-model="visibility" />
69+
<v-row>
70+
<v-col>
71+
<ViewerOptionsVisibilitySwitch
72+
data-testid="meshEdgesVisibilitySwitch"
73+
v-model="visibility"
74+
/>
75+
</v-col>
76+
</v-row>
7077
<template v-if="visibility">
7178
<v-divider class="my-2" />
7279
<ViewerOptionsWidthSlider data-testid="meshEdgesWidthSlider" v-model="size" />

0 commit comments

Comments
 (0)