聊天:初始化时获取群消息

This commit is contained in:
liangtongchuan
2021-03-10 16:42:03 +08:00
parent 99a3098bea
commit 24f297b480
4 changed files with 54 additions and 8 deletions

View File

@@ -173,6 +173,28 @@ describe('聊天测试', function() {
checkChatInfos(roleInfoT);
});
it('最近群聊的消息', function() {
function checkMsgs(msgs, roleName) {
expect(msgs).to.be.an('array');
if (msgs.length === 0) {
console.warn(`用户${roleName}缺少群消息`);
}
for (let msg of msgs) {
expect(msg.roleId).to.be.a('string');
expect(msg.roleName).to.be.a('string');
expect(msg.content).to.be.a('string');
expect(msg.roomId).to.be.a('string');
}
}
function checkAllGroupMsgs(roleInfo) {
checkMsgs(roleInfo.sysMsgs, roleInfo.roleName);
checkMsgs(roleInfo.worldMsgs, roleInfo.roleName);
checkMsgs(roleInfo.guildMsgs, roleInfo.roleName);
}
checkAllGroupMsgs(roleInfo);
checkAllGroupMsgs(roleInfoT);
});
it('测试系统频道橙将合成消息', function(done) {
let msgReceiveCnt = 0;
pinusClientT.on(ON_GROUP_MSG_ROUTE, (res) => {