聊天:登录时处理最近私聊过的用户信息

This commit is contained in:
liangtongchuan
2021-03-10 16:02:04 +08:00
parent b822337b82
commit 901995b8ba
3 changed files with 54 additions and 8 deletions

View File

@@ -154,6 +154,25 @@ describe('聊天测试', function() {
}, 1000);
});
it('最近私聊的用户信息', function() {
function checkChatInfos(roleInfo) {
const chatInfos = roleInfo.recentPrivateChats;
if (!chatInfos) {
console.warn(`用户${roleInfo.roleName}没有最近的私聊信息`);
return;
}
for (let chatInfo of chatInfos) {
expect(chatInfo.targetRoleId).to.be.a('string');
expect(chatInfo.targetRoleName).to.be.a('string');
expect(Date.parse(chatInfo.lastChatTime)).to.be.a('number');
expect(Date.parse(chatInfo.lastReadTime)).to.be.a('number');
expect(chatInfo.unreadCnt).to.be.a('number');
}
}
checkChatInfos(roleInfo);
checkChatInfos(roleInfoT);
});
it('测试系统频道橙将合成消息', function(done) {
let msgReceiveCnt = 0;
pinusClientT.on(ON_GROUP_MSG_ROUTE, (res) => {