Skip to content

Commit

Permalink
Add test for data-page-type attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed Oct 17, 2023
1 parent 011b09d commit d86f7fa
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class TabbedContentTest : BaseAbstractTest() {

private fun Element.getTabbedRow(type: String) = select(".table-row[data-togglable=$type]")
private fun Element.getTabbedTable(type: String) = select("div[data-togglable=$type] .table")
private fun Element.getMainContentDataType() = selectFirst(".main-content")?.attr("data-page-type")

@Test
fun `should have correct tabbed content type`() {
Expand Down Expand Up @@ -64,13 +65,15 @@ class TabbedContentTest : BaseAbstractTest() {
assertEquals(1, classContent.getTabbedTable("TYPE").size)
assertEquals(3, classContent.getTabbedRow("EXTENSION_FUNCTION").size)
assertEquals(2, classContent.getTabbedRow("EXTENSION_PROPERTY").size)
assertEquals("classlike", classContent.getMainContentDataType())

val packagePage = writerPlugin.writer.renderedContent("root/example/index.html")
assertEquals(1, packagePage.getTabbedTable("TYPE").size)
assertEquals(1, packagePage.getTabbedTable("PROPERTY").size)
assertEquals(1, packagePage.getTabbedTable("FUNCTION").size)
assertEquals(3, packagePage.getTabbedRow("EXTENSION_FUNCTION").size)
assertEquals(2, packagePage.getTabbedRow("EXTENSION_PROPERTY").size)
assertEquals("package", packagePage.getMainContentDataType())
}
}
}
Expand Down

0 comments on commit d86f7fa

Please sign in to comment.