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:
authorConstance Okoghenun <constanceokoghenun@gmail.com>2019-02-18 10:16:13 +0300
committerConstance Okoghenun <constanceokoghenun@gmail.com>2019-02-18 10:16:13 +0300
commit5e137b58ca15f224a3b1b05999e6e689b463417a (patch)
tree6e76bdb0c5ef988cdb15172a580a56204f8fe404 /spec/javascripts/notes
parent10094950bd5c7adff6888a7835f098a759af5ba4 (diff)
Cancelling reply reverts comment to initial state
When converting a comment to a discussion if the "Cancel" button is used to exit the new discussion note, the comment would revert back to its initial state
Diffstat (limited to 'spec/javascripts/notes')
-rw-r--r--spec/javascripts/notes/stores/actions_spec.js14
-rw-r--r--spec/javascripts/notes/stores/mutation_spec.js19
2 files changed, 33 insertions, 0 deletions
diff --git a/spec/javascripts/notes/stores/actions_spec.js b/spec/javascripts/notes/stores/actions_spec.js
index 4f70570ffcc..94ce6d8e222 100644
--- a/spec/javascripts/notes/stores/actions_spec.js
+++ b/spec/javascripts/notes/stores/actions_spec.js
@@ -737,4 +737,18 @@ describe('Actions Notes Store', () => {
);
});
});
+
+ describe('removeConvertedDiscussion', () => {
+ it('commits CONVERT_TO_DISCUSSION with noteId', done => {
+ const noteId = 'dummy-id';
+ testAction(
+ actions.removeConvertedDiscussion,
+ noteId,
+ {},
+ [{ type: 'REMOVE_CONVERTED_DISCUSSION', payload: noteId }],
+ [],
+ done,
+ );
+ });
+ });
});
diff --git a/spec/javascripts/notes/stores/mutation_spec.js b/spec/javascripts/notes/stores/mutation_spec.js
index 88c40dbc5ea..fcad1f245b6 100644
--- a/spec/javascripts/notes/stores/mutation_spec.js
+++ b/spec/javascripts/notes/stores/mutation_spec.js
@@ -536,4 +536,23 @@ describe('Notes Store mutations', () => {
expect(state.convertedDisscussionIds).toContain(discussion.id);
});
});
+
+ describe('REMOVE_CONVERTED_DISCUSSION', () => {
+ let discussion;
+ let state;
+
+ beforeEach(() => {
+ discussion = {
+ id: 42,
+ individual_note: true,
+ };
+ state = { convertedDisscussionIds: [41, 42] };
+ });
+
+ it('removes a disucssion from convertedDisscussionIds', () => {
+ mutations.REMOVE_CONVERTED_DISCUSSION(state, discussion.id);
+
+ expect(state.convertedDisscussionIds).not.toContain(discussion.id);
+ });
+ });
});