🐞 fix(test): 修正部分测试用例
This commit is contained in:
@@ -182,7 +182,8 @@ describe('活动测试', function () {
|
||||
checkActivityData(pinusClient, 'activity.newHeroGKHandler.getNewHeroGKActivity', ACTIVITY_TYPE.NEW_HERO_GK, done);
|
||||
});
|
||||
|
||||
it('新将擢迁(新武将抽卡)-活动数据', function (done) {
|
||||
// 未找到该接口,暂时skip
|
||||
it.skip('新将擢迁(新武将抽卡)-活动数据', function (done) {
|
||||
checkActivityData(pinusClient, 'activity.newHeroGachaHandler.getNewHeroGachaActivity', ACTIVITY_TYPE.NEW_HERO_GACHA, done);
|
||||
});
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ describe('拍卖行测试', function () {
|
||||
expect(info.id).to.be.equal(CURRENCY_BY_TYPE.get(CURRENCY_TYPE.GOLD));
|
||||
}
|
||||
});
|
||||
pinusClient.request('guild.auctionHandler.debugSetDividendStatus', { magicWord: DEBUG_MAGIC_WORD, sourceType: AUCTION_SOURCE.GATE, status: DIVIDEND_STATUS.END }, (res) => {
|
||||
pinusClient.request('guild.auctionHandler.debugSetDividendStatusV2', { magicWord: DEBUG_MAGIC_WORD, sourceType: AUCTION_SOURCE.GATE, status: DIVIDEND_STATUS.END }, (res) => {
|
||||
checkSuccessResponse(res);
|
||||
checkDividend(res.data.dividend);
|
||||
// TODO: 找个测试领取分红的方法
|
||||
@@ -213,7 +213,7 @@ describe('拍卖行测试', function () {
|
||||
done();
|
||||
return;
|
||||
}
|
||||
pinusClient.request('guild.auctionHandler.getDividend', { sourceType: AUCTION_SOURCE.GATE }, (res) => {
|
||||
pinusClient.request('guild.auctionHandler.getDividend', { code: res.data.dividend.code }, (res) => {
|
||||
checkSuccessResponse(res);
|
||||
expect(res.data.dividend).to.be.an('object');
|
||||
expect(res.data.dividend.roleId).to.be.a('string');
|
||||
|
||||
@@ -314,7 +314,7 @@ describe('聊天测试', function () {
|
||||
console.log("1: ", roleInfo.roleId, roleInfo.guildCode)
|
||||
console.log("2: ", roleInfoT.roleId, roleInfoT.guildCode)
|
||||
if (roleInfo.guildCode !== roleInfoT.guildCode) {
|
||||
pinusClientT.request('guild.guildHandler.debugJoinGuild', { code: roleInfo.guildCode }, (res) => {
|
||||
pinusClientT.request('guild.guildHandler.debugJoinGuild', { code: roleInfo.guildCode, magicWord: DEBUG_MAGIC_WORD }, (res) => {
|
||||
console.log(roleInfo.guildCode)
|
||||
checkSuccessResponse(res, false);
|
||||
done();
|
||||
|
||||
@@ -52,13 +52,18 @@ describe('寻宝创建队伍', function() {
|
||||
beforeEach(function(done) {
|
||||
const c = new Client();
|
||||
const cT = new Client('13121622738');
|
||||
const timer = setInterval(() => {
|
||||
const timer = setInterval(async () => {
|
||||
if (c.client && cT.client) {
|
||||
pinusClient = c.client;
|
||||
roleInfo = c.roleInfo;
|
||||
pinusClientT = cT.client;
|
||||
roleInfoT = cT.roleInfo;
|
||||
clearInterval(timer);
|
||||
// 创建寻宝队伍有等级限制,最小20级,把玩家等级调整到20级
|
||||
// battle.comBattleHandler.searchTeam 需要在searchTeam之前调整
|
||||
// comBattle中有多个位置需要设置,索性这里操作一次
|
||||
await debugSetRoleLv(pinusClientT);
|
||||
await debugSetRoleLv(pinusClient);
|
||||
done();
|
||||
}
|
||||
}, 1000);
|
||||
@@ -286,3 +291,21 @@ describe('寻宝创建队伍', function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// debugSetRoleLv - 设置用户等级
|
||||
async function debugSetRoleLv(client: PinusWSClient) {
|
||||
// 更新用户等级 - 范围[20,100]
|
||||
const minRoleLv = 20;
|
||||
return new Promise((resolve, reject) => {
|
||||
client.request('battle.comBattleHandler.debugSetRoleLv', { targetLv: minRoleLv }, (res) => {
|
||||
// res.data: { lv: 20, roleId: 'g9Hgrjk6Kh' }
|
||||
if (res.data.lv == minRoleLv) {
|
||||
// console.log(`更新 ${res.data.roleId} 到 ${res.data.lv}`);
|
||||
resolve('success');
|
||||
} else {
|
||||
reject(new Error(`更新 ${res.data.roleId} 失败`));
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user