Skip to content

Commit

Permalink
bottom sheet header test
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaLinden committed Dec 9, 2024
1 parent 4f7d226 commit 848461f
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.example.androidproject

import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithText
import com.example.androidproject.ui.components.BottomSheetHeader
import org.junit.Rule
import org.junit.Test

class BottomSheetHeaderTest {
@get:Rule
val rule = createComposeRule()

@Test
fun headerShowsQuestDescriptionAndCheckpointsCount() {
rule.setContent {
BottomSheetHeader(
selectedQuestDescription = "Sample Quest",
completedCheckpoints = 2,
totalCheckpoints = 5,
onExpandCollapse = {}
)
}

// Check that the quest description is shown
rule.onNodeWithText("Sample Quest").assertExists()

// Check that the completed count is shown
rule.onNodeWithText("2 / 5 visited").assertExists()
}
}

0 comments on commit 848461f

Please sign in to comment.