Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpanDrawableMatcher with assertions and tests #70

Merged
merged 2 commits into from
Jan 19, 2023

Conversation

pisanyialeksei
Copy link
Contributor

SpanDrawableMatcher with assertions in TextViewAssertions and test in TextViewTest

Copy link
Contributor

@Unlimity Unlimity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome contribution! Thanks for your work 👍

@Vacxe
Copy link
Member

Vacxe commented Jan 18, 2023

@pisanyialeksei appreciate for the contribution mate! LGTM. Please fix detekt issues and Ill happy to merge it.

ReturnCount - [matchesSafely] at /home/runner/work/Kakao/Kakao/kakao/src/main/kotlin/io/github/kakaocup/kakao/common/matchers/SpanDrawableMatcher.kt:35:18
	MagicNumber - [<anonymous>] at /home/runner/work/Kakao/Kakao/sample/src/main/kotlin/io/github/kakaocup/sample/TextActivity.kt:63:41
	MagicNumber - [<anonymous>] at /home/runner/work/Kakao/Kakao/sample/src/main/kotlin/io/github/kakaocup/sample/TextActivity.kt:63:45
	MagicNumber - [<anonymous>] at /home/runner/work/Kakao/Kakao/sample/src/main/kotlin/io/github/kakaocup/sample/TextActivity.kt:[69](https://github.com/KakaoCup/Kakao/actions/runs/3929041418/jobs/6737835557#step:4:70):41
	MagicNumber - [<anonymous>] at /home/runner/work/Kakao/Kakao/sample/src/main/kotlin/io/github/kakaocup/sample/TextActivity.kt:69:45

@Vacxe Vacxe added the enhancement New feature or request label Jan 18, 2023
@pisanyialeksei pisanyialeksei requested review from Unlimity and removed request for Vacxe January 19, 2023 10:11
}

override fun matchesSafely(view: View?): Boolean {

if (view !is TextView && drawable == null) {
if (view !is TextView?) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first, I took this comparison from DrawableMatcher
view !is TextView && drawable == null
but I can't understand why there was a comparison of drawable with null. So I removed it. Let me know if it's a mistake and a second comparison is needed here

@Vacxe Vacxe merged commit 62d8222 into KakaoCup:master Jan 19, 2023
@Vacxe Vacxe self-requested a review January 19, 2023 11:38
@pisanyialeksei pisanyialeksei deleted the span-drawable-matcher branch January 19, 2023 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants