From the course: Android Compose with Kotlin
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Challenge: To the top - Kotlin Tutorial
From the course: Android Compose with Kotlin
Challenge: To the top
(upbeat music) - [Instructor] For your final challenge, you'll be writing a UI test for the session screen. I've gone ahead and added some new functionality to our app. When you scroll down the list and click on the Sessions tab again, it brings you back to the top. So here's what you'll need to do. Implement the code for the should_scroll_to_top_when_tab_clicked function, definitely a mouthful. Here are the TODOs. First, you need to scroll to the last session, and you'll want to take advantage of the SessionInfo.fake5 object to do this, then assert it's displayed. Next, you want to click on the sessions tab and assert it's selected. And finally, you want to assert that the first session is displayed, meaning it's gone back to the top. For that, you'll want to use SessionInfo.fake. You can use the Compose testing cheat sheet for helpful API references. Make sure you watch the solution video where I'll walk you through my approach to this challenge. See you soon.