军团,创建查询列表,查询个人军团信息

This commit is contained in:
luying
2021-01-19 16:18:45 +08:00
parent 71c5182926
commit ee21a21e80
8 changed files with 220 additions and 97 deletions

View File

@@ -56,51 +56,6 @@ describe('军团测试', function() {
done();
});
it('创建军团', function (done) {
pinusClient.request('battle.guildHandler.createGuild', { name: "test", icon: 1, notice: "notice" }, (res) => {
console.log(JSON.stringify(res))
// 消息回调
expect(res).to.be.an('object');
expect(res.code).equal(0);
expect(res.data).to.be.an('object');
expect(res.data).to.have.deep.property('code').that.is.an('string');
expect(res.data).to.have.deep.property('name').that.is.an('string');
expect(res.data).to.have.deep.property('icon').that.is.an('number');
expect(res.data).to.have.deep.property('notice').that.is.an('string');
expect(res.data).to.have.deep.property('introduce').that.is.an('string');
expect(res.data).to.have.deep.property('rank').that.is.an('number');
expect(res.data).to.have.deep.property('lv').that.is.an('number');
expect(res.data).to.have.deep.property('fund').that.is.an('number');
expect(res.data).to.have.deep.property('memberCnt').that.is.an('number');
expect(res.data).to.have.deep.property('managerCnt').that.is.an('number');
expect(res.data).to.have.deep.property('activeDaily').that.is.an('number');
expect(res.data).to.have.deep.property('activeWeekly').that.is.an('number');
expect(res.data).to.have.deep.property('ceLimit').that.is.an('number');
expect(res.data).to.have.deep.property('isAuto').that.is.an('boolean');
expect(res.data).to.have.deep.property('leader').that.is.an('object');
expect(res.data.leader).to.have.deep.property('name').that.is.an('string');
expect(res.data.leader).to.have.deep.property('sHid').that.is.an('number');
expect(res.data.leader).to.have.deep.property('headHid').that.is.an('number');
expect(res.data.leader).to.have.deep.property('lv').that.is.an('number');
expect(res.data.leader).to.have.deep.property('loginTime').that.is.an('number');
expect(res.data).to.have.deep.property('myInfo').that.is.an('object');
expect(res.data.myInfo).to.have.deep.property('honour').that.is.an('number');
expect(res.data.myInfo).to.have.deep.property('active').that.is.an('number');
expect(res.data.myInfo).to.have.deep.property('job').that.is.an('number');
expect(res.data.myInfo).to.have.deep.property('auth').that.is.an('number');
expect(res.data).to.have.deep.property('structure').that.is.an('array');
res.data.structure.forEach(list => {
expect(list).to.have.deep.property('id').that.is.a('number');
expect(list).to.have.deep.property('lv').that.is.a('number');
});
done();
});
});
it('获取军团列表', function(done) {
pinusClient.request('battle.guildHandler.getGuildList', {page:1, showPeopleMax: true, name: ""} , (res) => {
console.log(JSON.stringify(res))
@@ -109,18 +64,66 @@ describe('军团测试', function() {
expect(res.code).equal(0);
expect(res.data).to.be.an('object');
expect(res.data).to.have.deep.property('list').that.is.an('array');
expect(res.data).to.have.deep.property('quitTime').that.is.an('number');
res.data.list.forEach(list => {
expect(list).to.have.deep.property('code').that.is.a('string');
expect(list).to.have.deep.property('name').that.is.a('string');
expect(list).to.have.deep.property('icon').that.is.a('number');
expect(list).to.have.deep.property('lv').that.is.a('number');
expect(list).to.have.deep.property('peopleNum').that.is.a('number');
expect(list).to.have.deep.property('memberCnt').that.is.a('number');
expect(list).to.have.deep.property('leader').that.is.a('string');
expect(list).to.have.deep.property('ceLimit').that.is.a('number');
expect(list).to.have.deep.property('quitTime').that.is.a('number');
expect(list).to.have.deep.property('hasApply').that.is.a('boolean');
});
done();
});
});
it('获取个人军团', function (done) {
pinusClient.request('battle.guildHandler.getMyGuildInfo', { }, (res) => {
// 消息回调
expect(res).to.be.an('object');
expect(res.code).equal(0);
expect(res.data).to.be.an('object');
expect(res.data).to.have.deep.property('hasGuild').that.is.an('boolean');
if(res.data.hasGuild) {
expect(res.data).to.have.deep.property('code').that.is.an('string');
expect(res.data).to.have.deep.property('name').that.is.an('string');
expect(res.data).to.have.deep.property('icon').that.is.an('number');
expect(res.data).to.have.deep.property('notice').that.is.an('string');
expect(res.data).to.have.deep.property('introduce').that.is.an('string');
expect(res.data).to.have.deep.property('rank').that.is.an('number');
expect(res.data).to.have.deep.property('lv').that.is.an('number');
expect(res.data).to.have.deep.property('fund').that.is.an('number');
expect(res.data).to.have.deep.property('memberCnt').that.is.an('number');
expect(res.data).to.have.deep.property('managerCnt').that.is.an('number');
expect(res.data).to.have.deep.property('activeDaily').that.is.an('number');
expect(res.data).to.have.deep.property('activeWeekly').that.is.an('number');
expect(res.data).to.have.deep.property('ceLimit').that.is.an('number');
expect(res.data).to.have.deep.property('isAuto').that.is.an('boolean');
expect(res.data).to.have.deep.property('leader').that.is.an('object');
expect(res.data.leader).to.have.deep.property('roleName').that.is.an('string');
expect(res.data.leader).to.have.deep.property('sHid').that.is.an('number');
expect(res.data.leader).to.have.deep.property('headHid').that.is.an('number');
expect(res.data.leader).to.have.deep.property('lv').that.is.an('number');
expect(res.data.leader).to.have.deep.property('ce').that.is.an('number');
expect(res.data.leader).to.have.deep.property('loginTime').that.is.an('number');
expect(res.data).to.have.deep.property('myInfo').that.is.an('object');
expect(res.data.myInfo).to.have.deep.property('honour').that.is.an('number');
expect(res.data.myInfo).to.have.deep.property('job').that.is.an('number');
expect(res.data.myInfo).to.have.deep.property('auth').that.is.an('number');
expect(res.data).to.have.deep.property('structure').that.is.an('array');
res.data.structure.forEach(list => {
expect(list).to.have.deep.property('id').that.is.a('number');
expect(list).to.have.deep.property('lv').that.is.a('number');
});
}
done();
});
});
});