Browse Source

Fix test proposals execution order

Leszek Wiesner 3 years ago
parent
commit
76e96db687

+ 4 - 1
tests/integration-tests/src/fixtures/proposals/DecideOnProposalStatusFixture.ts

@@ -114,7 +114,10 @@ export class DecideOnProposalStatusFixture extends BaseQueryNodeFixture {
     this.params.forEach((params, i) => {
       const qProposal = qProposals.find((p) => p.id === params.proposalId.toString())
       Utils.assert(qProposal, 'Query node: Proposal not found')
-      Utils.assert(qProposal.status.__typename === this.getExpectedProposalStatus(i))
+      Utils.assert(
+        qProposal.status.__typename === this.getExpectedProposalStatus(i),
+        `Exepected ${qProposal.status.__typename} to equal ${this.getExpectedProposalStatus(i)}`
+      )
       if (
         qProposal.status.__typename === 'ProposalStatusExecuted' ||
         qProposal.status.__typename === 'ProposalStatusExecutionFailed'

+ 7 - 3
tests/integration-tests/src/flows/proposals/index.ts

@@ -113,10 +113,14 @@ export default async function creatingProposals({ api, query }: FlowProps): Prom
     { details: { DecreaseWorkingGroupLeadStake: [leadId, 100, 'Storage'] } },
     { details: { SetWorkingGroupLeadReward: [leadId, 50, 'Storage'] } },
     { details: { SlashWorkingGroupLead: [leadId, 100, 'Storage'] } },
-    { details: { TerminateWorkingGroupLead: { worker_id: leadId, slashing_amount: null, working_group: 'Storage' } } },
   ]
-  const testAllLeadProposalsOutcomes = new AllProposalsOutcomesFixture(api, query, leadProposalsToTest)
-  await new FixtureRunner(testAllLeadProposalsOutcomes).run()
+  const leadProposalsOutcomesFixture = new AllProposalsOutcomesFixture(api, query, leadProposalsToTest)
+  await new FixtureRunner(leadProposalsOutcomesFixture).run()
+
+  const terminateLeadProposalOutcomesFixture = new AllProposalsOutcomesFixture(api, query, [
+    { details: { TerminateWorkingGroupLead: { worker_id: leadId, working_group: 'Storage', slashing_amount: 100 } } },
+  ])
+  await new FixtureRunner(terminateLeadProposalOutcomesFixture).run()
 
   debug('Done')
 }