agoda-com / Kakao

This repo is no longer supported. Please visit a https://github.com/KakaoCup/Kakao
Apache License 2.0
1.11k stars 102 forks source link

Add TextInputLayoutAssertions.hasHint(@StringRes resId: Int) #217

Closed igorwojda closed 4 years ago

igorwojda commented 4 years ago

Now in TextInputLayoutAssertions we only have a way to verity hint by using string fun hasHint(hint: String)

It would be nice to also have a way to use resource (to match TextViewAssertions class) hasHint(@StringRes resId: Int)

igorwojda commented 4 years ago

Workaround

fun KTextInputLayout.hasHint(@StringRes resId: Int) {
    hasHint(getResourceString(resId))
}

private fun getResourceString(@StringRes resId: Int): String {
    val targetContext: Context = InstrumentationRegistry.getInstrumentation().targetContext
    return targetContext.resources.getString(resId)
}
Unlimity commented 4 years ago

Hey there! Thanks for reaching out! That proposal sounds valid and useful, and I encourage you to submit a PR 👍

igorwojda commented 4 years ago
  1. PR https://github.com/agoda-com/Kakao/pull/218

  2. CONTRIBUTING.md file is a bit incomplete points 1-3 are fine, but

    • pkt. 4 talks about running tests without any guides how to do so (command would be nice - just ./gradlew test ?)
    • pkt. 5 talks about running code coverage without any guides how to do so (AS build in? cmd?)
    • pkt. 7 Running git ls-files -z | while IFS= read -rd '' f; do tail -c1 < "$f" | read -r _ || echo >> "$f"; done messes up with a lot of files untouched by PR
  3. Also after running TextInputLayoutTest tests from IDE image

I got this error 🤔 image

Unlimity commented 4 years ago

It seems that we need to revise contribution instructions 👍

Vacxe commented 4 years ago

Close: #219

Unlimity commented 4 years ago

PR with this feature has been merged