Fixed loading state not showing in IDE tree list

This commit is contained in:
Phil Hughes 2018-04-17 11:57:22 +01:00
parent a56611e389
commit f39dc0ead4
No known key found for this signature in database
GPG key ID: 32245528C52E0F9F
3 changed files with 17 additions and 6 deletions

View file

@ -17,12 +17,8 @@ export default {
});
},
[types.SET_DIRECTORY_DATA](state, { data, treePath }) {
Object.assign(state, {
trees: Object.assign(state.trees, {
[treePath]: {
tree: data,
},
}),
Object.assign(state.trees[treePath], {
tree: data,
});
},
[types.SET_LAST_COMMIT_URL](state, { tree = state, url }) {

View file

@ -0,0 +1,5 @@
---
title: Fixed IDE not showing loading state when tree is loading
merge_request:
author:
type: fixed

View file

@ -55,6 +55,16 @@ describe('Multi-file store tree mutations', () => {
expect(tree.tree[1].name).toBe('submodule');
expect(tree.tree[2].name).toBe('blob');
});
it('keeps loading state', () => {
mutations.CREATE_TREE(localState, { treePath: 'project/master' });
mutations.SET_DIRECTORY_DATA(localState, {
data,
treePath: 'project/master',
});
expect(localState.trees['project/master'].loading).toBe(true);
});
});
describe('REMOVE_ALL_CHANGES_FILES', () => {