From d94034621f4d8d2486fa17848f08efd183509e0f Mon Sep 17 00:00:00 2001 From: Mexator Date: Thu, 10 Oct 2024 13:15:49 +0300 Subject: [PATCH] Add CheckResult to KRecycler's childWith --- .../kotlin/io/github/kakaocup/kakao/recycler/KRecyclerView.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kakao/src/main/kotlin/io/github/kakaocup/kakao/recycler/KRecyclerView.kt b/kakao/src/main/kotlin/io/github/kakaocup/kakao/recycler/KRecyclerView.kt index 11b0aed57..2138c77b9 100644 --- a/kakao/src/main/kotlin/io/github/kakaocup/kakao/recycler/KRecyclerView.kt +++ b/kakao/src/main/kotlin/io/github/kakaocup/kakao/recycler/KRecyclerView.kt @@ -3,6 +3,7 @@ package io.github.kakaocup.kakao.recycler import android.view.View +import androidx.annotation.CheckResult import androidx.test.espresso.DataInteraction import androidx.test.espresso.Espresso import androidx.test.espresso.Root @@ -155,6 +156,7 @@ class KRecyclerView : RecyclerActions, BaseAssertions, RecyclerAdapterAssertions * @param childMatcher Matcher for item in adapter * @return Item with type T. To make actions/assertions on it immediately, use perform() infix function. */ + @CheckResult inline fun > childWith(noinline childMatcher: ViewBuilder.() -> Unit): T { val provideItem = itemTypes.getOrElse(T::class) { throw IllegalStateException("${T::class.java.simpleName} did not register to KRecyclerView")