Skip to content

Commit 39fdd73

Browse files
committed
Test: Document test failures due to expected actual assertion mismatch
Those test, and more so, their specific 'expected' outcome are being documented so that when they get fixed, it becomes evident what was changed and why. This is done in order to make it easier to reason about what went wrong and whether main source code needs to be updated as well, that is, since there was no other explicit change but the 'minSdkVersion' to '24' update that caused those failures.
1 parent bbdd329 commit 39fdd73

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,16 @@ class AztecToolbarTest {
433433
italicButton.performClick()
434434
Assert.assertTrue(boldButton.isChecked)
435435
editText.append("bolditalic")
436+
/**
437+
* <strong>
438+
* bold
439+
* </strong>
440+
* <strong>
441+
* <em>
442+
* bolditalic
443+
* </em>
444+
* </strong>
445+
*/
436446
Assert.assertEquals("<strong>bold</strong><strong><em>bolditalic</em></strong>", editText.toHtml())
437447
boldButton.performClick()
438448
Assert.assertFalse(boldButton.isChecked)

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,25 @@ class LinkTest {
4949
editText.setSelection(4)
5050
editText.link("http://wordpress.com", "WordPress")
5151
// Still valid, but order of b and del is switched here for some reason.
52+
/**
53+
* <b>
54+
* <s>
55+
* left
56+
* </s>
57+
* </b>
58+
* <b>
59+
* <s>
60+
* <a href="http://wordpress.com">
61+
* WordPress
62+
* </a>
63+
* </s>
64+
* </b>
65+
* <s>
66+
* <i>
67+
* right
68+
* </i>
69+
* </s>
70+
*/
5271
Assert.assertEquals("<b><s>left</s></b><b><s><a href=\"http://wordpress.com\">WordPress</a></s></b><s><i>right</i></s>", editText.toHtml())
5372
}
5473

@@ -160,6 +179,16 @@ class LinkTest {
160179
editText.setSelection(0, editText.length())
161180

162181
editText.link("http://automattic.com", editText.getSelectedText())
182+
/**
183+
* <a href="http://automattic.com">
184+
* FirstUrl Hello
185+
* </a>
186+
* <a href="http://automattic.com">
187+
* <b>
188+
* SecondUrl
189+
* </b>
190+
* </a>
191+
*/
163192
Assert.assertEquals("<a href=\"http://automattic.com\">FirstUrl Hello </a>" +
164193
"<a href=\"http://automattic.com\"><b>SecondUrl</b></a>", editText.toHtml())
165194
}

0 commit comments

Comments
 (0)