diff options
-rw-r--r-- | app/assets/javascripts/vue_shared/components/select2_select.vue | 1 | ||||
-rw-r--r-- | spec/javascripts/import_projects/components/provider_repo_table_row_spec.js | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/components/select2_select.vue b/app/assets/javascripts/vue_shared/components/select2_select.vue index 19c5da0461a..3074ea859cc 100644 --- a/app/assets/javascripts/vue_shared/components/select2_select.vue +++ b/app/assets/javascripts/vue_shared/components/select2_select.vue @@ -1,5 +1,6 @@ <script> import $ from 'jquery'; +import 'select2/select2'; export default { name: 'Select2Select', diff --git a/spec/javascripts/import_projects/components/provider_repo_table_row_spec.js b/spec/javascripts/import_projects/components/provider_repo_table_row_spec.js index 7191fc923ce..69377f8d685 100644 --- a/spec/javascripts/import_projects/components/provider_repo_table_row_spec.js +++ b/spec/javascripts/import_projects/components/provider_repo_table_row_spec.js @@ -49,6 +49,19 @@ describe('ProviderRepoTableRow', () => { expect(vm.$el.querySelector('.js-import-button')).not.toBeNull(); }); + it('renders a select2 namespace select', () => { + vm = createComponent(); + + const dropdownTrigger = vm.$el.querySelector('.js-namespace-select'); + + expect(dropdownTrigger).not.toBeNull(); + expect(dropdownTrigger.classList.contains('select2-container')).toBe(true); + + dropdownTrigger.click(); + + expect(vm.$el.querySelector('.select2-drop')).not.toBeNull(); + }); + it('imports repo when clicking import button', done => { const importPath = '/import-path'; const defaultTargetNamespace = 'user'; |