Skip to content

Commit 94e6427

Browse files
committed
Enforce unique ids for multiselect fields, fix test
1 parent f8ab2cd commit 94e6427

3 files changed

Lines changed: 28 additions & 7 deletions

File tree

client/src/components/Form/Elements/FormSelect.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { computed, type ComputedRef, onMounted, watch } from "vue";
33
import Multiselect from "vue-multiselect";
44
55
import { useMultiselect } from "@/composables/useMultiselect";
6+
import { uid } from "@/utils/utils";
67
78
type SelectValue = string | number | null;
89
const { ariaExpanded, onOpen, onClose } = useMultiselect();
@@ -14,12 +15,14 @@ interface SelectOption {
1415
1516
const props = withDefaults(
1617
defineProps<{
18+
id?: string;
1719
multiple?: boolean;
1820
optional?: boolean;
1921
options: Array<[string, SelectValue]>;
2022
value?: Array<SelectValue> | string | number;
2123
}>(),
2224
{
25+
id: `form-select-${uid()}`,
2326
multiple: false,
2427
optional: false,
2528
value: null,
@@ -143,6 +146,7 @@ onMounted(() => {
143146
<template>
144147
<Multiselect
145148
v-if="hasOptions"
149+
:id="id"
146150
v-model="currentValue"
147151
:allow-empty="true"
148152
:class="['form-select', cls]"

client/src/components/Upload/UploadSettingsSelect.vue

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,29 @@
22
import { computed } from "vue";
33
import Multiselect from "vue-multiselect";
44
5+
import { uid } from "@/utils/utils";
6+
57
const props = defineProps({
6-
disabled: Boolean,
7-
options: Array,
8-
placeholder: String,
9-
value: String,
8+
id: {
9+
type: String,
10+
default: `upload-settings-select-${uid()}`,
11+
},
12+
disabled: {
13+
type: Boolean,
14+
default: false,
15+
},
16+
options: {
17+
type: Array,
18+
required: true,
19+
},
20+
placeholder: {
21+
type: String,
22+
default: "",
23+
},
24+
value: {
25+
type: String,
26+
default: null,
27+
},
1028
});
1129
1230
const emit = defineEmits(["input"]);
@@ -21,6 +39,7 @@ const currentValue = computed({
2139

2240
<template>
2341
<Multiselect
42+
:id="id"
2443
v-model="currentValue"
2544
class="upload-settings-select rounded"
2645
deselect-label=""

lib/galaxy_test/selenium/test_library_contents.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ def download_dataset_from_library(self):
105105
def test_delete_dataset(self):
106106
self.test_import_dataset_from_history()
107107

108-
self.sleep_for(self.wait_types.UX_RENDER)
109-
# assert "you must select at least one" modal
110-
assert self.components.libraries.folder.toast_msg.is_displayed
108+
self.components.libraries.folder.toast_msg.wait_for_visible()
111109

112110
self.components.libraries.folder.delete_btn.wait_for_and_click()
113111

0 commit comments

Comments
 (0)