|
|
|
@ -49,7 +49,7 @@ describe 'activity comments', js: true do |
|
|
|
|
comment_field.click_and_type_slowly 'this is a comment!1' |
|
|
|
|
comment_field.submit_by_click |
|
|
|
|
|
|
|
|
|
wp_page.expect_comment 'this is a comment!1' |
|
|
|
|
wp_page.expect_comment text: 'this is a comment!1' |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'submits comments repeatedly' do |
|
|
|
@ -57,7 +57,7 @@ describe 'activity comments', js: true do |
|
|
|
|
comment_field.submit_by_click |
|
|
|
|
|
|
|
|
|
expect(page).to have_selector('.user-comment > .message', count: 2) |
|
|
|
|
wp_page.expect_comment 'this is my first comment!1' |
|
|
|
|
wp_page.expect_comment text: 'this is my first comment!1' |
|
|
|
|
|
|
|
|
|
expect(comment_field.editing?).to be false |
|
|
|
|
comment_field.activate! |
|
|
|
@ -67,7 +67,7 @@ describe 'activity comments', js: true do |
|
|
|
|
comment_field.submit_by_click |
|
|
|
|
|
|
|
|
|
expect(page).to have_selector('.user-comment > .message', count: 3) |
|
|
|
|
wp_page.expect_comment 'this is my second comment!1' |
|
|
|
|
wp_page.expect_comment text: 'this is my second comment!1' |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
@ -114,8 +114,8 @@ describe 'activity comments', js: true do |
|
|
|
|
end |
|
|
|
|
comment_field.submit_by_click |
|
|
|
|
|
|
|
|
|
wp_page.expect_comment 'Comment with bold text' |
|
|
|
|
expect(page).to have_selector('.user-comment .message strong', text: 'bold text') |
|
|
|
|
wp_page.expect_comment text: 'Comment with bold text' |
|
|
|
|
wp_page.expect_comment text: 'bold text', subselector: 'strong' |
|
|
|
|
|
|
|
|
|
# Hover the new activity |
|
|
|
|
activity = page.find('#activity-2') |
|
|
|
@ -137,8 +137,8 @@ describe 'activity comments', js: true do |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
edit.submit_by_click |
|
|
|
|
wp_page.expect_comment 'Comment with italic text' |
|
|
|
|
expect(page).to have_selector('.user-comment .message em', text: 'italic text', wait: 10) |
|
|
|
|
wp_page.expect_comment text: 'Comment with italic text' |
|
|
|
|
wp_page.expect_comment text: 'italic text', subselector: 'em' |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
@ -175,10 +175,10 @@ describe 'activity comments', js: true do |
|
|
|
|
# Scroll to the activity |
|
|
|
|
scroll_to_element(page.find('#activity-2')) |
|
|
|
|
|
|
|
|
|
wp_page.expect_comment 'this is a bold remark' |
|
|
|
|
expect(page).to have_selector('.user-comment .message', count: 2) |
|
|
|
|
expect(page).to have_selector('.user-comment .message blockquote') |
|
|
|
|
expect(page).to have_selector('.user-comment .message strong') |
|
|
|
|
wp_page.expect_comment text: 'this is a bold remark' |
|
|
|
|
wp_page.expect_comment count: 2 |
|
|
|
|
wp_page.expect_comment subselector: 'blockquote' |
|
|
|
|
wp_page.expect_comment subselector: 'strong', text: 'a bold' |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|