Skip to content
This repository was archived by the owner on Jun 9, 2023. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AbsurdlySuspicious committed Aug 18, 2020
1 parent 8ed87a9 commit 9d13eca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ public SubmissionCommentTreeUiConstructor(
Lazy<VotingManager> votingManager,
Lazy<Markdown> markdown,
Lazy<UserSessionRepository> userSessionRepository,
@Named("show_color_replication_icons") Preference<Boolean> showColorReplicationIcons)
@Named("show_color_replication_icons") Lazy<Preference<Boolean>> showColorReplicationIcons)
{
this.replyRepository = replyRepository;
this.votingManager = votingManager;
this.markdown = markdown;
this.userSessionRepository = userSessionRepository;
this.showColorReplicationIcons = showColorReplicationIcons;
this.showColorReplicationIcons = showColorReplicationIcons.get();
}

@CheckResult
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.saket.dank.ui.comments

import androidx.test.core.app.ApplicationProvider
import com.f2prateek.rx.preferences2.Preference
import com.nhaarman.mockitokotlin2.any
import com.nhaarman.mockitokotlin2.doAnswer
import com.nhaarman.mockitokotlin2.doReturn
Expand Down Expand Up @@ -51,11 +52,16 @@ abstract class SubmissionCommentTreeBaseTest {
it.getArgument<Comment>(0).body
}
}
val prefIcons = mock<Preference<Boolean>> {
on { asObservable() } doReturn Observable.empty()
on { get() } doReturn false
}
uiConstructor = SubmissionCommentTreeUiConstructor(
{ replyRepository },
{ votingManager },
{ markdown },
{ mock() }
{ mock() },
{ prefIcons }
)
SubmissionCommentTreeUiConstructor.COLLAPSED_COMMENT_IDS.clear()
}
Expand Down

0 comments on commit 9d13eca

Please sign in to comment.