안드로이드 테스트

ViewModel에 의존하는 Composable을 테스트할 때 문제점 Composable은 기본적으로 State Hoisting을 통해 ViewModel에 직접 의존하지 않도록 만들어야 하지만, 최상위에 있는 Screen Composable은 상태값을 가지고 있는 ViewModel 객체에 의존해야 한다. *만약 State Hoisting이 무엇인지 모른다면 다음 두 개의 글을 참고하도록 하자. [Android Compose State] State Hoisting(상태 호이스팅) 패턴이란 무엇인가? Compose의 State 선언형 UI 프레임워크인 Compose는 Stateless함이 가장 큰 장점이다. UI에 대한 UI상태의 상호 의존성을 끊을 수 있다면 UI의 재사용성이 생기고, UI에 대한 테스트 ..
안드로이드 UI 테스트 준비하기 안드로이드 UI 테스트를 위해 다음과 같은 모양의 EmojiTextComposable을 준비하자. @Composable fun EmojiText( modifier: Modifier = Modifier, emoji: String, content: String, contentDescription: String? = null, ) { Card( modifier = modifier.semantics { this.contentDescription = contentDescription ?: "" }, colors = CardDefaults.cardColors(containerColor = Color.LightGray.copy(alpha = 0.2f)), elevation = Card..
Dev.Cho
'안드로이드 테스트' 태그의 글 목록