寻宝测试:增加两个简单接口的测试
This commit is contained in:
@@ -397,7 +397,7 @@ export class ComBattleHandler {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取队伍列表-deprecated
|
||||
* ! 获取队伍列表-deprecated
|
||||
* @param msg
|
||||
* @param session
|
||||
*/
|
||||
@@ -411,7 +411,8 @@ export class ComBattleHandler {
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 队伍准备-deprecate
|
||||
* ! deprecate
|
||||
* @description 队伍准备
|
||||
* @param {{teamCode: string, heroes: Array<number>}} msg
|
||||
* @param {BackendSession} session
|
||||
* @returns
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { COM_BTL_QUALITY } from './../app/consts/constModules/itemConst';
|
||||
import 'mocha';
|
||||
import { PinusWSClient, PinusWSClientEvent } from 'pinus-robot-plugin';
|
||||
import { expect } from 'chai';
|
||||
@@ -15,7 +16,7 @@ describe('寻宝创建队伍', function() {
|
||||
|
||||
const loginParms = {serverId: 1};
|
||||
const createTeamParms = {blueprtId: 33001, pub: true, ceLimit: 0};
|
||||
const searchTeamParms = {qualityArr: [1, 2, 3, 4, 5]};
|
||||
const searchTeamParms = {qualityArr: COM_BTL_QUALITY};
|
||||
|
||||
beforeEach(function(done) {
|
||||
pinusClient = new PinusWSClient();
|
||||
@@ -85,15 +86,42 @@ describe('寻宝创建队伍', function() {
|
||||
});
|
||||
});
|
||||
|
||||
// it('加入队伍,机器人的话直接开战', function(done) {
|
||||
// this.timeout(65 * 1000);
|
||||
// pinusClient.request('battle.comBattleHandler.searchTeam', searchTeamParms, (res) => {
|
||||
// expect(res).to.be.an('object');
|
||||
// expect(res.code).equal(0);
|
||||
// expect(res.data).to.be.an('object');
|
||||
// expect(res.data.teamCode).to.be.a('string');
|
||||
// });
|
||||
// });
|
||||
it('搜索队伍再取消', function(done) {
|
||||
pinusClient.request('battle.comBattleHandler.searchTeam', searchTeamParms, (res) => {
|
||||
expect(res).to.be.an('object');
|
||||
expect(res.code).equal(0);
|
||||
if (!res.data) {
|
||||
pinusClient.request('battle.comBattleHandler.cancelSearch', {}, (cancelRes) => {
|
||||
expect(cancelRes).to.be.an('object');
|
||||
expect(cancelRes.code).equal(0);
|
||||
done();
|
||||
});
|
||||
} else {
|
||||
expect(res.data).to.be.an('object');
|
||||
expect(res.data.teamCode).to.be.a('string');
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('查询可招募或助战的次数', function(done) {
|
||||
pinusClient.request('battle.comBattleHandler.getComBtlCnt', {}, (res) => {
|
||||
expect(res).to.be.an('object');
|
||||
expect(res.code).equal(0);
|
||||
expect(res.data).to.be.an('object');
|
||||
console.log('getComBtlCnt', res.data);
|
||||
expect(res.data.assistCnt).to.be.an('array');
|
||||
res.data.assistCnt.forEach(cnt => {
|
||||
expect(cnt).to.be.a('number');
|
||||
});
|
||||
expect(res.data.blueprts).to.be.an('array');
|
||||
res.data.blueprts.forEach(item => {
|
||||
expect(item.id).to.be.a('number');
|
||||
expect(item.count).to.be.a('number');
|
||||
});
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('获取寻宝记录', function(done) {
|
||||
pinusClient.request('battle.comBattleHandler.getTeamRec', {}, (res) => {
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('军团测试', function() {
|
||||
|
||||
it('获取军团列表', function(done) {
|
||||
pinusClient.request('battle.guildHandler.getGuildList', {page:1, showPeopleMax: true, name: ""} , (res) => {
|
||||
console.log(JSON.stringify(res))
|
||||
// console.log(JSON.stringify(res))
|
||||
// 消息回调
|
||||
expect(res).to.be.an('object');
|
||||
expect(res.code).equal(0);
|
||||
|
||||
Reference in New Issue
Block a user