Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public open class ReactSwipeRefreshLayout(reactContext: ReactContext) :
private var intercepted: Boolean = false
private var nativeGestureStarted: Boolean = false

init {
clipChildren = false
}

override var hasChildPressedStateDelay: Boolean? = null

public override fun setRefreshing(refreshing: Boolean) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.views.swiperefresh

import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactTestHelper.createTestReactApplicationContext
import com.facebook.testutils.shadows.ShadowSoLoader
import org.assertj.core.api.Assertions.assertThat
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config

/** Verifies behavior of [ReactSwipeRefreshLayout]. */
@RunWith(RobolectricTestRunner::class)
@Config(shadows = [ShadowSoLoader::class])
class ReactSwipeRefreshLayoutTest {

private lateinit var context: ReactApplicationContext

@Before
fun setup() {
context = createTestReactApplicationContext()
}

@Test
fun testClipChildrenIsDisabledByDefault() {
val layout = ReactSwipeRefreshLayout(context)
assertThat(layout.clipChildren).isFalse()
}
}
Loading