聊天:修改部分接口字段和命名

This commit is contained in:
liangtongchuan
2021-03-11 17:01:15 +08:00
parent 75fb82316d
commit 3bbd8627bd
8 changed files with 27 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
import { DEFAULT_MSG_PER_PAGE, MSG_TYPE, ON_MSG_ROUTE, ON_GROUP_MSG_ROUTE, CHANNEL_PREFIX, DEBUG_MAGIC_WORD, STATUS, HERO_GROW_MAX, ABI_STAGE } from './../app/consts';
import { DEFAULT_MSG_PER_PAGE, MSG_TYPE, ON_PRIVATE_MSG_ROUTE, ON_GROUP_MSG_ROUTE, CHANNEL_PREFIX, DEBUG_MAGIC_WORD, STATUS, HERO_GROW_MAX, ABI_STAGE } from './../app/consts';
import { Client } from './Client';
import 'mocha';
import { PinusWSClient } from 'pinus-robot-plugin';
@@ -122,7 +122,7 @@ describe('聊天测试', function() {
});
it('两个玩家互相发送', function(done) {
pinusClientT.on(ON_MSG_ROUTE, (msg) => {
pinusClientT.on(ON_PRIVATE_MSG_ROUTE, (msg) => {
checkSuccessResponse(msg);
expect(msg.data.content).to.equal(TEXT_MSG.content);
done();
@@ -144,6 +144,7 @@ describe('聊天测试', function() {
setTimeout(() => {
pinusClient.request('chat.chatHandler.getPrivateMessage', {targetRoleId: roleInfoT.roleId}, (res) => {
checkSuccessResponse(res);
expect(res.data.targetRoleId).to.be.a('string');
expect(res.data.msgs).to.be.an('array');
expect(res.data.msgs.length).to.be.equal(DEFAULT_MSG_PER_PAGE);
res.data.msgs.forEach(msg => {

View File

@@ -184,7 +184,7 @@ describe('寻宝创建队伍', function() {
checkSuccessResponse(dismissRes, false);
done();
});
}, 500);
}, 1000);
});
});
});