Commit 5dee6983 authored by Chad Woolley's avatar Chad Woolley

Web IDE commit sidebar should preserve action

When changing to a different view tab and back,
the Web IDE commit sidebar should preserve
the radio button
which was last selected.
parent 438e0332
......@@ -36,7 +36,9 @@ export default {
},
},
mounted() {
this.updateSelectedCommitAction();
if (!this.commitAction) {
this.updateSelectedCommitAction();
}
},
methods: {
...mapCommitActions(['updateCommitAction']),
......
export default () => ({
commitMessage: '',
commitAction: '1',
commitAction: null,
newBranchName: '',
submitCommitLoading: false,
shouldCreateMR: true,
......
......@@ -85,6 +85,13 @@ describe('IDE commit sidebar actions', () => {
expect(vm.$store.dispatch).not.toHaveBeenCalled();
});
it('is not called on mount if there is already a selected commitAction', () => {
store.state.commitAction = '1';
createComponent({ currentBranchId: null });
expect(vm.$store.dispatch).not.toHaveBeenCalled();
});
it('calls again after staged changes', done => {
createComponent({ currentBranchId: null });
......
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