mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-11 01:13:46 +01:00
Test poll views state with enough number of options but without a question.
This commit is contained in:
parent
5b35534c3d
commit
0bf37abca1
@ -25,6 +25,7 @@ import im.vector.app.features.poll.create.CreatePollViewStates.fakeQuestion
|
||||
import im.vector.app.features.poll.create.CreatePollViewStates.initialCreatePollViewState
|
||||
import im.vector.app.features.poll.create.CreatePollViewStates.pollViewStateWithOnlyQuestion
|
||||
import im.vector.app.features.poll.create.CreatePollViewStates.pollViewStateWithQuestionAndNotEnoughOptions
|
||||
import im.vector.app.features.poll.create.CreatePollViewStates.pollViewStateWithoutQuestionAndEnoughOptions
|
||||
import im.vector.app.test.fakes.FakeSession
|
||||
import im.vector.app.test.test
|
||||
import org.junit.Rule
|
||||
@ -79,4 +80,17 @@ class CreatePollViewModelTest {
|
||||
.assertState(pollViewStateWithQuestionAndNotEnoughOptions)
|
||||
.finish()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `given there is not a question when enough options are added then poll cannot be created and options can be added`() {
|
||||
val createPollViewModel = createPollViewModel(PollMode.CREATE)
|
||||
repeat(CreatePollViewModel.MIN_OPTIONS_COUNT) {
|
||||
createPollViewModel.handle(CreatePollAction.OnOptionChanged(it, fakeOptions[it]))
|
||||
}
|
||||
|
||||
createPollViewModel
|
||||
.test()
|
||||
.assertState(pollViewStateWithoutQuestionAndEnoughOptions)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user