summaryrefslogtreecommitdiff
path: root/spec/javascripts/notes/stores/actions_spec.js
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2018-03-13 13:09:37 -0500
committerClement Ho <ClemMakesApps@gmail.com>2018-03-13 13:09:37 -0500
commit736b4ecf8efa034d95923e8741fb0e31b0d15bfe (patch)
tree96ed63e408c2ac24cc704a6b5a48b3497ed01f16 /spec/javascripts/notes/stores/actions_spec.js
parent2e5de941392c8463a5e15e9f8cb3a3ab147b656d (diff)
parent8f73ddd896dad7bd66d9c96dafcc4311ce272447 (diff)
downloadgitlab-ce-add-csslab.tar.gz
Merge branch 'master' into add-csslabadd-csslab
Diffstat (limited to 'spec/javascripts/notes/stores/actions_spec.js')
-rw-r--r--spec/javascripts/notes/stores/actions_spec.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/javascripts/notes/stores/actions_spec.js b/spec/javascripts/notes/stores/actions_spec.js
index b838cc36fb3..91249b2c79e 100644
--- a/spec/javascripts/notes/stores/actions_spec.js
+++ b/spec/javascripts/notes/stores/actions_spec.js
@@ -88,6 +88,7 @@ describe('Actions Notes Store', () => {
store.dispatch('closeIssue', { notesData: { closeIssuePath: '' } })
.then(() => {
expect(store.state.noteableData.state).toEqual('closed');
+ expect(store.state.isToggleStateButtonLoading).toEqual(false);
done();
})
.catch(done.fail);
@@ -99,6 +100,7 @@ describe('Actions Notes Store', () => {
store.dispatch('reopenIssue', { notesData: { reopenIssuePath: '' } })
.then(() => {
expect(store.state.noteableData.state).toEqual('reopened');
+ expect(store.state.isToggleStateButtonLoading).toEqual(false);
done();
})
.catch(done.fail);
@@ -117,6 +119,20 @@ describe('Actions Notes Store', () => {
});
});
+ describe('toggleStateButtonLoading', () => {
+ it('should set loading as true', (done) => {
+ testAction(actions.toggleStateButtonLoading, true, {}, [
+ { type: 'TOGGLE_STATE_BUTTON_LOADING', payload: true },
+ ], done);
+ });
+
+ it('should set loading as false', (done) => {
+ testAction(actions.toggleStateButtonLoading, false, {}, [
+ { type: 'TOGGLE_STATE_BUTTON_LOADING', payload: false },
+ ], done);
+ });
+ });
+
describe('toggleIssueLocalState', () => {
it('sets issue state as closed', (done) => {
testAction(actions.toggleIssueLocalState, 'closed', {}, [