Commit 83643988 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'ide-file-templates-clear' into 'master'

Fixed file templates not clearing in Web IDE

Closes #52487

See merge request gitlab-org/gitlab-ce!22357
parents 6b74baea ff55aa7e
......@@ -13,6 +13,7 @@ export default {
},
[types.SET_SELECTED_TEMPLATE_TYPE](state, type) {
state.selectedTemplateType = type;
state.templates = [];
},
[types.SET_UPDATE_SUCCESS](state, success) {
state.updateSuccess = success;
......
---
title: Clear fetched file templates when changing template type in Web IDE
merge_request:
author:
type: fixed
......@@ -49,6 +49,14 @@ describe('IDE file templates mutations', () => {
expect(state.selectedTemplateType).toBe('type');
});
it('clears templates', () => {
state.templates = ['test'];
mutations[types.SET_SELECTED_TEMPLATE_TYPE](state, 'type');
expect(state.templates).toEqual([]);
});
});
describe(types.SET_UPDATE_SUCCESS, () => {
......
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