From 835c121e43ca98bb569f8161e5de2dd6f0149bb7 Mon Sep 17 00:00:00 2001 From: yamal Date: Mon, 9 Sep 2024 09:34:18 +0200 Subject: [PATCH] ANDROID-15138 Fix click on clear input test --- ...red_when_clicking_on_clear_search_button.png | Bin 11724 -> 0 bytes .../mistica/compose/input/SearchInputTest.kt | 13 +++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) delete mode 100644 library/screenshots/SearchInput_is_cleared_when_clicking_on_clear_search_button.png diff --git a/library/screenshots/SearchInput_is_cleared_when_clicking_on_clear_search_button.png b/library/screenshots/SearchInput_is_cleared_when_clicking_on_clear_search_button.png deleted file mode 100644 index 8f523f08e95e032a42ef65eead97bb3f1d7f8704..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11724 zcmb7qcR1T$`#)8*lvb@GXp2&cs=aE}C}OMDtky`Ru}6tjiY`H0)E=q5irBMuDY17F ztBBdwNR9A&)6esHoBNP5`|DKA;bL(}iZ*=TV%BI^C;YuH<|x_RI|P-PrSHu*8Y4q(?{WIU$v(NDF>k@`I(u6A3uJ) zY-hlvZurk9HqNLcy-+0~G)e8VQ6!CwpiqIXp`l@m+W*j~XBE78^QJe?*z|nOy)x~a zGr7gZl6-u8=cP@USy}Ni*6@|p)!rN6u?}ZA+4uI}cAV2U6 zF^ZU5TW@6D`b$B`{;o0+nxrX!a`kxo@eIB6w7{)f+u_K+qjr;fTT2bMu8&0X+?mPE z&!@LaN27<6xG7GDqlLS#f4o1=7B;%(>hZ2CSnaLPIKNX7-RWR(T;{XuAa`C71$G)4 zCnvp#@StQFw-(E$Kx~7^DTVT=K$3uv5bbXod)DsTPblc&O>@$B0}o}U8qS;$1ShAz zQ+*VcW&v5zwre&tWll|W|23yhG(Vk9Cam#DecB}U>dY78OQYDo|J5u5(y9a+8W~-t zm&wm}3JIm8q+DDXDcIQiXOfZ*| zY_7wjsporbY;6ty4)sWEwWYq!e1=L(8wV!U~gpdJ26h@=KM}r~h}!I$~1ke!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/com/telefonica/mistica/compose/input/SearchInputTest.kt index 38f9a156f..a60f22a4a 100644 --- a/library/src/test/java/com/telefonica/mistica/compose/input/SearchInputTest.kt +++ b/library/src/test/java/com/telefonica/mistica/compose/input/SearchInputTest.kt @@ -10,10 +10,15 @@ import com.telefonica.mistica.testutils.ScreenshotsTest import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith +import org.mockito.kotlin.mock +import org.mockito.kotlin.verify import org.robolectric.RobolectricTestRunner @RunWith(RobolectricTestRunner::class) class SearchInputTest : ScreenshotsTest() { + + private val onValueChangeMock: (String) -> Unit = mock() + @get:Rule val composeTestRule = createComposeRule() @@ -44,7 +49,7 @@ class SearchInputTest : ScreenshotsTest() { whenClickingOnClearSearch() - thenScreenshotIsOk() + thenValueIsNowEmptyString() } private fun givenSomeSearchInput(value: String, enabled: Boolean = true) { @@ -52,7 +57,7 @@ class SearchInputTest : ScreenshotsTest() { MisticaTheme(brand = MovistarBrand) { SearchInput( value = value, - onValueChange = { }, + onValueChange = onValueChangeMock, label = "Search something", enabled = enabled ) @@ -67,4 +72,8 @@ class SearchInputTest : ScreenshotsTest() { private fun thenScreenshotIsOk() { compareScreenshot(composeTestRule.onRoot()) } + + private fun thenValueIsNowEmptyString() { + verify(onValueChangeMock).invoke("") + } }