Skip to content

Commit

Permalink
Fix a test to pass on one emulator
Browse files Browse the repository at this point in the history
Instead of clicking on URLSpan, note is opened.
  • Loading branch information
nevenz committed Jan 7, 2018
1 parent 2a30e9b commit 17a5d3d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static com.orgzly.android.espresso.EspressoUtils.onListItem;
import static org.hamcrest.CoreMatchers.containsString;

public class InternalLinksTest extends OrgzlyTest {
@Rule
Expand All @@ -30,7 +31,7 @@ public void setUp() throws Exception {
"[[id:bdce923b-C3CD-41ED-B58E-8BDF8BABA54F]]\n" +

"* Note [a-2]\n" +
"[[#Different case custom id]]\n" +
"[[#Different case custom id]] \n" + // click() opens a note without trailing space

"* Note [a-3]\n" +
"[[#Link to note in a different book]]\n" +
Expand Down Expand Up @@ -75,7 +76,7 @@ public void testDifferentCaseUuidInternalLink() {
@Test
public void testDifferentCaseCustomIdInternalLink() {
onListItem(0).perform(click());
onView(withText("#Different case custom id")).perform(click());
onView(withText(containsString("#Different case custom id"))).perform(click());
onView(withId(R.id.fragment_note_title)).check(matches(withText("Note [b-1]")));
}
}

0 comments on commit 17a5d3d

Please sign in to comment.