Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/diffs/store/mutations_spec.js')
-rw-r--r--spec/frontend/diffs/store/mutations_spec.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/frontend/diffs/store/mutations_spec.js b/spec/frontend/diffs/store/mutations_spec.js
index 274cb40dac8..e87c5d0a9b1 100644
--- a/spec/frontend/diffs/store/mutations_spec.js
+++ b/spec/frontend/diffs/store/mutations_spec.js
@@ -684,6 +684,36 @@ describe('DiffsStoreMutations', () => {
});
});
+ describe('TREE_ENTRY_DIFF_LOADING', () => {
+ it('sets the entry loading state to true by default', () => {
+ const state = {
+ treeEntries: {
+ path: {
+ diffLoading: false,
+ },
+ },
+ };
+
+ mutations[types.TREE_ENTRY_DIFF_LOADING](state, { path: 'path' });
+
+ expect(state.treeEntries.path.diffLoading).toBe(true);
+ });
+
+ it('sets the entry loading state to the provided value', () => {
+ const state = {
+ treeEntries: {
+ path: {
+ diffLoading: true,
+ },
+ },
+ };
+
+ mutations[types.TREE_ENTRY_DIFF_LOADING](state, { path: 'path', loading: false });
+
+ expect(state.treeEntries.path.diffLoading).toBe(false);
+ });
+ });
+
describe('SET_SHOW_TREE_LIST', () => {
it('sets showTreeList', () => {
const state = createState();