From 279cfeb2992801b866c35d2d1f6cfa76ffd8cf21 Mon Sep 17 00:00:00 2001 From: Matt Chowning Date: Thu, 23 Apr 2020 10:54:59 -0400 Subject: [PATCH] Add tests verifying AlignmentApproach does not affect output html --- .../org/wordpress/aztec/BlockElementsTest.kt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/aztec/src/test/kotlin/org/wordpress/aztec/BlockElementsTest.kt b/aztec/src/test/kotlin/org/wordpress/aztec/BlockElementsTest.kt index f9d50e1a3..3129deaa4 100644 --- a/aztec/src/test/kotlin/org/wordpress/aztec/BlockElementsTest.kt +++ b/aztec/src/test/kotlin/org/wordpress/aztec/BlockElementsTest.kt @@ -343,4 +343,25 @@ class BlockElementsTest(val alignmentApproach: AlignmentApproach) { Assert.assertEquals(expectedHtml, editText.toHtml()) } + + @Test + fun alignmentApproachEffectOnLeftAlignment() { + assertNoChangeWithFromHtmlToHtmlRoundTrip("

left

") + } + + @Test + fun alignmentApproachEffectOnCenterAlignment() { + assertNoChangeWithFromHtmlToHtmlRoundTrip("

center

") + } + + @Test + fun alignmentApproachEffectOnRightAlignment() { + assertNoChangeWithFromHtmlToHtmlRoundTrip("

right

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