Add description test, redact descriptions

pull/3212/head
Alex Baker 12 months ago
parent d1305f67bb
commit 084a66c630

@ -32,7 +32,7 @@ data class Tasks(
) { ) {
@Serializable @Serializable
data class Body( data class Body(
val content: String, @Redacted val content: String,
val contentType: String, val contentType: String,
) )

@ -1,12 +1,12 @@
package org.tasks.sync.microsoft package org.tasks.sync.microsoft
import com.natpryce.makeiteasy.MakeItEasy import com.natpryce.makeiteasy.MakeItEasy
import org.tasks.data.entity.Task
import org.junit.Assert import org.junit.Assert
import org.junit.Assert.assertEquals import org.junit.Assert.assertEquals
import org.junit.Test import org.junit.Test
import org.tasks.TestUtilities import org.tasks.TestUtilities
import org.tasks.TestUtilities.withTZ import org.tasks.TestUtilities.withTZ
import org.tasks.data.entity.Task
import org.tasks.makers.TaskMaker import org.tasks.makers.TaskMaker
import org.tasks.time.DateTime import org.tasks.time.DateTime
@ -23,6 +23,12 @@ class ConvertFromMicrosoftTests {
Assert.assertNull(local.notes) Assert.assertNull(local.notes)
} }
@Test
fun parseDescription() {
val (local, _) = TestUtilities.mstodo("microsoft/task_with_description.json")
assertEquals("Hello world\r\n", local.notes)
}
@Test @Test
fun keepPriority() { fun keepPriority() {
val (local, _) = TestUtilities.mstodo( val (local, _) = TestUtilities.mstodo(

@ -0,0 +1,26 @@
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.todoTask)",
"@odata.nextLink": "https://graph.microsoft.com/v1.0/me/todo/lists/AQMkADAwATNiZmYAZC04OABiMC0xZDlkLTAwAi0wMAoALgAAA8dKmrSa60tBjeiKoPukmoQBAEkTxp6Wx2BEtV1vFJWK7bIAAAIBEgAAAA==/tasks/delta?$skiptoken=l7WI41swwioT5csv4k99noMOR2XnZZ5Wc8frjx-RT_TDDIyp_vJ65WUQiySHwZx4_QMi1lzQHbtnr5GuFbJF5QDu-zXP7TmoSNt7BhiISOE.Ls-yF3bzjZWbbpBGCOTb28JLYsg97EbWUhoh9JBfoCw",
"value": [
{
"@odata.etag": "W/\"SRPGnpbHYES1XW8UlYrtsgAHuEeOlg==\"",
"importance": "normal",
"isReminderOn": false,
"status": "completed",
"title": "Test with description",
"createdDateTime": "2024-12-28T08:03:47.7475279Z",
"lastModifiedDateTime": "2024-12-28T08:34:49.375729Z",
"hasAttachments": false,
"categories": [],
"id": "AQMkADAwATNiZmYAZC04OABiMC0xZDlkLTAwAi0wMAoARgAAA8dKmrSa60tBjeiKoPukmoQHAEkTxp6Wx2BEtV1vFJWK7bIAAAIBEgAAAEkTxp6Wx2BEtV1vFJWK7bIAB7gay5oAAAA=",
"body": {
"content": "Hello world\r\n",
"contentType": "text"
},
"completedDateTime": {
"dateTime": "2024-12-28T06:00:00.0000000",
"timeZone": "UTC"
}
}
]
}
Loading…
Cancel
Save