Skip to content

Commit

Permalink
clear test from redundant assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
ktiniatros committed May 17, 2022
1 parent 32ed73d commit d6c960f
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,20 @@ class HtmlTextViewWidgetTest : AutoCloseKoinTest() {

// Heading test
widget.setHtmlText("<strong>Heading 1</strong><p>Paragraph 1</p><strong>Heading 2</strong><p>Paragraph 2</p>")
assertEquals(
widget.children.filter { ViewCompat.isAccessibilityHeading(it) }.count(),
0
) // 2: Heading 1 + Heading 2
assertEquals(widget.children.filter { ViewCompat.isAccessibilityHeading(it) }.count(), 0) // 2: Heading 1 + Heading 2
assertEquals(widget.childCount, 1) // 5: Heading + Text + Linebreak + Heading + Text

widget.setHtmlText("<h1>Heading 1</h1>")
assertEquals(1, widget.childCount)
assertTrue(ViewCompat.isAccessibilityHeading(widget.getChildAt(0)))
widget.setHtmlText("<h2>Heading 1</h2>")
assertEquals(1, widget.childCount)
assertTrue(ViewCompat.isAccessibilityHeading(widget.getChildAt(0)))
widget.setHtmlText("<h3>Heading 1</h3>")
assertEquals(1, widget.childCount)
assertTrue(ViewCompat.isAccessibilityHeading(widget.getChildAt(0)))
widget.setHtmlText("<h4>Heading 1</h4>")
assertEquals(1, widget.childCount)
assertTrue(ViewCompat.isAccessibilityHeading(widget.getChildAt(0)))
widget.setHtmlText("<h5>Heading 1</h5>")
assertEquals(1, widget.childCount)
assertTrue(ViewCompat.isAccessibilityHeading(widget.getChildAt(0)))
widget.setHtmlText("<h6>Heading 1</h6>")
assertEquals(1, widget.childCount)
assertTrue(ViewCompat.isAccessibilityHeading(widget.getChildAt(0)))

// List test
Expand Down

0 comments on commit d6c960f

Please sign in to comment.