use of com.orgzly.android.db.entity.Repo in project orgzly-android by orgzly.
the class SyncingTest method testPrefaceModificationMakesBookOutOfSync.
@Test
public void testPrefaceModificationMakesBookOutOfSync() {
Repo repo = testUtils.setupRepo(RepoType.MOCK, "mock://repo-a");
testUtils.setupRook(repo, "mock://repo-a/booky.org", "", "abc", 1234567890000L);
ActivityScenario.launch(MainActivity.class);
sync();
onBook(0, R.id.item_book_sync_needed_icon).check(matches(not(isDisplayed())));
// Change preface
onBook(0).perform(click());
onActionItemClick(R.id.books_options_menu_book_preface, R.string.edit_book_preface);
onView(withId(R.id.fragment_book_preface_content)).perform(replaceTextCloseKeyboard("Modified preface"));
onView(withId(R.id.done)).perform(click());
pressBack();
onBook(0, R.id.item_book_sync_needed_icon).check(matches(isDisplayed()));
}
use of com.orgzly.android.db.entity.Repo in project orgzly-android by orgzly.
the class SyncingTest method testForceSavingBookWithLink.
@Test
public void testForceSavingBookWithLink() {
Repo repo = testUtils.setupRepo(RepoType.MOCK, "mock://repo-a");
testUtils.setupBook("booky", "First book used for testing\n* Note A", repo);
ActivityScenario.launch(MainActivity.class);
onView(allOf(withText("booky"), isDisplayed())).perform(longClick());
onView(withId(R.id.books_context_menu_force_save)).perform(click());
onView(withText(R.string.overwrite)).perform(click());
onBook(0, R.id.item_book_last_action).check(matches(withText(endsWith(context.getString(R.string.force_saved_to_uri, "mock://repo-a/booky.org")))));
}
use of com.orgzly.android.db.entity.Repo in project orgzly-android by orgzly.
the class SyncingTest method testDeleteExistingRemoteFile.
@Test
public void testDeleteExistingRemoteFile() {
Repo repo = testUtils.setupRepo(RepoType.MOCK, "mock://repo-a");
testUtils.setupBook("booky", "Sample book used for tests");
ActivityScenario.launch(MainActivity.class);
sync();
onView(allOf(withText("booky"), isDisplayed())).check(matches(isDisplayed()));
onBook(0).perform(longClick());
openContextualToolbarOverflowMenu();
onView(withText(R.string.delete)).perform(click());
onView(withId(R.id.delete_linked_checkbox)).perform(click());
onView(withText(R.string.delete)).perform(click());
Assert.assertEquals(0, dbRepoBookRepository.getBooks(repo.getId(), Uri.parse("mock://repo-a")).size());
}
Aggregations