feat: add centralized TestTags and testTag modifiers (Closes #31)

This commit was merged in pull request #44.
This commit is contained in:
2026-03-13 13:04:01 +01:00
parent 8855f48ae2
commit 6e5a6a3fa1
5 changed files with 129 additions and 16 deletions

View File

@@ -0,0 +1,58 @@
package org.shahondin1624
import org.shahondin1624.lib.components.TestTags
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
class TestTagsTest {
@Test
fun attributeCardTagFormat() {
assertEquals("attribute_card_body", TestTags.attributeCard("Body"))
assertEquals("attribute_card_agility", TestTags.attributeCard("Agility"))
assertEquals("attribute_card_charisma", TestTags.attributeCard("Charisma"))
}
@Test
fun talentCardTagFormat() {
assertEquals("talent_card_firearms", TestTags.talentCard("Firearms"))
assertEquals("talent_card_close_combat", TestTags.talentCard("Close Combat"))
}
@Test
fun rollButtonTagFormat() {
assertEquals("roll_button_body", TestTags.rollButton("Body"))
assertEquals("roll_button_close_combat", TestTags.rollButton("Close Combat"))
}
@Test
fun navTagsAreDefined() {
assertEquals("nav_character_sheet", TestTags.NAV_CHARACTER_SHEET)
assertEquals("nav_settings", TestTags.NAV_SETTINGS)
}
@Test
fun panelTagsAreDefined() {
assertTrue(TestTags.PANEL_CHARACTER_HEADER.isNotBlank())
assertTrue(TestTags.PANEL_RESOURCES.isNotBlank())
assertTrue(TestTags.PANEL_DERIVED_ATTRIBUTES.isNotBlank())
assertTrue(TestTags.PANEL_DAMAGE_MONITOR.isNotBlank())
}
@Test
fun allTagsAreUnique() {
val staticTags = listOf(
TestTags.PANEL_CHARACTER_HEADER,
TestTags.PANEL_RESOURCES,
TestTags.PANEL_DERIVED_ATTRIBUTES,
TestTags.PANEL_DAMAGE_MONITOR,
TestTags.NAV_CHARACTER_SHEET,
TestTags.NAV_SETTINGS,
TestTags.TOP_APP_BAR,
TestTags.THEME_TOGGLE,
TestTags.MENU_BUTTON
)
assertEquals(staticTags.size, staticTags.toSet().size, "All static tags should be unique")
}
}