完成10%
This commit is contained in:
@@ -33,3 +33,41 @@ test('动态列表要求服务端返回 feedId 和 feedContent', () => {
|
||||
});
|
||||
assert.equal(FeedPages.normalizeFeed({ feedId: 7001, content: '旧字段' }), null);
|
||||
});
|
||||
|
||||
test('评论请求只提交 Apifox 定义的 commentContent 和父评论 ID', () => {
|
||||
assert.deepEqual(FeedPages.buildCommentBody({
|
||||
commentContent: '收到',
|
||||
parentCommentId: '2060000000000000000',
|
||||
replyUserId: '2060000000000000001'
|
||||
}), {
|
||||
commentContent: '收到',
|
||||
parentCommentId: '2060000000000000000'
|
||||
});
|
||||
});
|
||||
|
||||
test('评论响应使用 commentContent,并保留已删除评论的占位状态', () => {
|
||||
assert.deepEqual(FeedPages.normalizeComment({
|
||||
commentId: '2060000000000000000',
|
||||
commentContent: '收到',
|
||||
appUserNickName: '小李',
|
||||
replyCount: 2,
|
||||
userDeleted: '0'
|
||||
}), {
|
||||
commentId: '2060000000000000000',
|
||||
commentContent: '收到',
|
||||
appUserNickName: '小李',
|
||||
replyCount: 2,
|
||||
userDeleted: false
|
||||
});
|
||||
assert.deepEqual(FeedPages.normalizeComment({
|
||||
commentId: '2060000000000000001',
|
||||
commentContent: null,
|
||||
userDeleted: '1'
|
||||
}), {
|
||||
commentId: '2060000000000000001',
|
||||
commentContent: '该评论已删除',
|
||||
appUserNickName: undefined,
|
||||
replyCount: undefined,
|
||||
userDeleted: true
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user