summaryrefslogtreecommitdiff
path: root/spec/javascripts/notes
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-07-10 12:05:06 +0100
committerFilipa Lacerda <filipa@gitlab.com>2018-07-10 18:11:19 +0100
commit135ead1d83d774a1bc0ed3ed947896b64d1755aa (patch)
tree7625ab36e07b70af088d5584bc5fd082b857d77f /spec/javascripts/notes
parentac71675d3096ac9317ea230a408d69029bdadc73 (diff)
parentf3edbafe6310ca1584002b8a351048a3fb3309e3 (diff)
downloadgitlab-ce-135ead1d83d774a1bc0ed3ed947896b64d1755aa.tar.gz
Merge branch 'master' into 48237-toggle-file-comments
* master: (38 commits) Update bitbucket.md to fix typo and small grammar touchups. Update time_helper.rb to fix output for exact minutes. Document update for GitLab Pages users. Support manually stopping any environment from the UI Fix link to frontend in handbook Shorten CHANGELOG filename to avoid breaking ecryptfs users Replace 48976-rails5-invalid-single-table-inheritance-type-group-is-not-a-subclass-of-gitlab-backgroundmigration-fixcrossprojectlabellinks-namespace.yml Fix mountComponent helper path in docs Fix #48537 - Update avatar only via the projects API Add additional headline for Adding SSH keys to GitLab Request to be a proofreader. Fix specs Fix search bar text input alignment Fix API docs on unauthenticated projects return Adds with_projects optional parameter to /groups/:id API endpoint Docs: make it clear that you need a completely separate domain for Pages Document that we don't want to wait in tests Removes unused store in diffs mr refactor Removes double export for actions in diffs module in mr refactor Remove useless return Use latest gitlab-styles ...
Diffstat (limited to 'spec/javascripts/notes')
-rw-r--r--spec/javascripts/notes/stores/actions_spec.js13
-rw-r--r--spec/javascripts/notes/stores/mutation_spec.js14
2 files changed, 27 insertions, 0 deletions
diff --git a/spec/javascripts/notes/stores/actions_spec.js b/spec/javascripts/notes/stores/actions_spec.js
index 71ef3aa9b03..b66e8e1ceb3 100644
--- a/spec/javascripts/notes/stores/actions_spec.js
+++ b/spec/javascripts/notes/stores/actions_spec.js
@@ -128,6 +128,19 @@ describe('Actions Notes Store', () => {
});
});
+ describe('collapseDiscussion', () => {
+ it('should commit collapse discussion', done => {
+ testAction(
+ actions.collapseDiscussion,
+ { discussionId: discussionMock.id },
+ { notes: [discussionMock] },
+ [{ type: 'COLLAPSE_DISCUSSION', payload: { discussionId: discussionMock.id } }],
+ [],
+ done,
+ );
+ });
+ });
+
describe('async methods', () => {
const interceptor = (request, next) => {
next(
diff --git a/spec/javascripts/notes/stores/mutation_spec.js b/spec/javascripts/notes/stores/mutation_spec.js
index ccc7328447b..a15ff1a5888 100644
--- a/spec/javascripts/notes/stores/mutation_spec.js
+++ b/spec/javascripts/notes/stores/mutation_spec.js
@@ -74,6 +74,20 @@ describe('Notes Store mutations', () => {
});
});
+ describe('COLLAPSE_DISCUSSION', () => {
+ it('should collpase an expanded discussion', () => {
+ const discussion = Object.assign({}, discussionMock, { expanded: true });
+
+ const state = {
+ discussions: [discussion],
+ };
+
+ mutations.COLLAPSE_DISCUSSION(state, { discussionId: discussion.id });
+
+ expect(state.discussions[0].expanded).toEqual(false);
+ });
+ });
+
describe('REMOVE_PLACEHOLDER_NOTES', () => {
it('should remove all placeholder notes in indivudal notes and discussion', () => {
const placeholderNote = Object.assign({}, individualNote, { isPlaceholderNote: true });