Commit 4ab0aaeb authored by Fatih Acet's avatar Fatih Acet

IssueNotesRefactor: Fix markdown toolbar specs.

parent 665471e5
...@@ -12,26 +12,26 @@ feature 'Issue markdown toolbar', feature: true, js: true do ...@@ -12,26 +12,26 @@ feature 'Issue markdown toolbar', feature: true, js: true do
end end
it "doesn't include first new line when adding bold" do it "doesn't include first new line when adding bold" do
find('#note_note').native.send_keys('test') find('#note-body').native.send_keys('test')
find('#note_note').native.send_key(:enter) find('#note-body').native.send_key(:enter)
find('#note_note').native.send_keys('bold') find('#note-body').native.send_keys('bold')
page.evaluate_script('document.querySelectorAll(".js-main-target-form #note_note")[0].setSelectionRange(4, 9)') page.evaluate_script('document.querySelectorAll(".js-main-target-form #note-body")[0].setSelectionRange(4, 9)')
first('.toolbar-btn').click first('.toolbar-btn').click
expect(find('#note_note')[:value]).to eq("test\n**bold**\n") expect(find('#note-body')[:value]).to eq("test\n**bold**\n")
end end
it "doesn't include first new line when adding underline" do it "doesn't include first new line when adding underline" do
find('#note_note').native.send_keys('test') find('#note-body').native.send_keys('test')
find('#note_note').native.send_key(:enter) find('#note-body').native.send_key(:enter)
find('#note_note').native.send_keys('underline') find('#note-body').native.send_keys('underline')
page.evaluate_script('document.querySelectorAll(".js-main-target-form #note_note")[0].setSelectionRange(4, 50)') page.evaluate_script('document.querySelectorAll(".js-main-target-form #note-body")[0].setSelectionRange(4, 50)')
find('.toolbar-btn:nth-child(2)').click find('.toolbar-btn:nth-child(2)').click
expect(find('#note_note')[:value]).to eq("test\n*underline*\n") expect(find('#note-body')[:value]).to eq("test\n*underline*\n")
end end
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