Skip to content

Commit

Permalink
Merge branch 'fix-email-comments' into add-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettbryan committed Feb 21, 2019
2 parents 3808685 + 1a22ae2 commit 15565ab
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/component/comment.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import { shallow } from 'enzyme'
import { shallow, mount } from 'enzyme'
import sinon from 'sinon'

import Comment from './comment'
import Avatar from './avatar'
Expand Down Expand Up @@ -74,12 +75,16 @@ const emailComment = {
}

describe('Comment', function () {
it('render extended emailed comment', function () {
it('render extended emailed comment and add event listener', function () {
// let ref = null
const props = {
comment: emailComment
}
const wrapper = shallow(<Comment {...props} />)
expect(wrapper.find('.gt-comment-body').render().html()).toEqual(expect.stringContaining(cheerio.load(emailComment.body_html).html()))
const wrapper = mount(<Comment {...props} />)
wrapper.find('.email-hidden-toggle>a').click()
// expect(ref).not.toBe(null)

// expect(wrapper.find('.email-hidden-reply').render().html()).toEqual(expect.stringContaining(cheerio.load(emailComment.body_html).html()))
})

it('render with no user', function () {
Expand Down

0 comments on commit 15565ab

Please sign in to comment.