mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 12:57:04 +05:30
fix(model): drop unused User#karma
field and update test cases
This commit is contained in:
parent
ca88d627ff
commit
f16ae4ff0b
5 changed files with 3 additions and 4 deletions
|
@ -40,7 +40,7 @@ class ApiTest {
|
|||
|
||||
@Test
|
||||
fun `post details with comments`() = runBlocking {
|
||||
val postDetails = api.getPostDetails("d9ucpe")
|
||||
val postDetails = api.getPostDetails("tdfoqh")
|
||||
assertEquals(7, postDetails.comments.size)
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ class FakeApi(private val delegate: BehaviorDelegate<LobstersApi>) : LobstersApi
|
|||
private val json = Json { ignoreUnknownKeys = true }
|
||||
private val hottest: List<LobstersPost> = json.decodeFromString(getJson("hottest.json"))
|
||||
private val postDetails: LobstersPostDetails =
|
||||
json.decodeFromString(getJson("post_details_d9ucpe.json"))
|
||||
json.decodeFromString(getJson("post_details_tdfoqh.json"))
|
||||
private val user: User = json.decodeFromString(getJson("msfjarvis.json"))
|
||||
|
||||
override suspend fun getHottestPosts(page: Int): List<LobstersPost> {
|
||||
|
|
File diff suppressed because one or more lines are too long
1
api/src/test/resources/post_details_tdfoqh.json
Normal file
1
api/src/test/resources/post_details_tdfoqh.json
Normal file
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,6 @@ import kotlinx.serialization.Serializable
|
|||
class User(
|
||||
val username: String,
|
||||
val about: String,
|
||||
val karma: Long,
|
||||
@SerialName("invited_by_user") val invitedBy: String,
|
||||
@SerialName("avatar_url") val avatarUrl: String,
|
||||
@SerialName("created_at") val createdAt: String,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue