Skip to content

Commit

Permalink
Add wait in updated url test
Browse files Browse the repository at this point in the history
  • Loading branch information
bentrengrove committed May 17, 2022
1 parent a0d6333 commit 1884715
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions web/src/androidTest/kotlin/com/google/accompanist/web/WebTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class WebTest {

@Test
fun testUrlUpdatedWithRemember() {
val url = mutableStateOf("https://google.com")
val url = mutableStateOf("about:blank")
rule.setContent {
@Composable
fun MyWebView(url: String) {
Expand All @@ -195,12 +195,14 @@ class WebTest {

// Ensure the data is loaded first
onWebView()
.check(webMatches(getCurrentUrl(), containsString("google.com")))
.check(webMatches(getCurrentUrl(), containsString("about:blank")))

url.value = LINK_URL

url.value = "https://github.com"
rule.waitForIdle()

onWebView()
.check(webMatches(getCurrentUrl(), containsString("github.com")))
.check(webMatches(getCurrentUrl(), containsString(LINK_URL)))
}

@Test
Expand Down

0 comments on commit 1884715

Please sign in to comment.