Commit 04dc4bfc authored by Phil Hughes's avatar Phil Hughes

fixed assignee_select_spec.js

parent 6b827a5c
/* global BoardService */
import MockAdapter from 'axios-mock-adapter';
import Vue from 'vue';
import axios from '~/lib/utils/axios_utils';
import AssigneeSelect from '~/boards/components/assignee_select.vue';
import '~/boards/services/board_service';
import '~/boards/stores/boards_store';
......@@ -86,12 +87,18 @@ describe('Assignee select component', () => {
});
describe('clicking dropdown items', () => {
let mock;
beforeEach(() => {
const deferred = new jQuery.Deferred();
spyOn($, 'ajax').and.returnValue(deferred.resolve([
mock = new MockAdapter(axios);
mock.onGet('/autocomplete/users.json').reply(200, [
assignee,
assignee2,
]));
]);
});
afterEach(() => {
mock.restore();
});
it('sets assignee', (done) => {
......@@ -99,7 +106,6 @@ describe('Assignee select component', () => {
setTimeout(() => {
vm.$el.querySelectorAll('li a')[2].click();
});
setTimeout(() => {
expect(activeDropdownItem(0)).toEqual('second assignee');
......@@ -109,4 +115,5 @@ describe('Assignee select component', () => {
});
});
});
});
});
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