Skip to content

Commit

Permalink
ANDROID-13796 add TextInputWithError test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeprubio committed Oct 11, 2023
1 parent 7416b62 commit fdb6337
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Binary file added library/screenshots/check_TextInputWithError.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
package com.telefonica.mistica.input

import android.util.Log
import android.view.LayoutInflater
import android.widget.FrameLayout
import android.widget.ScrollView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.rules.activityScenarioRule
import com.telefonica.mistica.DummyActivity
import com.telefonica.mistica.R
Expand Down Expand Up @@ -40,4 +36,17 @@ internal class TextInputTest: ScreenshotsTest() {
compareScreenshot(onView(ViewMatchers.withId(R.id.dummy_activity_wrapper)))
}
}

@Test
fun `check TextInputWithError`() {
rule.scenario.onActivity { activity ->
val wrapper: FrameLayout = activity.findViewById(R.id.dummy_activity_wrapper)
val textInput = TextInput(activity)
wrapper.addView(textInput)
textInput.text = "Hello android devs!"
textInput.error = "Whatever error"

compareScreenshot(onView(ViewMatchers.withId(R.id.dummy_activity_wrapper)))
}
}
}

0 comments on commit fdb6337

Please sign in to comment.