diff options
Diffstat (limited to 'spec/frontend/confidential_merge_request/components/dropdown_spec.js')
-rw-r--r-- | spec/frontend/confidential_merge_request/components/dropdown_spec.js | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/spec/frontend/confidential_merge_request/components/dropdown_spec.js b/spec/frontend/confidential_merge_request/components/dropdown_spec.js index 3e95cd6c0d7..401948e24e4 100644 --- a/spec/frontend/confidential_merge_request/components/dropdown_spec.js +++ b/spec/frontend/confidential_merge_request/components/dropdown_spec.js @@ -1,5 +1,5 @@ import { mount } from '@vue/test-utils'; -import { GlDeprecatedDropdownItem } from '@gitlab/ui'; +import { GlDropdown, GlDropdownItem } from '@gitlab/ui'; import Dropdown from '~/confidential_merge_request/components/dropdown.vue'; let vm; @@ -30,27 +30,18 @@ describe('Confidential merge request project dropdown component', () => { }, ]); - expect(vm.findAll(GlDeprecatedDropdownItem).length).toBe(2); + expect(vm.findAll(GlDropdownItem).length).toBe(2); }); - it('renders selected project icon', () => { - factory([ - { - id: 1, - name: 'test', - }, - { - id: 2, - name: 'test 2', - }, - ]); + it('shows lock icon', () => { + factory(); + + expect(vm.find(GlDropdown).props('icon')).toBe('lock'); + }); + + it('has dropdown text', () => { + factory(); - expect(vm.find('.js-active-project-check').classes()).not.toContain('icon'); - expect( - vm - .findAll('.js-active-project-check') - .at(1) - .classes(), - ).toContain('icon'); + expect(vm.find(GlDropdown).props('text')).toBe('Select private project'); }); }); |