From a7039b15e9e41f4290b8859a98a22507909dcc64 Mon Sep 17 00:00:00 2001 From: mcarare Date: Wed, 3 Jun 2020 19:22:59 +0300 Subject: [PATCH] For #11182: Update unit tests to reflect click listener update. --- .../collections/CollectionCreationBottomBarViewTest.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/test/java/org/mozilla/fenix/collections/CollectionCreationBottomBarViewTest.kt b/app/src/test/java/org/mozilla/fenix/collections/CollectionCreationBottomBarViewTest.kt index b72d81f576..7783a4da00 100644 --- a/app/src/test/java/org/mozilla/fenix/collections/CollectionCreationBottomBarViewTest.kt +++ b/app/src/test/java/org/mozilla/fenix/collections/CollectionCreationBottomBarViewTest.kt @@ -10,8 +10,8 @@ import android.widget.Button import android.widget.ImageButton import android.widget.TextView import androidx.core.view.isVisible -import io.mockk.Called import io.mockk.mockk +import io.mockk.spyk import io.mockk.verify import mozilla.components.feature.tab.collections.TabCollection import mozilla.components.support.test.robolectric.testContext @@ -37,7 +37,7 @@ class CollectionCreationBottomBarViewTest { @Before fun setup() { interactor = mockk(relaxed = true) - layout = mockk(relaxed = true) + layout = spyk() iconButton = ImageButton(testContext) textView = TextView(testContext) saveButton = Button(testContext) @@ -69,12 +69,10 @@ class CollectionCreationBottomBarViewTest { fun testIconButtonUpdateForSelectCollection() { bottomBarView.update(SaveCollectionStep.SelectCollection, CollectionCreationState()) - verify { layout wasNot Called } - assertEquals(null, iconButton.contentDescription) assertEquals(View.IMPORTANT_FOR_ACCESSIBILITY_NO, iconButton.importantForAccessibility) - iconButton.performClick() + layout.performClick() verify { interactor.addNewCollection() } }