Commit 6e2b5a5a authored by Mike Greiling's avatar Mike Greiling

Merge branch 'cngo-remove-refs-from-environment_picker' into 'master'

Remove refs from environment_picker.vue

See merge request gitlab-org/gitlab!54915
parents 2bd43220 b176818d
...@@ -42,7 +42,6 @@ export default { ...@@ -42,7 +42,6 @@ export default {
> >
<gl-dropdown <gl-dropdown
:id="$options.environmentFilterId" :id="$options.environmentFilterId"
ref="environmentsDropdown"
class="gl-display-flex" class="gl-display-flex"
toggle-class="gl-truncate" toggle-class="gl-truncate"
:text="environmentName" :text="environmentName"
...@@ -51,16 +50,12 @@ export default { ...@@ -51,16 +50,12 @@ export default {
<gl-dropdown-item <gl-dropdown-item
v-for="environment in environments" v-for="environment in environments"
:key="environment.id" :key="environment.id"
ref="environmentsDropdownItem"
@click="setCurrentEnvironmentId(environment.id)" @click="setCurrentEnvironmentId(environment.id)"
>{{ environment.name }}</gl-dropdown-item >{{ environment.name }}</gl-dropdown-item
> >
<gl-dropdown-item <gl-dropdown-item v-if="includeAll" @click="setAllEnvironments">{{
v-if="includeAll" $options.ALL_ENVIRONMENT_NAME
ref="environmentsDropdownItem" }}</gl-dropdown-item>
@click="setAllEnvironments"
>{{ $options.ALL_ENVIRONMENT_NAME }}</gl-dropdown-item
>
</gl-dropdown> </gl-dropdown>
</gl-form-group> </gl-form-group>
</template> </template>
import { GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import EnvironmentPicker from 'ee/threat_monitoring/components/environment_picker.vue'; import EnvironmentPicker from 'ee/threat_monitoring/components/environment_picker.vue';
import { import {
...@@ -25,8 +26,8 @@ describe('EnvironmentPicker component', () => { ...@@ -25,8 +26,8 @@ describe('EnvironmentPicker component', () => {
}); });
}; };
const findEnvironmentsDropdown = () => wrapper.find({ ref: 'environmentsDropdown' }); const findEnvironmentsDropdown = () => wrapper.findComponent(GlDropdown);
const findEnvironmentsDropdownItems = () => wrapper.findAll({ ref: 'environmentsDropdownItem' }); const findEnvironmentsDropdownItems = () => wrapper.findAllComponents(GlDropdownItem);
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment