app/frontend/comments/comment_thread.component.test.jsx in decidim-comments-0.0.1 vs app/frontend/comments/comment_thread.component.test.jsx in decidim-comments-0.0.2

- old
+ new

@@ -46,11 +46,11 @@ }); }); describe("when comment does have replies", () => { beforeEach(() => { - comment.replies = generateCommentsData(3); + comment.hasReplies = true; }); it("should render a h6 comment-thread__title with author name", () => { const wrapper = shallow(<CommentThread comment={comment} currentUser={currentUser} />); expect(wrapper.find('h6.comment-thread__title')).to.have.text(`Conversation with ${comment.author.name}`); @@ -64,8 +64,18 @@ }); it("and pass filter comment data as a prop to it", () => { const wrapper = shallow(<CommentThread comment={comment} currentUser={currentUser} />); expect(wrapper.find(Comment).first()).to.have.prop("comment").deep.equal(filter(commentFragment, comment)); - }); - }); + }); + + it("and pass the votable as a prop to it", () => { + const wrapper = shallow(<CommentThread comment={comment} currentUser={currentUser} votable />); + expect(wrapper.find(Comment).first()).to.have.prop("votable").equal(true); + }); + + it("and pass the isRootComment equal true", () => { + const wrapper = shallow(<CommentThread comment={comment} currentUser={currentUser} votable isRootComment />); + expect(wrapper.find(Comment).first()).to.have.prop("isRootComment").equal(true); + }); + }); });