Commit b7d43f5f authored by Simon Knox's avatar Simon Knox

fix autocomplete spec

parent aa36924a
......@@ -121,6 +121,48 @@ describe('AddIssuableForm', () => {
});
});
describe('autocomplete', () => {
describe('with autoCompleteSources', () => {
beforeEach(() => {
vm = new AddIssuableForm({
propsData: {
inputValue: '',
autoCompleteSources: {
issues: '/fake/issues/path',
},
},
}).$mount();
});
it('shows placeholder text', () => {
expect(vm.$refs.input.placeholder).toEqual('Paste issue link or <#issue id>');
});
it('has GfmAutoComplete', () => {
expect(vm.gfmAutoComplete).toBeDefined();
});
});
describe('with autoCompleteSources', () => {
beforeEach(() => {
vm = new AddIssuableForm({
propsData: {
inputValue: '',
autoCompleteSources: {},
},
}).$mount();
});
it('shows placeholder text', () => {
expect(vm.$refs.input.placeholder).toEqual('Paste issue link');
});
it('does not have GfmAutoComplete', () => {
expect(vm.gfmAutoComplete).not.toBeDefined();
});
});
});
describe('methods', () => {
let addIssuableFormInputSpy;
let addIssuableFormBlurSpy;
......@@ -147,6 +189,9 @@ describe('AddIssuableForm', () => {
pendingIssuables: [
issuable1,
],
autoCompleteSources: {
issues: '/fake/issues/path',
},
},
}).$mount(el);
});
......
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