mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 20:55:10 +00:00
Implement proper story viewer ordering.
This commit is contained in:
committed by
Cody Henthorne
parent
157198fd17
commit
469879c211
@@ -101,6 +101,24 @@ class StoryViewerPageViewModelTest {
|
||||
testSubscriber.assertValueAt(0) { it.selectedPostIndex == 2 }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Given a single story, when I goToPrevious, then I expect storyIndex to be -1`() {
|
||||
// GIVEN
|
||||
val storyPosts = createStoryPosts(1)
|
||||
whenever(repository.getStoryPostsFor(any())).thenReturn(Observable.just(storyPosts))
|
||||
|
||||
// WHEN
|
||||
val testSubject = createTestSubject()
|
||||
testScheduler.triggerActions()
|
||||
testSubject.goToPreviousPost()
|
||||
testScheduler.triggerActions()
|
||||
|
||||
// THEN
|
||||
val testSubscriber = testSubject.state.test()
|
||||
|
||||
testSubscriber.assertValueAt(0) { it.selectedPostIndex == -1 }
|
||||
}
|
||||
|
||||
private fun createTestSubject(): StoryViewerPageViewModel {
|
||||
return StoryViewerPageViewModel(
|
||||
RecipientId.from(1),
|
||||
|
||||
Reference in New Issue
Block a user