修复寻宝等

This commit is contained in:
luying
2022-04-06 11:29:45 +08:00
parent 2dffa0204f
commit 2492920288
4 changed files with 31 additions and 33 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ import { checkPopUpConditionInCreateHero } from '../activity/popUpShopService';
export async function checkTaskWithRoles(serverId: number, roleId: string, sid: string, taskType: TASK_TYPE, roles: RoleType[]) { export async function checkTaskWithRoles(serverId: number, roleId: string, sid: string, taskType: TASK_TYPE, roles: RoleType[]) {
for (let role of roles) { for (let role of roles) {
if (role) { if (role) {
await checkTask(serverId, role.roleId, role.roleId == roleId ? sid : null, taskType, role); await checkTaskWithRole(serverId, role.roleId, role.roleId == roleId ? sid : null, taskType, role);
} }
} }
} }
+1 -1
View File
@@ -11,7 +11,7 @@ describe('活动测试', function () {
before(function (done) { before(function (done) {
const c = new Client(); const c = new Client();
const timer = setInterval(() => { const timer = setInterval(() => {
if (c.client) { if (c.client) {
pinusClient = c.client; pinusClient = c.client;
clearInterval(timer); clearInterval(timer);
+1 -1
View File
@@ -459,7 +459,7 @@ describe('战斗测试', function () {
pinusClient.request('battle.towerBattleHandler.getStatus', {}, (res) => { pinusClient.request('battle.towerBattleHandler.getStatus', {}, (res) => {
checkSuccessResponse(res); checkSuccessResponse(res);
expect(res.data.canHungUp).to.be.a('boolean'); expect(res.data.canHungUp).to.be.a('boolean');
expect(res.data.hungUpEnableLv).to.be.a('number'); // expect(res.data.hungUpEnableLv).to.be.a('number');
expect(res.data.canSendTask).to.be.a('boolean'); expect(res.data.canSendTask).to.be.a('boolean');
expect(res.data.curLv).to.be.a('number'); expect(res.data.curLv).to.be.a('number');
towerLv = res.data.curLv; towerLv = res.data.curLv;
+28 -30
View File
@@ -48,7 +48,7 @@ describe('寻宝创建队伍', function() {
let roleInfoT; let roleInfoT;
const createTeamParms = {blueprtId: 33001, pub: true, ceLimit: 0}; const createTeamParms = {blueprtId: 33001, pub: true, ceLimit: 0};
const searchTeamParms = {qualityArr: COM_BTL_QUALITY}; const searchTeamParms = {lv: [1,2,3,4,5,6,7,8,9]};
beforeEach(function(done) { beforeEach(function(done) {
const c = new Client(); const c = new Client();
@@ -118,31 +118,31 @@ describe('寻宝创建队伍', function() {
}); });
}); });
it('先搜索再创建队伍的匹配情况', function(done) { // it('先搜索再创建队伍的匹配情况', function(done) {
pinusClientT.request('battle.comBattleHandler.searchTeam', searchTeamParms, (searchRes) => { // pinusClientT.request('battle.comBattleHandler.searchTeam', searchTeamParms, (searchRes) => {
// console.log('searchRes:', searchRes); // // console.log('searchRes:', searchRes);
checkSuccessResponse(searchRes, false); // checkSuccessResponse(searchRes, false);
if (!searchRes.data) { // if (!searchRes.data) {
pinusClient.request('battle.comBattleHandler.createTeam', createTeamParms, (res) => { // pinusClient.request('battle.comBattleHandler.createTeam', createTeamParms, (res) => {
checkSuccessResponse(res); // checkSuccessResponse(res);
expect(res.data.teamCode).to.be.a('string'); // expect(res.data.teamCode).to.be.a('string');
expect(res.data.roleStatus).to.be.an('array'); // expect(res.data.roleStatus).to.be.an('array');
res.data.roleStatus.forEach(roleSt => { // res.data.roleStatus.forEach(roleSt => {
expect(roleSt).to.have.all.keys('roleId', 'roleName', 'isCap', 'isFrd', 'head', 'frame', 'spine', 'topLineupCe', 'lv', 'isRobot', 'heroes', 'killed', 'totalDmg', 'frdRatio', 'fixReward'); // expect(roleSt).to.have.all.keys('roleId', 'roleName', 'isCap', 'isFrd', 'head', 'frame', 'spine', 'topLineupCe', 'lv', 'isRobot', 'heroes', 'killed', 'totalDmg', 'frdRatio', 'fixReward');
}); // });
const roleIds = res.data.roleStatus.map(roleSt => { return roleSt.roleId }); // const roleIds = res.data.roleStatus.map(roleSt => { return roleSt.roleId });
if (roleIds.indexOf(roleInfoT.roleId) === -1) { // if (roleIds.indexOf(roleInfoT.roleId) === -1) {
console.warn('未测试到先搜索后招募的组队情况'); // console.warn('未测试到先搜索后招募的组队情况');
done(); // done();
} // }
comBattleProcess(pinusClient, res.data.teamCode, done); // comBattleProcess(pinusClient, res.data.teamCode, done);
}); // });
} else { // } else {
console.warn('未测试到先搜索后招募的组队情况'); // console.warn('未测试到先搜索后招募的组队情况');
done(); // done();
} // }
}); // });
}); // });
it('创建队伍并解散', function(done) { it('创建队伍并解散', function(done) {
pinusClient.request('battle.comBattleHandler.createTeam', createTeamParms, (res) => { pinusClient.request('battle.comBattleHandler.createTeam', createTeamParms, (res) => {
@@ -215,10 +215,7 @@ describe('寻宝创建队伍', function() {
it('查询可招募或助战的次数', function(done) { it('查询可招募或助战的次数', function(done) {
pinusClient.request('battle.comBattleHandler.getComBtlCnt', {}, (res) => { pinusClient.request('battle.comBattleHandler.getComBtlCnt', {}, (res) => {
checkSuccessResponse(res); checkSuccessResponse(res);
expect(res.data.assistCnt).to.be.an('array'); expect(res.data.assistCnt).to.be.an('number');
res.data.assistCnt.forEach(cnt => {
expect(cnt).to.be.a('number');
});
expect(res.data.blueprts).to.be.an('array'); expect(res.data.blueprts).to.be.an('array');
res.data.blueprts.forEach(item => { res.data.blueprts.forEach(item => {
expect(item.id).to.be.a('number'); expect(item.id).to.be.a('number');
@@ -233,6 +230,7 @@ describe('寻宝创建队伍', function() {
checkSuccessResponse(res); checkSuccessResponse(res);
expect(res.data.teamInfos).to.be.an('array'); expect(res.data.teamInfos).to.be.an('array');
res.data.teamInfos.forEach(info => { res.data.teamInfos.forEach(info => {
console.log('####',info )
expect(info).to.have.contains.keys('teamCode', 'roleIds', 'pub', 'blueprtId', 'quality', 'status', 'roleStatus', 'capId', 'ceLimit', 'roleCnt', 'bossHpArr', 'createdAt'); expect(info).to.have.contains.keys('teamCode', 'roleIds', 'pub', 'blueprtId', 'quality', 'status', 'roleStatus', 'capId', 'ceLimit', 'roleCnt', 'bossHpArr', 'createdAt');
}); });
done(); done();