summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-10-03 14:22:52 +0000
committerPhil Hughes <me@iamphill.com>2018-10-03 14:22:52 +0000
commitf4db21eb22eeb9e07a9f5850d496570992f6d1f9 (patch)
treed0f6189f0dad4bea314972034d1986815445a629 /spec/javascripts
parentcf26610f0372b89f34f1daba7f5279b95e0da5ff (diff)
parente3b96ad76bfc1a64218abb731029bd95584abe7f (diff)
downloadgitlab-ce-f4db21eb22eeb9e07a9f5850d496570992f6d1f9.tar.gz
Merge branch '_acet-fix-placeholder-note' into 'master'
Fix placeholder note rendering. Closes #48933 See merge request gitlab-org/gitlab-ce!22078
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/notes/components/noteable_discussion_spec.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/javascripts/notes/components/noteable_discussion_spec.js b/spec/javascripts/notes/components/noteable_discussion_spec.js
index 2a01bd85520..40b5f009ceb 100644
--- a/spec/javascripts/notes/components/noteable_discussion_spec.js
+++ b/spec/javascripts/notes/components/noteable_discussion_spec.js
@@ -133,4 +133,29 @@ describe('noteable_discussion component', () => {
});
});
});
+
+ describe('componentData', () => {
+ it('should return first note object for placeholder note', () => {
+ const data = {
+ isPlaceholderNote: true,
+ notes: [
+ { body: 'hello world!' },
+ ],
+ };
+
+ const note = vm.componentData(data);
+ expect(note).toEqual(data.notes[0]);
+ });
+
+ it('should return given note for nonplaceholder notes', () => {
+ const data = {
+ notes: [
+ { id: 12 },
+ ],
+ };
+
+ const note = vm.componentData(data);
+ expect(note).toEqual(data);
+ });
+ });
});