Commit d5364c3c authored by Fernando's avatar Fernando

Migrate dropdown to gl-dropdown for fuzzing artifacts

* Udpate unit tests
parent cbe15fff
<script>
import { GlButton, GlDropdown, GlDeprecatedDropdownItem } from '@gitlab/ui';
import { GlButton, GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { s__ } from '~/locale';
export default {
......@@ -9,7 +9,7 @@ export default {
components: {
GlButton,
GlDropdown,
GlDeprecatedDropdownItem,
GlDropdownItem,
},
props: {
jobs: {
......@@ -46,12 +46,9 @@ export default {
category="secondary"
size="small"
>
<gl-deprecated-dropdown-item
v-for="job in jobs"
:key="job.id"
:href="artifactDownloadUrl(job)"
>{{ job.name }}</gl-deprecated-dropdown-item
>
<gl-dropdown-item v-for="job in jobs" :key="job.id" :href="artifactDownloadUrl(job)">{{
job.name
}}</gl-dropdown-item>
</gl-dropdown>
<gl-button
v-else
......
import { GlButton, GlDropdown, GlDeprecatedDropdownItem } from '@gitlab/ui';
import { GlButton, GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';
import FuzzingArtifactsDownload from 'ee/security_dashboard/components/fuzzing_artifacts_download.vue';
......@@ -60,11 +60,11 @@ describe('Filter component', () => {
it('should render a dropdown button with several items', () => {
expect(wrapper.find(GlButton).exists()).toBe(false);
expect(wrapper.find(GlDropdown).exists()).toBe(true);
expect(wrapper.findAll(GlDeprecatedDropdownItem).length).toBe(2);
expect(wrapper.findAll(GlDropdownItem).length).toBe(2);
});
it('should render with href set to the correct filepath for every element', () => {
const wrapperArray = wrapper.findAll(GlDeprecatedDropdownItem);
const wrapperArray = wrapper.findAll(GlDropdownItem);
wrapperArray.wrappers.forEach((_, index) => {
const href = `/api/v4/projects/${projectId}/jobs/artifacts/${
jobs[index].ref
......
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