Commit a3d9b064 authored by Eric Eastwood's avatar Eric Eastwood

Don't disable submit buttonw when there is text in the input

See https://gitlab.com/gitlab-org/gitlab-ce/issues/34336
parent c073bb77
......@@ -47,7 +47,8 @@ export default {
computed: {
isSubmitButtonDisabled() {
return this.pendingReferences.length === 0 || this.isSubmitting;
return (this.inputValue.length === 0 && this.pendingReferences.length === 0)
|| this.isSubmitting;
},
},
......
......@@ -40,6 +40,7 @@ describe('AddIssuableForm', () => {
describe('with data', () => {
describe('without references', () => {
describe('without any input text', () => {
beforeEach(() => {
vm = new AddIssuableForm({
propsData: {
......@@ -56,6 +57,23 @@ describe('AddIssuableForm', () => {
});
});
describe('with input text', () => {
beforeEach(() => {
vm = new AddIssuableForm({
propsData: {
inputValue: 'foo',
addButtonLabel: 'Submit',
pendingReferences: [],
},
}).$mount();
});
it('should not have disabled submit button', () => {
expect(vm.$refs.addButton.disabled).toBe(false);
});
});
});
describe('with references', () => {
const inputValue = 'foo #123';
const addButtonLabel = 'Add issuable';
......@@ -84,6 +102,10 @@ describe('AddIssuableForm', () => {
it('should render pending issuables items', () => {
expect(vm.$el.querySelectorAll('.js-add-issuable-form-token-list-item').length).toEqual(2);
});
it('should not have disabled submit button', () => {
expect(vm.$refs.addButton.disabled).toBe(false);
});
});
describe('when submitting', () => {
......
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