Fix select2 import for project import app namespace select

This commit is contained in:
Luke Bennett 2019-02-15 21:48:08 +00:00
parent 813df901e8
commit cf61ea1d04
No known key found for this signature in database
GPG Key ID: 402ED51FB5D306C2
2 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,6 @@
<script>
import $ from 'jquery';
import 'select2/select2';
export default {
name: 'Select2Select',

View File

@ -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';