Skip to content

Commit 1238849

Browse files
committed
Add tests verifying AlignmentApproach does not affect output html
1 parent 2cad3ce commit 1238849

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

aztec/src/test/kotlin/org/wordpress/aztec/BlockElementsTest.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,4 +343,25 @@ class BlockElementsTest(val alignmentApproach: AlignmentApproach) {
343343

344344
Assert.assertEquals(expectedHtml, editText.toHtml())
345345
}
346+
347+
@Test
348+
fun alignmentApproachEffectOnLeftAlignment() {
349+
assertNoChangeWithFromHtmlToHtmlRoundTrip("<p style=\"text-align:left;\">left</p>")
350+
}
351+
352+
@Test
353+
fun alignmentApproachEffectOnCenterAlignment() {
354+
assertNoChangeWithFromHtmlToHtmlRoundTrip("<p style=\"text-align:center;\">center</p>")
355+
}
356+
357+
@Test
358+
fun alignmentApproachEffectOnRightAlignment() {
359+
assertNoChangeWithFromHtmlToHtmlRoundTrip("<p style=\"text-align:right;\">right</p>")
360+
}
361+
362+
fun assertNoChangeWithFromHtmlToHtmlRoundTrip(html: String) {
363+
editText.fromHtml(html)
364+
val output = editText.toHtml()
365+
Assert.assertEquals(html, output)
366+
}
346367
}

0 commit comments

Comments
 (0)