File tree Expand file tree Collapse file tree 2 files changed +53
-1
lines changed
app/src/androidTest/kotlin/org/wordpress/aztec/demo/tests Expand file tree Collapse file tree 2 files changed +53
-1
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ class MixedTextFormattingTests : BaseTest() {
169169
170170 @Test
171171 fun testQuotedListFormatting () {
172- var text = " some text\n some text\n some text"
172+ val text = " some text\n some text\n some text"
173173 val html = " <blockquote><ul><li>some text</li><li>some text</li><li>some text</li></ul></blockquote>"
174174
175175 EditorPage ()
@@ -179,4 +179,33 @@ class MixedTextFormattingTests : BaseTest() {
179179 .toggleHtml()
180180 .verifyHTML(html)
181181 }
182+
183+ @Test
184+ fun testQuotedListRemoveListFormatting () {
185+ val text = " some text\n some text\n some text"
186+ val html = " <blockquote><ul><li>some text</li><li>some text</li></ul>\n some text</blockquote>"
187+
188+ EditorPage ()
189+ .toggleQuote()
190+ .makeList(EditorPage .ListStyle .UNORDERED )
191+ .insertText(text)
192+ .makeList(EditorPage .ListStyle .UNORDERED )
193+ .toggleHtml()
194+ .verifyHTML(html)
195+ }
196+
197+ @Test
198+ fun testListwithQuoteFormatting () {
199+ val text1 = " some text\n some text\n some text\n "
200+ val text2 = " some text"
201+ val html = " <ul><li>some text</li><li>some text</li><li>some text</li><li><blockquote>some text</blockquote></li></ul>"
202+
203+ EditorPage ()
204+ .makeList(EditorPage .ListStyle .UNORDERED )
205+ .insertText(text1)
206+ .toggleQuote()
207+ .insertText(text2)
208+ .toggleHtml()
209+ .verifyHTML(html)
210+ }
182211}
Original file line number Diff line number Diff line change @@ -306,6 +306,29 @@ class SimpleTextFormattingTests : BaseTest() {
306306 .verifyHTML(expected2)
307307 }
308308
309+ @Test
310+ fun testRemoveListFormatting () {
311+
312+ val text = " some text\n some text\n some text"
313+ val expected1 = " <ul><li>some text</li><li>some text</li><li>some text</li></ul>"
314+ val expected2 = " <ul><li>some text</li><li>some text</li></ul>\n some text"
315+
316+ EditorPage ()
317+ .makeList(EditorPage .ListStyle .UNORDERED )
318+ .insertText(text)
319+ .toggleHtml()
320+ .verifyHTML(expected1)
321+ .toggleHtml()
322+ .makeList(EditorPage .ListStyle .UNORDERED )
323+ .toggleHtml()
324+ .verifyHTML(expected2)
325+ .toggleHtml()
326+ .selectAllText()
327+ .makeList(EditorPage .ListStyle .UNORDERED )
328+ .toggleHtml()
329+ .verifyHTML(text)
330+ }
331+
309332 // Test reproducing the issue described in
310333 // https://github.com/wordpress-mobile/AztecEditor-Android/pull/466#issuecomment-322404363
311334 @Test
You can’t perform that action at this time.
0 commit comments