1 parent
a890c230ac
commit
7b3eeb8fe6
2 files changed
+47
No files matched your search
@@ -79,6 +79,27 @@ do
|
||||
review = { content = "点评", createTime = 1, author = { name = "甲" } },
|
||||
})
|
||||
Assert.eq(with_replies.replies, 4)
|
||||
Assert.is_nil(with_replies.images)
|
||||
local pictured = Reviews.item({
|
||||
reviewId = "pic", likesCount = 2,
|
||||
review = {
|
||||
content = "带图", createTime = 3, author = { name = "甲" },
|
||||
pictures = {
|
||||
{ url = "https://weread-picture.example/a.png", width = 800, height = 1067 },
|
||||
{ url = "", width = 1, height = 1 },
|
||||
},
|
||||
},
|
||||
})
|
||||
Assert.len(pictured.images, 1)
|
||||
Assert.eq(pictured.images[1].url, "https://weread-picture.example/a.png")
|
||||
Assert.eq(pictured.images[1].width, 800)
|
||||
Assert.eq(pictured.images[1].height, 1067)
|
||||
Assert.eq(pictured.images[1].headers.Referer, "https://weread.qq.com/")
|
||||
local reply = Reviews.commentItem({
|
||||
commentId = "c", content = "回复", createTime = 4, author = { name = "乙" },
|
||||
pictures = { { url = "https://weread-picture.example/b.png", width = 40, height = 40 } },
|
||||
})
|
||||
Assert.eq(reply.images[1].url, "https://weread-picture.example/b.png")
|
||||
end
|
||||
|
||||
do -- 想法下的评论页:楼中楼只记被回复者;空列表但声称有条数是失败;游标不前进就停
|
||||
|
||||
Reference in new issue
Block a user