Commit 9db8cb3f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

fix tests notes_on_merge_requests

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 418660b9
...@@ -135,7 +135,7 @@ describe "On a merge request", js: true do ...@@ -135,7 +135,7 @@ describe "On a merge request", js: true do
end end
describe "On a merge request diff", js: true, focus: true do describe "On a merge request diff", js: true, focus: true do
let!(:project) { create(:source_project) } let!(:project) { create(:project) }
let!(:merge_request) { create(:merge_request_with_diffs, source_project: project, target_project: project) } let!(:merge_request) { create(:merge_request_with_diffs, source_project: project, target_project: project) }
before do before do
...@@ -149,7 +149,7 @@ describe "On a merge request diff", js: true, focus: true do ...@@ -149,7 +149,7 @@ describe "On a merge request diff", js: true, focus: true do
describe "when adding a note" do describe "when adding a note" do
before do before do
find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185"]').click
end end
describe "the notes holder" do describe "the notes holder" do
...@@ -159,23 +159,14 @@ describe "On a merge request diff", js: true, focus: true do ...@@ -159,23 +159,14 @@ describe "On a merge request diff", js: true, focus: true do
end end
describe "the note form" do describe "the note form" do
# FIXME
#it 'should be valid' do
#within(".js-temp-notes-holder") { find("#note_noteable_type").value.should == "MergeRequest" }
#within(".js-temp-notes-holder") { find("#note_noteable_id").value.should == merge_request.id.to_s }
#within(".js-temp-notes-holder") { find("#note_commit_id").value.should == "" }
#within(".js-temp-notes-holder") { find("#note_line_code").value.should == "4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185" }
#should have_css(".js-close-discussion-note-form", text: "Cancel")
#end
it "shouldn't add a second form for same row" do it "shouldn't add a second form for same row" do
find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185"]').click
should have_css("tr[id='4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185'] + .js-temp-notes-holder form", count: 1) should have_css("tr[id='4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185'] + .js-temp-notes-holder form", count: 1)
end end
it "should be removed when canceled" do it "should be removed when canceled" do
within(".file form[rel$='4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185']") do within(".file form[rel$='4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185']") do
find(".js-close-discussion-note-form").trigger("click") find(".js-close-discussion-note-form").trigger("click")
end end
...@@ -185,11 +176,11 @@ describe "On a merge request diff", js: true, focus: true do ...@@ -185,11 +176,11 @@ describe "On a merge request diff", js: true, focus: true do
end end
describe "with muliple note forms" do describe "with muliple note forms" do
let!(:project) { create(:source_project) } let!(:project) { create(:project) }
let!(:merge_request) { create(:merge_request_with_diffs, source_project: project, target_project: project) } let!(:merge_request) { create(:merge_request_with_diffs, source_project: project, target_project: project) }
before do before do
find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185"]').click find('a[data-line-code="4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185"]').click
find('a[data-line-code="342e16cbbd482ac2047dc679b2749d248cc1428f_18_17"]').click find('a[data-line-code="342e16cbbd482ac2047dc679b2749d248cc1428f_18_17"]').click
end end
...@@ -198,7 +189,7 @@ describe "On a merge request diff", js: true, focus: true do ...@@ -198,7 +189,7 @@ describe "On a merge request diff", js: true, focus: true do
describe "previewing them separately" do describe "previewing them separately" do
before do before do
# add two separate texts and trigger previews on both # add two separate texts and trigger previews on both
within("tr[id='4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185'] + .js-temp-notes-holder") do within("tr[id='4735dfc552ad7bf15ca468adc3cad9d05b624490_172_185'] + .js-temp-notes-holder") do
fill_in "note[note]", with: "One comment on line 185" fill_in "note[note]", with: "One comment on line 185"
find(".js-note-preview-button").trigger("click") find(".js-note-preview-button").trigger("click")
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment