Skip to content

Commit 6874f57

Browse files
committed
feat(objectTree): Add e2e test for trees' controls
1 parent 26ff217 commit 6874f57

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

app/components/Viewer/ObjectTree/Base/Controls.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ watch(
3232
:class="{ 'is-expanded': showSearch }"
3333
>
3434
<ActionButton
35+
data-testid="searchObjectsButton"
3536
:tooltip="showSearch ? 'Hide search' : 'Show search'"
3637
icon="mdi-magnify"
3738
tooltipLocation="bottom"
@@ -43,6 +44,7 @@ watch(
4344
<v-expand-x-transition>
4445
<div v-if="showSearch" class="flex-grow-1 ms-1 text-no-wrap overflow-hidden">
4546
<SearchBar
47+
data-testid="searchObjectsInput"
4648
:model-value="search"
4749
placeholder="Search objects..."
4850
color="black"
@@ -67,6 +69,7 @@ watch(
6769
/>
6870
</v-fade-transition>
6971
<ActionButton
72+
data-testid="sortObjectsButton"
7073
:tooltip="'Sort by ' + (sortType === 'name' ? 'ID' : 'Name')"
7174
:icon="
7275
sortType === 'name' ? 'mdi-sort-alphabetical-ascending' : 'mdi-sort-numeric-ascending'
@@ -79,6 +82,7 @@ watch(
7982
<v-menu :close-on-content-click="false">
8083
<template #activator="{ props: menuProps }">
8184
<ActionButton
85+
data-testid="filterObjectsButton"
8286
tooltip="Filter options"
8387
icon="mdi-filter-variant"
8488
variant="text"
@@ -94,12 +98,14 @@ watch(
9498
:label="category_id"
9599
hide-details
96100
density="compact"
101+
:data-testid="'filterCheckbox-' + category_id"
97102
/>
98103
</v-list-item>
99104
</v-list>
100105
</v-menu>
101106
<ActionButton
102107
v-if="!isCollapsed"
108+
data-testid="collapseAllObjectsButton"
103109
tooltip="Collapse All"
104110
icon="mdi-collapse-all-outline"
105111
variant="text"
@@ -109,6 +115,7 @@ watch(
109115
/>
110116
<ActionButton
111117
v-else
118+
data-testid="expandAllObjectsButton"
112119
tooltip="Expand All"
113120
icon="mdi-expand-all-outline"
114121
variant="text"

app/components/Viewer/ObjectTree/Base/ItemLabel.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ const tooltipDisabled = computed(() => {
5050
</script>
5151

5252
<template>
53-
<div ref="label-container" class="tree-item-label-container w-100">
53+
<div
54+
ref="label-container"
55+
:data-testid="'treeRow-' + actualItem.id"
56+
class="tree-item-label-container w-100"
57+
>
5458
<v-tooltip :disabled="tooltipDisabled" location="right" open-delay="400">
5559
<template #activator="{ props: tooltipProps }">
5660
<span

0 commit comments

Comments
 (0)