Skip to content

Commit

Permalink
Fix broken activity launch
Browse files Browse the repository at this point in the history
  • Loading branch information
amberin committed Sep 7, 2024
1 parent 84e0685 commit 5dc6b54
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ private ActivityScenario<BookChooserActivity> startActivityWithCreateShortcutAct
return ActivityScenario.launch(intent);
}

private ActivityScenario<BookChooserActivity> startActivityForResult() {
Intent intent = new Intent(context, BookChooserActivity.class);
intent.setAction(Intent.ACTION_CREATE_SHORTCUT);
return ActivityScenario.launchActivityForResult(intent);
}

@Before
public void setUp() throws Exception {
super.setUp();
Expand Down Expand Up @@ -60,7 +66,7 @@ public void testLongClickChoosesBook() {

@Test
public void testCreateShortcut() {
ActivityScenario<BookChooserActivity> scenario = startActivityWithCreateShortcutAction();
ActivityScenario<BookChooserActivity> scenario = startActivityForResult();

onView(allOf(withText("book-one"), isDisplayed())).perform(click());

Expand Down

0 comments on commit 5dc6b54

Please sign in to comment.