Files
Lawnchair/tests/src/com/android/launcher3/DeleteDropTargetTest.kt
T
Andrew Cole 47e1423584 Reverting isTextClippedVerticallyTest
Reverting the isTextClippedVerticallyTest Unit test becase it is causing errors in post submit.

Test: Run isTextClippedVerticallyTest
Bug: 279464742
Change-Id: I766c867d07f0a911fd4017c9505e68638a9a3643
2023-04-24 15:32:35 -07:00

46 lines
1.5 KiB
Kotlin

package com.android.launcher3
import android.content.Context
import androidx.test.core.app.ApplicationProvider.getApplicationContext
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.launcher3.Utilities.*
import com.android.launcher3.util.ActivityContextWrapper
import com.google.common.truth.Truth.assertThat
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
@RunWith(AndroidJUnit4::class)
class DeleteDropTargetTest {
private var mContext: Context = ActivityContextWrapper(getApplicationContext())
// Use a non-abstract class implementation
private var buttonDropTarget: DeleteDropTarget = DeleteDropTarget(mContext)
@Before
fun setup() {
enableRunningInTestHarnessForTests()
}
// Needs mText, mTempRect, getPaddingTop, getPaddingBottom
// availableHeight as a parameter
@Ignore("TODO(b/279464742)")
@Test
fun isTextClippedVerticallyTest() {
buttonDropTarget.mText = "My Test"
// No space for text
assertThat(buttonDropTarget.isTextClippedVertically(30)).isTrue()
// Some space for text, and just enough that the text should not be clipped
assertThat(buttonDropTarget.isTextClippedVertically(50)).isFalse()
// A lot of space for text so the text should not be clipped
assertThat(buttonDropTarget.isTextClippedVertically(100)).isFalse()
}
}