Skip to content

Commit

Permalink
Ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesonwilliams committed Dec 10, 2024
1 parent 9eda6ad commit 18f7771
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class StoriesTest {
RxJavaPlugins.setIoSchedulerHandler { testScheduler }

SignalDatabase.setSignalDatabaseInstanceForTesting(mockSignalDatabase)
every { SignalDatabase.attachments } returns mockAttachmentTable
every { AppDependencies.jobManager } returns mockJobManager
every { SignalDatabase.attachments } returns mockAttachmentTable
every { AppDependencies.jobManager } returns mockJobManager
every { mockAttachmentTable.getAttachmentsForMessage(any()) } returns emptyList()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class StoryViewerViewModelTest {
RxJavaPlugins.setInitComputationSchedulerHandler { testScheduler }
RxJavaPlugins.setComputationSchedulerHandler { testScheduler }

every { repository.getFirstStory(any(), any()) } returns Single.just(mockk())
every { repository.getFirstStory(any(), any()) } returns Single.just(mockk())
}

@After
Expand All @@ -54,7 +54,7 @@ class StoryViewerViewModelTest {
testScheduler.triggerActions()

// THEN
verify(exactly=0) { repository.getStories(any(), any()) }
verify(exactly = 0) { repository.getStories(any(), any()) }
assertEquals(injectedStories, testSubject.stateSnapshot.pages)
}

Expand All @@ -63,7 +63,7 @@ class StoryViewerViewModelTest {
// GIVEN
val stories: List<RecipientId> = (1L..5L).map(RecipientId::from)
val startStory = RecipientId.from(2L)
every { repository.getStories(any(), any()) } returns Single.just(stories)
every { repository.getStories(any(), any()) } returns Single.just(stories)

// WHEN
val testSubject = StoryViewerViewModel(
Expand All @@ -87,7 +87,7 @@ class StoryViewerViewModelTest {
// GIVEN
val stories: List<RecipientId> = (1L..5L).map(RecipientId::from)
val startStory = RecipientId.from(1L)
every { repository.getStories(any(), any()) } returns Single.just(stories)
every { repository.getStories(any(), any()) } returns Single.just(stories)
val testSubject = StoryViewerViewModel(
StoryViewerArgs(
recipientId = startStory,
Expand All @@ -114,7 +114,7 @@ class StoryViewerViewModelTest {
// GIVEN
val stories: List<RecipientId> = (1L..5L).map(RecipientId::from)
val startStory = stories.last()
every { repository.getStories(any(), any()) } returns Single.just(stories)
every { repository.getStories(any(), any()) } returns Single.just(stories)
val testSubject = StoryViewerViewModel(
StoryViewerArgs(
recipientId = startStory,
Expand All @@ -141,7 +141,7 @@ class StoryViewerViewModelTest {
// GIVEN
val stories: List<RecipientId> = (1L..5L).map(RecipientId::from)
val startStory = stories.last()
every { repository.getStories(any(), any()) } returns Single.just(stories)
every { repository.getStories(any(), any()) } returns Single.just(stories)
val testSubject = StoryViewerViewModel(
StoryViewerArgs(
recipientId = startStory,
Expand All @@ -168,7 +168,7 @@ class StoryViewerViewModelTest {
// GIVEN
val stories: List<RecipientId> = (1L..5L).map(RecipientId::from)
val startStory = stories.first()
every { repository.getStories(any(), any()) } returns Single.just(stories)
every { repository.getStories(any(), any()) } returns Single.just(stories)
val testSubject = StoryViewerViewModel(
StoryViewerArgs(
recipientId = startStory,
Expand All @@ -195,7 +195,7 @@ class StoryViewerViewModelTest {
// GIVEN
val stories: List<RecipientId> = (1L..5L).map(RecipientId::from)
val startStory = stories.first()
every { repository.getStories(any(), any()) } returns Single.just(stories)
every { repository.getStories(any(), any()) } returns Single.just(stories)
val testSubject = StoryViewerViewModel(
StoryViewerArgs(
recipientId = startStory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class StoryViewerPageViewModelTest {

RxAndroidPlugins.setMainThreadSchedulerHandler { testScheduler }

every { repository.forceDownload(any()) } returns Completable.complete()
every { repository.forceDownload(any()) } returns Completable.complete()
}

@After
Expand All @@ -46,7 +46,7 @@ class StoryViewerPageViewModelTest {
fun `Given first page and first post, when I goToPreviousPost, then I expect storyIndex to be 0`() {
// GIVEN
val storyPosts = createStoryPosts(3) { true }
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)
val testSubject = createTestSubject()
testSubject.setIsFirstPage(true)
testScheduler.triggerActions()
Expand All @@ -65,7 +65,7 @@ class StoryViewerPageViewModelTest {
fun `Given first page and second post, when I goToPreviousPost, then I expect storyIndex to be 0`() {
// GIVEN
val storyPosts = createStoryPosts(3) { true }
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)
val testSubject = createTestSubject()
testSubject.setIsFirstPage(true)
testScheduler.triggerActions()
Expand All @@ -86,7 +86,7 @@ class StoryViewerPageViewModelTest {
fun `Given no initial story and 3 records all viewed, when I initialize, then I expect storyIndex to be 0`() {
// GIVEN
val storyPosts = createStoryPosts(3) { true }
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)

// WHEN
val testSubject = createTestSubject()
Expand All @@ -102,7 +102,7 @@ class StoryViewerPageViewModelTest {
fun `Given no initial story and 3 records all not viewed, when I initialize, then I expect storyIndex to be 0`() {
// GIVEN
val storyPosts = createStoryPosts(3) { false }
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)

// WHEN
val testSubject = createTestSubject()
Expand All @@ -118,7 +118,7 @@ class StoryViewerPageViewModelTest {
fun `Given no initial story and 3 records with 2nd is not viewed, when I initialize, then I expect storyIndex to be 1`() {
// GIVEN
val storyPosts = createStoryPosts(3) { it % 2 != 0 }
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)

// WHEN
val testSubject = createTestSubject()
Expand All @@ -134,7 +134,7 @@ class StoryViewerPageViewModelTest {
fun `Given no initial story and 3 records with 1st and 3rd not viewed, when I goToNext, then I expect storyIndex to be 2`() {
// GIVEN
val storyPosts = createStoryPosts(3) { it % 2 == 0 }
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)

// WHEN
val testSubject = createTestSubject()
Expand All @@ -152,7 +152,7 @@ class StoryViewerPageViewModelTest {
fun `Given no unread and jump to next unread enabled, when I goToNext, then I expect storyIndex to be size`() {
// GIVEN
val storyPosts = createStoryPosts(3) { true }
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)

// WHEN
val testSubject = createTestSubject(isJumpForwardToUnviewed = true)
Expand All @@ -170,7 +170,7 @@ class StoryViewerPageViewModelTest {
fun `Given a single story, when I goToPrevious, then I expect storyIndex to be -1`() {
// GIVEN
val storyPosts = createStoryPosts(1)
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)
every { repository.getStoryPostsFor(any(), any()) } returns Observable.just(storyPosts)

// WHEN
val testSubject = createTestSubject()
Expand Down Expand Up @@ -215,7 +215,7 @@ class StoryViewerPageViewModelTest {
hasSelfViewed = isViewed(it)
).apply {
val messageRecord = FakeMessageRecords.buildMediaMmsMessageRecord()
every { conversationMessage.messageRecord } returns messageRecord
every { conversationMessage.messageRecord } returns messageRecord
}
}
}
Expand Down

0 comments on commit 18f7771

Please sign in to comment.