Skip to content

Commit

Permalink
Remove GitRepo-specific tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amberin authored Nov 25, 2024
1 parent 08b2bc1 commit 8a318fb
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions app/src/test/java/com/orgzly/android/repos/GitRepoTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,40 +97,4 @@ class GitRepoTest : SyncRepoTest {
gitFileSynchronizer.mergeWithRemote()
return expectedRookUri.toString()
}

/**
* Ensure we support syncing to a new, empty Git repo.
* Also tests that a book without a link is linked and synced, if possible.
*/
@Test
fun testSyncRepo_repoHasNoCommits() {
testUtils.setupBook("A Book", "...")
syncRepo.syncRepo(dataRepository)
val bookView = dataRepository.getBooks()[0]
Assert.assertEquals(syncRepo.uri.toString(), bookView.linkRepo!!.url)
Assert.assertNotNull(bookView.syncedTo?.revision)
Assert.assertTrue(bookView.book.lastAction!!.message.contains("Saved to "))
}

@Test
fun testSyncRepo_bookWithoutLinkAndMultipleRepos() {
// Add a second repo
testUtils.setupRepo(RepoType.MOCK, "mock://repo")
testUtils.setupBook("A Book", "...")

syncRepo.syncRepo(dataRepository)

val bookView = dataRepository.getBooks()[0]
Assert.assertEquals(BookAction.Type.ERROR, bookView.book.lastAction!!.type)
Assert.assertTrue(bookView.book.lastAction!!.message.contains("multiple repositories"))
}

/**
* The very first sync is special, since the remote head has not changed since cloning, but
* we want to be sure that all books are loaded.
*/
@Test
fun testSyncRepo_firstSyncAfterCloning() {
return // TODO
}
}

0 comments on commit 8a318fb

Please sign in to comment.