Skip to content

Commit

Permalink
Merge pull request #1078 from UniqueNetwork/fix/gov-tests-1.9
Browse files Browse the repository at this point in the history
fix: gov tests polkadot 1.9 update
  • Loading branch information
CertainLach authored Jul 16, 2024
2 parents f48afb4 + 05c81ca commit e358d81
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 15 deletions.
18 changes: 8 additions & 10 deletions js-packages/tests/sub/governance/council.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,14 @@ describeGov('Governance: Council tests', () => {
expect(finCouncilMembers).to.contains(newFinCouncilMember.address);
});

itSub.skip('Council member can add Fellowship member', async ({helper}) => {
itSub('Council member can add Fellowship member', async ({helper}) => {
const newFellowshipMember = helper.arrange.createEmptyAccount();
await expect(helper.council.collective.execute(
counselors.alex,
helper.fellowship.collective.addMemberCall(newFellowshipMember.address),
)).to.be.fulfilled;
const fellowshipMembers = (await helper.callRpc('api.query.fellowshipCollective.members')).toJSON();
expect(fellowshipMembers).to.contains(newFellowshipMember.address);
expect(await helper.fellowship.collective.getMembers()).to.be.deep.contain(newFellowshipMember.address);
await clearFellowship(sudoer);
});

itSub('>50% Council can promote Fellowship member', async ({helper}) => {
Expand Down Expand Up @@ -246,16 +246,14 @@ describeGov('Governance: Council tests', () => {
await clearFellowship(sudoer);
});

itSub('>50% Council can add\remove Fellowship member', async ({helper}) => {
itSub('>50% Council can remove Fellowship member', async ({helper}) => {
try {
const newMember = helper.arrange.createEmptyAccount();
const fellowship = await initFellowship(donor, sudoer);
const memberRank6 = fellowship[6][0];

const proposalAdd = helper.fellowship.collective.addMemberCall(newMember.address);
const proposalRemove = helper.fellowship.collective.removeMemberCall(newMember.address, fellowshipRankLimit);
await expect(proposalFromMoreThanHalfCouncil(proposalAdd)).to.be.fulfilled;
expect(await helper.fellowship.collective.getMembers()).to.be.deep.contain(newMember.address);
const proposalRemove = helper.fellowship.collective.removeMemberCall(memberRank6.address, fellowshipRankLimit);
await expect(proposalFromMoreThanHalfCouncil(proposalRemove)).to.be.fulfilled;
expect(await helper.fellowship.collective.getMembers()).to.be.not.deep.contain(newMember.address);
expect(await helper.fellowship.collective.getMembers()).to.be.not.deep.contain(memberRank6.address);
}
finally {
await clearFellowship(sudoer);
Expand Down
33 changes: 28 additions & 5 deletions js-packages/tests/sub/governance/technicalCommittee.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,13 @@ describeGov('Governance: Technical Committee tests', () => {
Event.FellowshipReferenda.Cancelled.expect(cancelProposal);
});

itSub.skip('TechComm member can add a Fellowship member', async ({helper}) => {
itSub('TechComm member can add a Fellowship member', async ({helper}) => {
const newFellowshipMember = helper.arrange.createEmptyAccount();
await expect(helper.technicalCommittee.collective.execute(
techcomms.andy,
helper.fellowship.collective.addMemberCall(newFellowshipMember.address),
)).to.be.fulfilled;
const fellowshipMembers = (await helper.callRpc('api.query.fellowshipCollective.members')).toJSON();
expect(fellowshipMembers).to.contains(newFellowshipMember.address);
expect(await helper.fellowship.collective.getMembers()).to.be.deep.contain(newFellowshipMember.address);
await clearFellowship(sudoer);
});

Expand Down Expand Up @@ -235,12 +234,36 @@ describeGov('Governance: Technical Committee tests', () => {
});


itSub.skip('[Negative] TechComm cannot promote/demote Fellowship member', async () => {
itSub('[Negative] TechComm cannot promote/demote Fellowship member', async ({helper}) => {
const fellowship = await initFellowship(donor, sudoer);
const memberWithRankOne = fellowship[1][0];

const promoteProposal = helper.fellowship.collective.promoteCall(memberWithRankOne.address);
await expect(proposalFromAllCommittee(promoteProposal)).rejectedWith('BadOrigin');

const demoteProposal = helper.fellowship.collective.demoteCall(memberWithRankOne.address);
await expect(proposalFromAllCommittee(demoteProposal)).rejectedWith('BadOrigin');

await clearFellowship(sudoer);
});

itSub.skip('[Negative] TechComm member cannot promote/demote Fellowship member', async () => {
itSub('[Negative] TechComm member cannot promote/demote Fellowship member', async ({helper}) => {
const fellowship = await initFellowship(donor, sudoer);
const memberWithRankOne = fellowship[1][0];

const promoteProposal = helper.fellowship.collective.promoteCall(memberWithRankOne.address);
await expect(helper.technicalCommittee.collective.execute(
techcomms.andy,
promoteProposal,
)).to.be.rejectedWith('BadOrigin');

const demoteProposal = helper.fellowship.collective.demoteCall(memberWithRankOne.address);
await expect(helper.technicalCommittee.collective.execute(
techcomms.andy,
demoteProposal,
)).to.be.rejectedWith('BadOrigin');

await clearFellowship(sudoer);
});

itSub('[Negative] TechComm cannot add/remove a Council member', async ({helper}) => {
Expand Down

0 comments on commit e358d81

Please sign in to comment.