Skip to content

Commit

Permalink
SpeziQuestionnaire (#142)
Browse files Browse the repository at this point in the history
# SpeziQuestionnaire

## ♻️ Current situation & Problem
*Link any open issues or pull requests (PRs) related to this PR. Please
ensure that all non-trivial PRs are first tracked and discussed in an
existing GitHub issue or discussion.*


## ⚙️ Release Notes 
*Add a bullet point list summary of the feature and possible migration
guides if this is a breaking change so this section can be added to the
release notes.*
*Include code snippets that provide examples of the feature implemented
or links to the documentation if it appends or changes the public
interface.*


## 📚 Documentation
*Please ensure that you properly document any additions in conformance
to [Spezi Documentation
Guide](https://github.com/StanfordSpezi/.github/blob/main/DOCUMENTATIONGUIDE.md).*
*You can use this section to describe your solution, but we encourage
contributors to document your reasoning and changes using in-line
documentation.*


## ✅ Testing
*Please ensure that the PR meets the testing requirements set by CodeCov
and that new functionality is appropriately tested.*
*This section describes important information about the tests and why
some elements might not be testable.*


## 📝 Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).

---------

Co-authored-by: Eldi Cano <eldi.cano@hotmail.com>
  • Loading branch information
pauljohanneskraft and eldcn authored Nov 26, 2024
1 parent f5ee17f commit 74cc37c
Show file tree
Hide file tree
Showing 7 changed files with 1,062 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package edu.stanford.bdh.engagehf.questionnaire

import androidx.compose.ui.test.junit4.createAndroidComposeRule
import dagger.hilt.android.testing.HiltAndroidRule
import dagger.hilt.android.testing.HiltAndroidTest
import edu.stanford.bdh.engagehf.questionnaire.composables.QuestionnaireTestComposable
import edu.stanford.bdh.engagehf.questionnaire.simulators.QuestionnaireTestSimulator
import edu.stanford.spezi.core.design.component.ComposeContentActivity
import org.junit.Rule
import org.junit.Test

@HiltAndroidTest
class QuestionnaireTest {

@get:Rule
val hiltRule = HiltAndroidRule(this)

@get:Rule
val composeTestRule = createAndroidComposeRule<ComposeContentActivity>()

@Test
fun testQuestionnaireComposableDisplay() {
composeTestRule.activity.setScreen { QuestionnaireTestComposable() }
questionnaireComposable {
assertIsDisplayed()
}
}

private fun questionnaireComposable(block: QuestionnaireTestSimulator.() -> Unit) {
QuestionnaireTestSimulator(composeTestRule).apply { block() }
}
}
Loading

0 comments on commit 74cc37c

Please sign in to comment.