Skip to content
Snippets Groups Projects
Commit 13ebbfc0 authored by Marius Dumitru Florea's avatar Marius Dumitru Florea
Browse files

XWIKI-22351: The autosave triggers a merge conflict sometimes even if there's...

XWIKI-22351: The autosave triggers a merge conflict sometimes even if there's no save done outside the realtime session
* Update tests (when inserting a block widget from an empty paragraph, at the end of the edited content, the widget is inserted before that paragraph; the paragraph was previously wrongly considered as block separator in wiki syntax; moreover, CKEditor output a non-breaking space in empty paragraphs).

(cherry picked from commit 9d0e2aff)
parent 461837ed
No related branches found
No related tags found
No related merge requests found
...@@ -138,7 +138,7 @@ void insertImage(TestUtils setup, TestReference testReference) throws Exception ...@@ -138,7 +138,7 @@ void insertImage(TestUtils setup, TestReference testReference) throws Exception
// Verify that the content matches what we did using CKEditor. // Verify that the content matches what we did using CKEditor.
assertEquals("[[image:image.gif]]\n" assertEquals("[[image:image.gif]]\n"
+ "\n" + "\n"
+ "[[Caption>>image:image.gif]]", savedPage.editWiki().getContent()); + "[[Caption>>image:image.gif]]\n\n ", savedPage.editWiki().getContent());
} }
@Test @Test
...@@ -321,7 +321,7 @@ void imageWithCaption(TestUtils setup, TestReference testReference) throws Excep ...@@ -321,7 +321,7 @@ void imageWithCaption(TestUtils setup, TestReference testReference) throws Excep
ViewPage savedPage = wysiwygEditPage.clickSaveAndView(); ViewPage savedPage = wysiwygEditPage.clickSaveAndView();
// Verify that the content matches what we did using CKEditor. // Verify that the content matches what we did using CKEditor.
assertEquals("[[Caption>>image:image.gif||data-xwiki-image-style-alignment=\"center\"]]", assertEquals("[[Caption>>image:image.gif||data-xwiki-image-style-alignment=\"center\"]]\n\n ",
savedPage.editWiki().getContent()); savedPage.editWiki().getContent());
// Re-edit the page. // Re-edit the page.
...@@ -337,7 +337,7 @@ void imageWithCaption(TestUtils setup, TestReference testReference) throws Excep ...@@ -337,7 +337,7 @@ void imageWithCaption(TestUtils setup, TestReference testReference) throws Excep
savedPage = wysiwygEditPage.clickSaveAndView(); savedPage = wysiwygEditPage.clickSaveAndView();
// Verify that the content matches what we did using CKEditor. // Verify that the content matches what we did using CKEditor.
assertEquals("[[image:image.gif||data-xwiki-image-style-alignment=\"center\"]]", assertEquals("[[image:image.gif||data-xwiki-image-style-alignment=\"center\"]]\n\n ",
savedPage.editWiki().getContent()); savedPage.editWiki().getContent());
// Edit again to set the caption a second time. // Edit again to set the caption a second time.
...@@ -353,7 +353,7 @@ void imageWithCaption(TestUtils setup, TestReference testReference) throws Excep ...@@ -353,7 +353,7 @@ void imageWithCaption(TestUtils setup, TestReference testReference) throws Excep
savedPage = wysiwygEditPage.clickSaveAndView(); savedPage = wysiwygEditPage.clickSaveAndView();
// Verify that the content matches what we did using CKEditor. // Verify that the content matches what we did using CKEditor.
assertEquals("[[Caption>>image:image.gif||data-xwiki-image-style-alignment=\"center\"]]", assertEquals("[[Caption>>image:image.gif||data-xwiki-image-style-alignment=\"center\"]]\n\n ",
savedPage.editWiki().getContent()); savedPage.editWiki().getContent());
} }
...@@ -456,7 +456,7 @@ void imageWithLinkAndCaptionUI(TestUtils setup, TestReference testReference) thr ...@@ -456,7 +456,7 @@ void imageWithLinkAndCaptionUI(TestUtils setup, TestReference testReference) thr
ViewPage savedPage = wysiwygEditPage.clickSaveAndView(); ViewPage savedPage = wysiwygEditPage.clickSaveAndView();
assertEquals("[[~[~[Caption~>~>image:image.gif~|~|data-xwiki-image-style-alignment=\"center\"~]~]" assertEquals("[[~[~[Caption~>~>image:image.gif~|~|data-xwiki-image-style-alignment=\"center\"~]~]"
+ ">>doc:Main.WebHome]]", savedPage.editWiki().getContent()); + ">>doc:Main.WebHome]]\n\n ", savedPage.editWiki().getContent());
// Test that when re-editing the image, the link, caption and alignment are still set. // Test that when re-editing the image, the link, caption and alignment are still set.
wysiwygEditPage = savedPage.editWYSIWYG(); wysiwygEditPage = savedPage.editWYSIWYG();
editor = new CKEditor("content").waitToLoad(); editor = new CKEditor("content").waitToLoad();
...@@ -486,7 +486,7 @@ void imageWithLinkAndCaptionUI(TestUtils setup, TestReference testReference) thr ...@@ -486,7 +486,7 @@ void imageWithLinkAndCaptionUI(TestUtils setup, TestReference testReference) thr
savedPage = wysiwygEditPage.clickSaveAndView(); savedPage = wysiwygEditPage.clickSaveAndView();
assertEquals("[[~[~[New Caption~>~>image:image.gif~|~|data-xwiki-image-style-alignment=\"center\"~]~]" assertEquals("[[~[~[New Caption~>~>image:image.gif~|~|data-xwiki-image-style-alignment=\"center\"~]~]"
+ ">>doc:Main.WebHome]]", savedPage.editWiki().getContent()); + ">>doc:Main.WebHome]]\n\n ", savedPage.editWiki().getContent());
} }
@Test @Test
......
...@@ -478,10 +478,9 @@ void toc() ...@@ -478,10 +478,9 @@ void toc()
qa.waitForItemSelected("/toc", "Table of Contents"); qa.waitForItemSelected("/toc", "Table of Contents");
textArea.sendKeys(Keys.ENTER); textArea.sendKeys(Keys.ENTER);
qa.waitForItemSubmitted(); qa.waitForItemSubmitted();
textArea.waitForContentRefresh();
textArea = editor.getRichTextArea(); assertSourceEquals("{{toc/}}\n\n ");
assertSourceEquals("{{toc/}}\n");
} }
@Test @Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment