2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
RSpec.shared_examples 'thread comments for commit and snippet' do |resource_name|
|
2017-08-17 22:00:37 +05:30
|
|
|
let(:form_selector) { '.js-main-target-form' }
|
|
|
|
let(:dropdown_selector) { "#{form_selector} .comment-type-dropdown" }
|
|
|
|
let(:toggle_selector) { "#{dropdown_selector} .dropdown-toggle" }
|
|
|
|
let(:menu_selector) { "#{dropdown_selector} .dropdown-menu" }
|
|
|
|
let(:submit_selector) { "#{form_selector} .js-comment-submit-button" }
|
|
|
|
let(:close_selector) { "#{form_selector} .btn-comment-and-close" }
|
|
|
|
let(:comments_selector) { '.timeline > .note.timeline-entry' }
|
2020-03-13 15:44:24 +05:30
|
|
|
let(:comment) { 'My comment' }
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
it 'clicking "Comment" will post a comment' do
|
2021-09-04 01:27:46 +05:30
|
|
|
wait_for_all_requests
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
expect(page).to have_selector toggle_selector
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
find("#{form_selector} .note-textarea").send_keys(comment)
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
find('.js-comment-button').click
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
expect(page).to have_content(comment)
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
new_comment = all(comments_selector).last
|
|
|
|
|
|
|
|
expect(new_comment).not_to have_selector '.discussion'
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when the toggle is clicked' do
|
|
|
|
before do
|
2020-03-13 15:44:24 +05:30
|
|
|
find("#{form_selector} .note-textarea").send_keys(comment)
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
find(toggle_selector).click
|
2021-09-04 01:27:46 +05:30
|
|
|
|
|
|
|
wait_for_all_requests
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
it 'has a "Comment" item (selected by default) and "Start thread" item' do
|
2017-08-17 22:00:37 +05:30
|
|
|
expect(page).to have_selector menu_selector
|
|
|
|
|
|
|
|
find("#{menu_selector} li", match: :first)
|
|
|
|
items = all("#{menu_selector} li")
|
|
|
|
|
|
|
|
expect(items.first).to have_content 'Comment'
|
|
|
|
expect(items.first).to have_content "Add a general comment to this #{resource_name}."
|
2021-01-29 00:20:46 +05:30
|
|
|
expect(items.first).to have_selector '[data-testid="check-icon"]'
|
2017-08-17 22:00:37 +05:30
|
|
|
expect(items.first['class']).to match 'droplab-item-selected'
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
expect(items.last).to have_content 'Start thread'
|
2017-08-17 22:00:37 +05:30
|
|
|
expect(items.last).to have_content "Discuss a specific suggestion or question#{' that needs to be resolved' if resource_name == 'merge request'}."
|
2021-01-29 00:20:46 +05:30
|
|
|
expect(items.last).not_to have_selector '[data-testid="check-icon"]'
|
2017-08-17 22:00:37 +05:30
|
|
|
expect(items.last['class']).not_to match 'droplab-item-selected'
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'closes the menu when clicking the toggle or body' do
|
|
|
|
find(toggle_selector).click
|
|
|
|
|
|
|
|
expect(page).not_to have_selector menu_selector
|
|
|
|
|
|
|
|
find(toggle_selector).click
|
2019-12-04 20:38:33 +05:30
|
|
|
find("#{form_selector} .note-textarea").click
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
expect(page).not_to have_selector menu_selector
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'clicking the ul padding or divider should not change the text' do
|
2018-03-17 18:26:18 +05:30
|
|
|
execute_script("document.querySelector('#{menu_selector}').click()")
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
# on issues page, the menu closes when clicking anywhere, on other pages it will
|
|
|
|
# remain open if clicking divider or menu padding, but should not change button action
|
2018-05-09 12:01:36 +05:30
|
|
|
#
|
|
|
|
# if dropdown menu is not toggled (and also not present),
|
|
|
|
# it's "issue-type" dropdown
|
2019-09-04 21:01:54 +05:30
|
|
|
if first(menu_selector, minimum: 0).nil?
|
2018-03-17 18:26:18 +05:30
|
|
|
expect(find(dropdown_selector)).to have_content 'Comment'
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
find(toggle_selector).click
|
|
|
|
execute_script("document.querySelector('#{menu_selector} .divider').click()")
|
|
|
|
else
|
|
|
|
execute_script("document.querySelector('#{menu_selector}').click()")
|
|
|
|
|
|
|
|
expect(page).to have_selector menu_selector
|
|
|
|
expect(find(dropdown_selector)).to have_content 'Comment'
|
|
|
|
|
|
|
|
execute_script("document.querySelector('#{menu_selector} .divider').click()")
|
|
|
|
|
|
|
|
expect(page).to have_selector menu_selector
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
expect(find(dropdown_selector)).to have_content 'Comment'
|
|
|
|
end
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
describe 'when selecting "Start thread"' do
|
2017-08-17 22:00:37 +05:30
|
|
|
before do
|
|
|
|
find("#{menu_selector} li", match: :first)
|
|
|
|
all("#{menu_selector} li").last.click
|
|
|
|
end
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
it 'updates the submit button text and closes the dropdown' do
|
2021-04-17 20:07:23 +05:30
|
|
|
expect(find(submit_selector).value).to eq 'Start thread'
|
2018-05-09 12:01:36 +05:30
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
expect(page).not_to have_selector menu_selector
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'creating a thread' do
|
|
|
|
before do
|
|
|
|
find(submit_selector).click
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
find(comments_selector, match: :first)
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
def submit_reply(text)
|
|
|
|
find("#{comments_selector} .js-vue-discussion-reply").click
|
|
|
|
find("#{comments_selector} .note-textarea").send_keys(text)
|
|
|
|
|
|
|
|
find("#{comments_selector} .js-comment-button").click
|
|
|
|
wait_for_requests
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'clicking "Start thread" will post a thread' do
|
|
|
|
expect(page).to have_content(comment)
|
|
|
|
|
|
|
|
new_comment = all(comments_selector).last
|
|
|
|
|
|
|
|
expect(new_comment).to have_selector('.discussion')
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
describe 'when opening the menu' do
|
|
|
|
before do
|
|
|
|
find(toggle_selector).click
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'has "Start thread" selected' do
|
|
|
|
find("#{menu_selector} li", match: :first)
|
|
|
|
items = all("#{menu_selector} li")
|
|
|
|
|
|
|
|
expect(items.first).to have_content 'Comment'
|
|
|
|
expect(items.first).not_to have_selector '[data-testid="check-icon"]'
|
|
|
|
expect(items.first['class']).not_to match 'droplab-item-selected'
|
|
|
|
|
|
|
|
expect(items.last).to have_content 'Start thread'
|
|
|
|
expect(items.last).to have_selector '[data-testid="check-icon"]'
|
|
|
|
expect(items.last['class']).to match 'droplab-item-selected'
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
describe 'when selecting "Comment"' do
|
|
|
|
before do
|
|
|
|
find("#{menu_selector} li", match: :first).click
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'updates the submit button text and closes the dropdown' do
|
|
|
|
button = find(submit_selector)
|
|
|
|
|
|
|
|
expect(button.value).to eq 'Comment'
|
|
|
|
|
|
|
|
expect(page).not_to have_selector menu_selector
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
it 'has "Comment" selected when opening the menu', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/196825' do
|
|
|
|
find(toggle_selector).click
|
|
|
|
|
|
|
|
find("#{menu_selector} li", match: :first)
|
|
|
|
items = all("#{menu_selector} li")
|
|
|
|
|
|
|
|
aggregate_failures do
|
|
|
|
expect(items.first).to have_content 'Comment'
|
|
|
|
expect(items.first).to have_selector '[data-testid="check-icon"]'
|
|
|
|
expect(items.first['class']).to match 'droplab-item-selected'
|
|
|
|
|
|
|
|
expect(items.last).to have_content 'Start thread'
|
|
|
|
expect(items.last).not_to have_selector '[data-testid="check-icon"]'
|
|
|
|
expect(items.last['class']).not_to match 'droplab-item-selected'
|
|
|
|
end
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|
2021-04-17 20:07:23 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
RSpec.shared_examples 'thread comments for issue, epic and merge request' do |resource_name|
|
|
|
|
let(:form_selector) { '.js-main-target-form' }
|
|
|
|
let(:dropdown_selector) { "#{form_selector} [data-testid='comment-button']" }
|
|
|
|
let(:submit_button_selector) { "#{dropdown_selector} .split-content-button" }
|
|
|
|
let(:toggle_selector) { "#{dropdown_selector} .dropdown-toggle-split" }
|
|
|
|
let(:menu_selector) { "#{dropdown_selector} .dropdown-menu" }
|
|
|
|
let(:close_selector) { "#{form_selector} .btn-comment-and-close" }
|
|
|
|
let(:comments_selector) { '.timeline > .note.timeline-entry' }
|
|
|
|
let(:comment) { 'My comment' }
|
|
|
|
|
|
|
|
it 'clicking "Comment" will post a comment' do
|
|
|
|
expect(page).to have_selector toggle_selector
|
|
|
|
|
|
|
|
find("#{form_selector} .note-textarea").send_keys(comment)
|
|
|
|
|
|
|
|
find(submit_button_selector).click
|
|
|
|
|
|
|
|
expect(page).to have_content(comment)
|
|
|
|
|
|
|
|
new_comment = all(comments_selector).last
|
|
|
|
|
|
|
|
expect(new_comment).not_to have_selector '.discussion'
|
|
|
|
end
|
|
|
|
|
|
|
|
if resource_name == 'issue'
|
|
|
|
it "clicking 'Comment & close #{resource_name}' will post a comment and close the #{resource_name}" do
|
|
|
|
find("#{form_selector} .note-textarea").send_keys(comment)
|
|
|
|
|
|
|
|
click_button 'Comment & close issue'
|
|
|
|
|
|
|
|
wait_for_all_requests
|
|
|
|
|
|
|
|
expect(page).to have_content(comment)
|
|
|
|
expect(page).to have_content "@#{user.username} closed"
|
|
|
|
|
|
|
|
new_comment = all(comments_selector).last
|
|
|
|
|
|
|
|
expect(new_comment).not_to have_selector '.discussion'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when the toggle is clicked' do
|
|
|
|
before do
|
|
|
|
find("#{form_selector} .note-textarea").send_keys(comment)
|
|
|
|
|
|
|
|
find(toggle_selector).click
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'has a "Comment" item (selected by default) and "Start thread" item' do
|
|
|
|
expect(page).to have_selector menu_selector
|
|
|
|
|
|
|
|
find("#{menu_selector} li", match: :first)
|
|
|
|
items = all("#{menu_selector} li")
|
|
|
|
|
|
|
|
expect(page).to have_selector("#{dropdown_selector}[data-track-label='comment_button']")
|
|
|
|
|
|
|
|
expect(items.first).to have_content 'Comment'
|
|
|
|
expect(items.first).to have_content "Add a general comment to this #{resource_name}."
|
|
|
|
|
|
|
|
expect(items.last).to have_content 'Start thread'
|
|
|
|
expect(items.last).to have_content "Discuss a specific suggestion or question#{' that needs to be resolved' if resource_name == 'merge request'}."
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'closes the menu when clicking the toggle or body' do
|
|
|
|
find(toggle_selector).click
|
|
|
|
|
|
|
|
expect(page).not_to have_selector menu_selector
|
|
|
|
|
|
|
|
find(toggle_selector).click
|
|
|
|
find("#{form_selector} .note-textarea").click
|
|
|
|
|
|
|
|
expect(page).not_to have_selector menu_selector
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when selecting "Start thread"' do
|
|
|
|
before do
|
|
|
|
find("#{menu_selector} li", match: :first)
|
|
|
|
all("#{menu_selector} li").last.click
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
describe 'creating a thread' do
|
2018-03-17 18:26:18 +05:30
|
|
|
before do
|
2021-04-17 20:07:23 +05:30
|
|
|
find(submit_button_selector).click
|
2018-05-09 12:01:36 +05:30
|
|
|
wait_for_requests
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
find(comments_selector, match: :first)
|
|
|
|
end
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
def submit_reply(text)
|
|
|
|
find("#{comments_selector} .js-vue-discussion-reply").click
|
|
|
|
find("#{comments_selector} .note-textarea").send_keys(text)
|
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
# .js-comment-button here refers to the reply button in note_form.vue
|
2020-06-23 00:09:42 +05:30
|
|
|
find("#{comments_selector} .js-comment-button").click
|
2019-02-15 15:39:39 +05:30
|
|
|
wait_for_requests
|
|
|
|
end
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
it 'clicking "Start thread" will post a thread and show a reply component' do
|
2020-03-13 15:44:24 +05:30
|
|
|
expect(page).to have_content(comment)
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
new_comment = all(comments_selector).last
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
expect(new_comment).to have_selector('.discussion')
|
2021-03-11 19:13:27 +05:30
|
|
|
expect(new_comment).to have_css('.discussion-with-resolve-btn')
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
if resource_name =~ /(issue|merge request)/
|
|
|
|
it 'can be replied to' do
|
|
|
|
submit_reply('some text')
|
|
|
|
|
|
|
|
expect(page).to have_css('.discussion-notes .note', count: 2)
|
|
|
|
expect(page).to have_content 'Collapse replies'
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'can be collapsed' do
|
|
|
|
submit_reply('another text')
|
|
|
|
|
|
|
|
find('.js-collapse-replies').click
|
|
|
|
expect(page).to have_css('.discussion-notes .note', count: 1)
|
|
|
|
expect(page).to have_content '1 reply'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
if resource_name == 'merge request'
|
2018-12-13 13:39:08 +05:30
|
|
|
let(:note_id) { find("#{comments_selector} .note:first-child", match: :first)['data-note-id'] }
|
2019-09-30 21:07:59 +05:30
|
|
|
let(:reply_id) { find("#{comments_selector} .note:last-of-type", match: :first)['data-note-id'] }
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
it 'can be replied to after resolving' do
|
2021-10-27 15:23:28 +05:30
|
|
|
find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage
|
2019-02-15 15:39:39 +05:30
|
|
|
wait_for_requests
|
2018-12-13 13:39:08 +05:30
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
refresh
|
2018-12-13 13:39:08 +05:30
|
|
|
wait_for_requests
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
submit_reply('to reply or not reply')
|
|
|
|
end
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
it 'shows resolved thread when toggled' do
|
2019-02-15 15:39:39 +05:30
|
|
|
submit_reply('a')
|
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage
|
2018-12-13 13:39:08 +05:30
|
|
|
wait_for_requests
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
expect(page).to have_selector(".note-row-#{note_id}", visible: true)
|
|
|
|
|
|
|
|
refresh
|
2018-12-13 13:39:08 +05:30
|
|
|
click_button "1 reply"
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
expect(page).to have_selector(".note-row-#{reply_id}", visible: true)
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
if resource_name == 'issue'
|
2019-09-30 21:07:59 +05:30
|
|
|
it "clicking 'Start thread & close #{resource_name}' will post a thread and close the #{resource_name}" do
|
2020-03-13 15:44:24 +05:30
|
|
|
click_button 'Start thread & close issue'
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
expect(page).to have_content(comment)
|
|
|
|
expect(page).to have_content "@#{user.username} closed"
|
|
|
|
|
|
|
|
new_discussion = all(comments_selector)[-2]
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
expect(new_discussion).to have_selector '.discussion'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when opening the menu' do
|
|
|
|
before do
|
|
|
|
find(toggle_selector).click
|
|
|
|
end
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
it 'has "Start thread" selected' do
|
2017-08-17 22:00:37 +05:30
|
|
|
find("#{menu_selector} li", match: :first)
|
|
|
|
items = all("#{menu_selector} li")
|
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
expect(page).to have_selector("#{dropdown_selector}[data-track-label='start_thread_button']")
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
expect(items.first).to have_content 'Comment'
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
expect(items.last).to have_content 'Start thread'
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when selecting "Comment"' do
|
|
|
|
before do
|
|
|
|
find("#{menu_selector} li", match: :first).click
|
|
|
|
end
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
it 'updates the submit button text and closes the dropdown' do
|
2021-04-17 20:07:23 +05:30
|
|
|
button = find(submit_button_selector)
|
2018-05-09 12:01:36 +05:30
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
expect(button).to have_content 'Comment'
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
expect(page).not_to have_selector menu_selector
|
|
|
|
end
|
|
|
|
|
|
|
|
if resource_name =~ /(issue|merge request)/
|
|
|
|
it 'updates the close button text' do
|
|
|
|
expect(find(close_selector)).to have_content "Comment & close #{resource_name}"
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'typing does not change the close button text' do
|
|
|
|
find("#{form_selector} .note-textarea").send_keys('b')
|
|
|
|
|
|
|
|
expect(find(close_selector)).to have_content "Comment & close #{resource_name}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
it 'has "Comment" selected when opening the menu' do
|
2017-08-17 22:00:37 +05:30
|
|
|
find(toggle_selector).click
|
|
|
|
|
|
|
|
find("#{menu_selector} li", match: :first)
|
|
|
|
items = all("#{menu_selector} li")
|
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
expect(page).to have_selector("#{dropdown_selector}[data-track-label='comment_button']")
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-04-17 20:07:23 +05:30
|
|
|
expect(items.first).to have_content 'Comment'
|
|
|
|
|
|
|
|
expect(items.last).to have_content 'Start thread'
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if resource_name =~ /(issue|merge request)/
|
|
|
|
describe "on a closed #{resource_name}" do
|
|
|
|
before do
|
|
|
|
find("#{form_selector} .js-note-target-close").click
|
2018-03-17 18:26:18 +05:30
|
|
|
wait_for_requests
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
find("#{form_selector} .note-textarea").send_keys('a')
|
|
|
|
end
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
it "shows a 'Comment & reopen #{resource_name}' button" do
|
2017-08-17 22:00:37 +05:30
|
|
|
expect(find("#{form_selector} .js-note-target-reopen")).to have_content "Comment & reopen #{resource_name}"
|
|
|
|
end
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
it "shows a 'Start thread & reopen #{resource_name}' button when 'Start thread' is selected" do
|
2017-08-17 22:00:37 +05:30
|
|
|
find(toggle_selector).click
|
|
|
|
|
|
|
|
find("#{menu_selector} li", match: :first)
|
|
|
|
all("#{menu_selector} li").last.click
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
expect(find("#{form_selector} .js-note-target-reopen")).to have_content "Start thread & reopen #{resource_name}"
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|