Skip to content

Commit

Permalink
Add tests verifying AlignmentApproach does not affect output html
Browse files Browse the repository at this point in the history
  • Loading branch information
mchowning committed Apr 23, 2020
1 parent 40c1c2b commit 279cfeb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions aztec/src/test/kotlin/org/wordpress/aztec/BlockElementsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -343,4 +343,25 @@ class BlockElementsTest(val alignmentApproach: AlignmentApproach) {

Assert.assertEquals(expectedHtml, editText.toHtml())
}

@Test
fun alignmentApproachEffectOnLeftAlignment() {
assertNoChangeWithFromHtmlToHtmlRoundTrip("<p style=\"text-align:left;\">left</p>")
}

@Test
fun alignmentApproachEffectOnCenterAlignment() {
assertNoChangeWithFromHtmlToHtmlRoundTrip("<p style=\"text-align:center;\">center</p>")
}

@Test
fun alignmentApproachEffectOnRightAlignment() {
assertNoChangeWithFromHtmlToHtmlRoundTrip("<p style=\"text-align:right;\">right</p>")
}

fun assertNoChangeWithFromHtmlToHtmlRoundTrip(html: String) {
editText.fromHtml(html)
val output = editText.toHtml()
Assert.assertEquals(html, output)
}
}

0 comments on commit 279cfeb

Please sign in to comment.