Hide unsaved changes warning after undoing them

This way showing the warning is consistent with warning users when
they're leaving the page.
This commit is contained in:
Javi Martín
2020-06-18 20:08:49 +02:00
parent cfc60b5de4
commit 0270c4c962
4 changed files with 25 additions and 8 deletions

View File

@@ -102,6 +102,8 @@ describe "Admin legislation draft versions" do
visit path
fill_in_markdown_editor "Text", with: "Version 1b"
expect(page).to have_content "You've edited the text"
dismiss_confirm(prompt) do
click_link "Proposals", match: :first
end
@@ -141,7 +143,11 @@ describe "Admin legislation draft versions" do
expect(page).to have_css("h2", text: "Proposals")
go_back
fill_in_markdown_editor "Text", with: "Version 1"
expect(page).not_to have_content "You've edited the text"
click_link "Proposals", match: :first
expect(page).to have_css("h2", text: "Proposals")