Skip to content

Commit

Permalink
Add test for TreehouseAppContent#bind idempotency (#1712)
Browse files Browse the repository at this point in the history
  • Loading branch information
veyndan authored Nov 30, 2023
1 parent c09d821 commit bb8f233
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,20 @@ class TreehouseAppContentTest {
content.unbind()
}

@Test
fun bind_idempotent() = runTest {
val content = treehouseAppContent()

val view1 = treehouseView("view1")
content.bind(view1)
eventLog.takeEvent("codeListener.onInitialCodeLoading(view1)")

content.bind(view1)
eventLog.assertNoEvents()

content.unbind()
}

private fun treehouseAppContent(): TreehouseAppContent<FakeAppService> {
return TreehouseAppContent(
codeHost = codeHost,
Expand Down

0 comments on commit bb8f233

Please sign in to comment.