Skip to content

Commit

Permalink
fix(tests): resolve review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksandre committed Jun 10, 2024
1 parent 5da2ac3 commit 3360555
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
1 change: 0 additions & 1 deletion js-packages/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"RUN_XCM_TESTS": "1"
},
"mochaExplorer.files": "tests/**/*.test.ts",
"mochaExplorer.require": "ts-node/register",
"mochaExplorer.esmLoader": true,
"mochaExplorer.nodeArgv": ["--loader", "ts-node/esm"],
"eslint.format.enable": true,
Expand Down
1 change: 0 additions & 1 deletion js-packages/test-utils/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ export enum Pallets {
Identity = 'identity',
Democracy = 'democracy',
Council = 'council',
FinancialCouncil = 'financialcouncil',
//CouncilMembership = 'councilmembership',
TechnicalCommittee = 'technicalcommittee',
Fellowship = 'fellowshipcollective',
Expand Down
12 changes: 9 additions & 3 deletions js-packages/tests/sub/governance/financialCouncil.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {IKeyringPair} from '@polkadot/types/types';
import {usingPlaygrounds, itSub, expect, Pallets, requirePalletsOrSkip, describeGov} from '@unique/test-utils/util.js';
import {usingPlaygrounds, itSub, expect, describeGov} from '@unique/test-utils/util.js';
import {Event} from '@unique/test-utils';
import {democracyFastTrackVotingPeriod, IFinCounselors, clearTechComm, dummyProposalCall, initFinCouncil, clearFinCouncil, democracyLaunchPeriod, initFellowship, dummyProposal, fellowshipPropositionOrigin, defaultEnactmentMoment, initCouncil, clearCouncil, clearFellowship} from './util.js';

Expand All @@ -13,7 +13,6 @@ describeGov('Governance: Financial Council tests', () => {

before(async function() {
await usingPlaygrounds(async (helper, privateKey) => {
requirePalletsOrSkip(this, helper, [Pallets.FinancialCouncil]);
sudoer = await privateKey('//Alice');
donor = await privateKey({url: import.meta.url});
});
Expand Down Expand Up @@ -227,7 +226,14 @@ describeGov('Governance: Financial Council tests', () => {
)).to.be.rejectedWith('BadOrigin');
});

itSub('[Negative] FinCouncil member can\'t add a Fellowship member', async ({helper}) => {
itSub('[Negative] FinCouncil cannot add a Fellowship member', async ({helper}) => {
const newFellowshipMember = helper.arrange.createEmptyAccount();
const addMemberProposal = helper.fellowship.collective.addMemberCall(newFellowshipMember.address);

await expect(proposalFromAllFinCouncil(addMemberProposal)).to.be.rejectedWith('BadOrigin');
});

itSub('[Negative] FinCouncil member cannot add a Fellowship member', async ({helper}) => {
const newFellowshipMember = helper.arrange.createEmptyAccount();
await expect(helper.finCouncil.collective.execute(
finCounselors.andy,
Expand Down
4 changes: 2 additions & 2 deletions js-packages/tests/sub/governance/technicalCommittee.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ describeGov('Governance: Technical Committee tests', () => {
itSub('[Negative] TechComm can\'t add FinCouncil member', async ({helper}) => {
const newFinCouncilMember = helper.arrange.createEmptyAccount();
const addMemberProposal = helper.finCouncil.membership.addMemberCall(newFinCouncilMember.address);
await proposalFromAllCommittee(addMemberProposal);
await expect(proposalFromAllCommittee(addMemberProposal)).rejectedWith('BadOrigin');

const finCouncilMembers = await helper.finCouncil.membership.getMembers();
expect(finCouncilMembers).to.contains(newFinCouncilMember.address);
expect(finCouncilMembers).to.not.contains(newFinCouncilMember.address);
});


Expand Down

0 comments on commit 3360555

Please sign in to comment.