test: cover created id fallback keys for create endpoints
This commit is contained in:
@@ -51,6 +51,30 @@ class HttpKanbnApiClientBoardDetailParsingTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun createList_parsesCreatedRefPublicId_fromPublicIdPublic_idAndIdKeys() = runTest {
|
||||||
|
TestServer().use { server ->
|
||||||
|
server.registerSequence(
|
||||||
|
path = "/api/v1/lists",
|
||||||
|
method = "POST",
|
||||||
|
responses = listOf(
|
||||||
|
200 to """{"list":{"publicId":"list-from-publicId"}}""",
|
||||||
|
200 to """{"list":{"public_id":"list-from-public_id"}}""",
|
||||||
|
200 to """{"list":{"id":"list-from-id"}}""",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
val client = HttpKanbnApiClient()
|
||||||
|
val first = client.createList(server.baseUrl, "api", "board-1", "List A", 0)
|
||||||
|
val second = client.createList(server.baseUrl, "api", "board-1", "List B", 1)
|
||||||
|
val third = client.createList(server.baseUrl, "api", "board-1", "List C", 2)
|
||||||
|
|
||||||
|
assertEquals("list-from-publicId", (first as BoardsApiResult.Success<CreatedEntityRef>).value.publicId)
|
||||||
|
assertEquals("list-from-public_id", (second as BoardsApiResult.Success<CreatedEntityRef>).value.publicId)
|
||||||
|
assertEquals("list-from-id", (third as BoardsApiResult.Success<CreatedEntityRef>).value.publicId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun createCard_serializesLocalDateAsUtcMidnight() = runTest {
|
fun createCard_serializesLocalDateAsUtcMidnight() = runTest {
|
||||||
TestServer().use { server ->
|
TestServer().use { server ->
|
||||||
@@ -124,6 +148,30 @@ class HttpKanbnApiClientBoardDetailParsingTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun createCard_parsesCreatedRefPublicId_fromPublicIdPublic_idAndIdKeys() = runTest {
|
||||||
|
TestServer().use { server ->
|
||||||
|
server.registerSequence(
|
||||||
|
path = "/api/v1/cards",
|
||||||
|
method = "POST",
|
||||||
|
responses = listOf(
|
||||||
|
200 to """{"card":{"publicId":"card-from-publicId"}}""",
|
||||||
|
200 to """{"card":{"public_id":"card-from-public_id"}}""",
|
||||||
|
200 to """{"card":{"id":"card-from-id"}}""",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
val client = HttpKanbnApiClient()
|
||||||
|
val first = client.createCard(server.baseUrl, "api", "list-1", "Card A", null, null, emptyList())
|
||||||
|
val second = client.createCard(server.baseUrl, "api", "list-1", "Card B", null, null, emptyList())
|
||||||
|
val third = client.createCard(server.baseUrl, "api", "list-1", "Card C", null, null, emptyList())
|
||||||
|
|
||||||
|
assertEquals("card-from-publicId", (first as BoardsApiResult.Success<CreatedEntityRef>).value.publicId)
|
||||||
|
assertEquals("card-from-public_id", (second as BoardsApiResult.Success<CreatedEntityRef>).value.publicId)
|
||||||
|
assertEquals("card-from-id", (third as BoardsApiResult.Success<CreatedEntityRef>).value.publicId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun getBoardDetailParsesWrappedPayloadWithDueDateVariants() = runTest {
|
fun getBoardDetailParsesWrappedPayloadWithDueDateVariants() = runTest {
|
||||||
TestServer().use { server ->
|
TestServer().use { server ->
|
||||||
|
|||||||
Reference in New Issue
Block a user