Skip to content

Commit

Permalink
Add tests for missing back button when stack root is set with multipl…
Browse files Browse the repository at this point in the history
…e children
  • Loading branch information
guyca committed Jun 27, 2019
1 parent 96661e3 commit 1f9734d
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,18 @@ public void onSuccess(String childId) {
});
}

@Test
public void setRoot_backButtonIsAddedToAllChildren() {
Robolectric.getForegroundThreadScheduler().pause();

activity.setContentView(uut.getView());
disablePushAnimation(child1, child2);

uut.setRoot(Arrays.asList(child1, child2), new CommandListenerAdapter());
assertThat(child1.options.topBar.buttons.back.visible.get(false)).isFalse();
assertThat(child2.options.topBar.buttons.back.visible.get(false)).isTrue();
}

@Test
public void setRoot_doesNotCrashWhenCalledInQuickSuccession() {
disablePushAnimation(child1);
Expand Down

0 comments on commit 1f9734d

Please sign in to comment.