-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f7d226
commit 848461f
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
app/src/androidTest/java/com/example/androidproject/BottomSheetHeaderTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} |