Skip to content

Commit

Permalink
refactor(capture-sdk): Fix camera and onboarding tests
Browse files Browse the repository at this point in the history
BSDK-258
  • Loading branch information
a-szotyori committed Jan 18, 2024
1 parent b653fe6 commit ff2cd70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class CameraFragmentImplTest {
}
}
})
whenever(fragmentCallbackStub.findNavController()).thenReturn(mock())

val fragmentImpl = CameraFragmentImpl(fragmentCallbackStub)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ class OnboardingScreenPresenterTest {

@Test
@Throws(Exception::class)
fun `notify listener to close onboarding when show next page on last page was requested`() {
fun `notify view to close onboarding when show next page on last page was requested`() {
// Given
val presenter = createPresenter()
val listener = mock<OnboardingFragmentListener>()
presenter.setListener(listener)

// When
val customPages: List<OnboardingPage> = Lists.newArrayList(
Expand All @@ -96,7 +94,7 @@ class OnboardingScreenPresenterTest {
presenter.showNextPage()

// Then
Mockito.verify(listener).onCloseOnboarding()
Mockito.verify(mView).close()
}

@Test
Expand Down Expand Up @@ -241,14 +239,11 @@ class OnboardingScreenPresenterTest {
// Given
val presenter = createPresenter()

val listener = mock<OnboardingFragmentListener>()
presenter.setListener(listener)

// When
presenter.skip()

// Then
verify(listener).onCloseOnboarding()
verify(mView).close()
}

@Test
Expand Down

0 comments on commit ff2cd70

Please sign in to comment.