Commit efd7dde9 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Minor fix modal button variant

parent 7260ed2b
...@@ -86,7 +86,6 @@ export default { ...@@ -86,7 +86,6 @@ export default {
onSubmit() { onSubmit() {
const { name } = this; const { name } = this;
return this.createValueStream({ name }).then(() => { return this.createValueStream({ name }).then(() => {
this.$refs.modal.hide();
this.$toast.show(sprintf(__("'%{name}' Value Stream created"), { name }), { this.$toast.show(sprintf(__("'%{name}' Value Stream created"), { name }), {
position: 'top-center', position: 'top-center',
}); });
...@@ -141,7 +140,7 @@ export default { ...@@ -141,7 +140,7 @@ export default {
:action-primary="{ :action-primary="{
text: __('Create value stream'), text: __('Create value stream'),
attributes: [ attributes: [
{ variant: 'primary' }, { variant: 'success' },
{ {
disabled: !isValid, disabled: !isValid,
}, },
......
...@@ -13,7 +13,6 @@ describe('ValueStreamSelect', () => { ...@@ -13,7 +13,6 @@ describe('ValueStreamSelect', () => {
const createValueStreamMock = jest.fn(() => Promise.resolve()); const createValueStreamMock = jest.fn(() => Promise.resolve());
const mockEvent = { preventDefault: jest.fn() }; const mockEvent = { preventDefault: jest.fn() };
const mockModalHide = jest.fn();
const mockToastShow = jest.fn(); const mockToastShow = jest.fn();
const fakeStore = ({ initialState = {} }) => const fakeStore = ({ initialState = {} }) =>
...@@ -110,7 +109,6 @@ describe('ValueStreamSelect', () => { ...@@ -110,7 +109,6 @@ describe('ValueStreamSelect', () => {
beforeEach(() => { beforeEach(() => {
wrapper = createComponent({ data: { name: streamName } }); wrapper = createComponent({ data: { name: streamName } });
wrapper.vm.$refs.modal.hide = mockModalHide;
}); });
it('submit button is enabled', () => { it('submit button is enabled', () => {
...@@ -135,10 +133,6 @@ describe('ValueStreamSelect', () => { ...@@ -135,10 +133,6 @@ describe('ValueStreamSelect', () => {
position: 'top-center', position: 'top-center',
}); });
}); });
it('hides the modal', () => {
expect(mockModalHide).toHaveBeenCalled();
});
}); });
describe('form submission fails', () => { describe('form submission fails', () => {
...@@ -151,7 +145,6 @@ describe('ValueStreamSelect', () => { ...@@ -151,7 +145,6 @@ describe('ValueStreamSelect', () => {
createValueStream: () => createValueStreamMockFail, createValueStream: () => createValueStreamMockFail,
}, },
}); });
wrapper.vm.$refs.modal.hide = mockModalHide;
}); });
it('does not clear the name field', () => { it('does not clear the name field', () => {
...@@ -161,10 +154,6 @@ describe('ValueStreamSelect', () => { ...@@ -161,10 +154,6 @@ describe('ValueStreamSelect', () => {
it('does not display a toast message', () => { it('does not display a toast message', () => {
expect(mockToastShow).not.toHaveBeenCalled(); expect(mockToastShow).not.toHaveBeenCalled();
}); });
it('does not hide the modal', () => {
expect(mockModalHide).not.toHaveBeenCalled();
});
}); });
}); });
}); });
......
...@@ -70,7 +70,7 @@ describe('Cycle analytics mutations', () => { ...@@ -70,7 +70,7 @@ describe('Cycle analytics mutations', () => {
'$mutation with payload $payload will update state with $expectedState', '$mutation with payload $payload will update state with $expectedState',
({ mutation, payload, expectedState }) => { ({ mutation, payload, expectedState }) => {
state = { state = {
valueStreams, valueStreams,
selectedGroup: { fullPath: 'rad-stage' }, selectedGroup: { fullPath: 'rad-stage' },
}; };
mutations[mutation](state, payload); mutations[mutation](state, payload);
......
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