Let start and due go without a time on their own (#101)

This commit is contained in:
makiolaj committed 2026-11-17 16:31:17 +01:00
1 parent 3f009666c2
commit 3adfeb16a5
39 files changed
+1379 -104

No files matched your search

@@ -193,6 +193,23 @@ class TasksDatabaseMigrationTest {
}
}
@Test
fun leavesExistingTasksWithBothEndsAsTheyWere() {
helper.createDatabase(TEST_DB, 6).use { db ->
db.execSQL("INSERT INTO task_lists (id, name, color) VALUES (1, 'Personal', 0)")
db.execSQL("INSERT INTO tasks (id, list_id, uid, dtstart, due, is_all_day) VALUES (1, 1, 'a', 0, 3600000, 0)")
}
helper.runMigrationsAndValidate(TEST_DB, 7, true, TasksDatabase.MIGRATION_6_7).use { db ->
db.query("SELECT untimed, dtstart, due FROM tasks").use { c ->
assertThat(c.moveToFirst()).isTrue()
assertThat(c.isNull(0)).isTrue()
assertThat(c.getLong(1)).isEqualTo(0L)
assertThat(c.getLong(2)).isEqualTo(3_600_000L)
}
}
}
private companion object {
const val TEST_DB = "migration-test.db"
}