Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
@DisplayName("given I flag someone")
inner class FlagSomeone {
lateinit var testObserver: TestObserver<MatchEvent>
lateinit var targetProfile: Profile
fun setup() {
testObserver =
repeat(INSTRUCTION_CARDS_NUM) { matchViewModel.swipe(MatchRating.Interested) }
val matchState = matchViewModel.matchState.value as MatchState.Started
val matchItem = matchState.stack.items.lastElement() as MatchItem.ProfileCard
targetProfile = matchItem.profile
fun `then sends flagged event`() {
testObserver.values().last() shouldBeInstanceOf MatchEvent.FlagProfile::class
(testObserver.values().last() as MatchEvent.FlagProfile).apply {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment