Skip to content

Commit

Permalink
Fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cbothner committed Dec 11, 2017
1 parent 3a7ddde commit 215c9df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/javascript/conversation/SelectedCommentThread.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(
SelectedCommentThread
)

const Container = styled.div`
const Container = styled.div.attrs({ className: 'SelectedCommentThread' })`
flex: 1;
max-width: 633px;
min-width: 370px;
Expand Down
4 changes: 2 additions & 2 deletions spec/features/leaving_a_comment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
first_paragraph = find('.DraftEditor-root div[data-block]', match: :first)
first_paragraph.double_click
click_button 'Respond here'
expect(page).to have_selector 'textarea'
expect(page).to have_selector '.public-DraftEditorPlaceholder-root'

reply_placeholder = find('.public-DraftEditorPlaceholder-root',
text: 'Write a reply...')
.native
page.driver.browser.action.move_to(reply_placeholder).click.perform
page.driver.browser.action.send_keys('Test reply').perform
click_button 'Submit'
expect(page).to have_selector 'blockquote', text: 'Test comment'
expect(page).to have_selector 'blockquote', text: 'Test reply'
end

scenario 'is not possible with a non-unique selection' do
Expand Down
12 changes: 8 additions & 4 deletions spec/features/moderating_a_comment_thread_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@
it 'is possible to delete a comment as an editor' do
visit comment_thread_path(:en, comment_thread)
accept_confirm 'Are you sure' do
find('blockquote', text: 'Second comment').hover
find('[aria-label="Delete comment"]').click
within '.SelectedCommentThread' do
find('blockquote', text: 'Second comment').hover
find('[aria-label="Delete comment"]').click
end
end
expect(page).not_to have_content 'Second comment'
accept_confirm 'Are you sure' do
find('blockquote', text: 'First comment').hover
find('[aria-label="Delete comment thread"]').click
within '.SelectedCommentThread' do
find('blockquote', text: 'First comment').hover
find('[aria-label="Delete comment thread"]').click
end
end
expect(page).not_to have_content 'First comment'
end
Expand Down

0 comments on commit 215c9df

Please sign in to comment.