Commit aee1b3f3 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'cwoolley-commit-sidebar-actions-fix' into 'master'

Web IDE commit sidebar should preserve action

Closes #212276

See merge request gitlab-org/gitlab!27876
parents b120d2da 5dee6983
......@@ -36,7 +36,9 @@ export default {
},
},
mounted() {
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