Commit e3d92a6c authored by Fatih Acet's avatar Fatih Acet

Add spec for note edit and fix one commented spec.

parent 09fc4f55
---
title: Refactored note edit form to improve frontend performance on MR and Issues
pages, especially pages with has a lot of discussions in it
merge_request: 8356
author:
......@@ -78,7 +78,7 @@ describe 'Comments', feature: true do
describe 'editing the note' do
before do
find('.note').hover
find(".js-note-edit").click
find('.js-note-edit').click
end
it 'shows the note edit form and hide the note body' do
......@@ -89,14 +89,29 @@ describe 'Comments', feature: true do
end
end
# TODO: fix after 7.7 release
# it "should reset the edit note form textarea with the original content of the note if cancelled" do
# within(".current-note-edit-form") do
# fill_in "note[note]", with: "Some new content"
# find(".btn-cancel").click
# expect(find(".js-note-text", visible: false).text).to eq note.note
# end
# end
it 'should reset the edit note form textarea with the original content of the note if cancelled' do
within('.current-note-edit-form') do
fill_in 'note[note]', with: 'Some new content'
find('.btn-cancel').click
expect(find('.js-note-text', visible: false).text).to eq ''
end
end
it 'allows using markdown buttons after saving a note and then trying to edit it again' do
page.within('.current-note-edit-form') do
fill_in 'note[note]', with: 'This is the new content'
find('.btn-save').click
end
find('.note').hover
find('.js-note-edit').click
page.within('.current-note-edit-form') do
expect(find('#note_note').value).to eq('This is the new content')
find('.js-md:first-child').click
expect(find('#note_note').value).to eq('This is the new content****')
end
end
it 'appends the edited at time to the note' do
page.within('.current-note-edit-form') do
......
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