chore: fix typescript errors in governance test

This commit is contained in:
Matthew Russell
2023-11-13 12:58:58 -08:00
parent 6f817d2fad
commit 67c178c56e
13 changed files with 65 additions and 0 deletions
@@ -38,6 +38,10 @@ import {
createSuccessorMarketProposalTxBody,
} from '../../support/proposal.functions';
// For some reason in this the below imports are typed as the jest version, importing
// them directly is an easy work around.
import { before, beforeEach, describe } from 'mocha';
const proposalListItem = '[data-testid="proposals-list-item"]';
const participationNotMet = 'token-participation-not-met';
const voteStatus = 'vote-status';
@@ -323,6 +327,7 @@ describe(
});
});
cy.VegaWalletSubmitProposal(
// @ts-ignore this is any
createSuccessorMarketProposalTxBody(this.parentMarketId)
);
navigateTo(navigation.proposals);
@@ -334,6 +339,7 @@ describe(
cy.getByTestId(proposalTermsToggle).click();
cy.get('.language-json').within(() => {
cy.get('.hljs-attr').should('contain.text', 'parentMarketId');
// @ts-ignore this is any
cy.get('.hljs-string').should('contain.text', this.parentMarketId);
cy.get('.hljs-attr').should('contain.text', 'insurancePoolFraction');
cy.get('.hljs-string').should('contain.text', '0.75');
@@ -352,6 +358,7 @@ describe(
validateProposalDetailsDiff(
'Parent Market ID',
proposalChangeType.ADDED,
// @ts-ignore this is any
this.parentMarketId
);
validateProposalDetailsDiff(
@@ -450,6 +457,7 @@ describe(
const closingTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(2);
submitUniqueRawProposal({
proposalBody: proposalPath,
// @ts-ignore this is any
updateMarketId: this.parentMarketId,
enactmentTimestamp: enactmentTimestamp,
closingTimestamp: closingTimestamp,
@@ -466,6 +474,7 @@ describe(
cy.getByTestId('proposal-update-market-state').within(() => {
getProposalInformationFromTable('Market ID')
.invoke('text')
// @ts-ignore this is any
.and('eq', this.parentMarketId);
});
});
@@ -476,6 +485,7 @@ describe(
const closingTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(2);
submitUniqueRawProposal({
proposalBody: proposalPath,
// @ts-ignore this is any
updateMarketId: this.parentMarketId,
enactmentTimestamp: enactmentTimestamp,
closingTimestamp: closingTimestamp,
@@ -489,6 +499,7 @@ describe(
cy.getByTestId('proposal-update-market-state').within(() => {
getProposalInformationFromTable('Market ID')
.invoke('text')
// @ts-ignore this is any
.and('eq', this.parentMarketId);
});
});
@@ -499,6 +510,7 @@ describe(
const closingTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(2);
submitUniqueRawProposal({
proposalBody: proposalPath,
// @ts-ignore this is any
updateMarketId: this.parentMarketId,
enactmentTimestamp: enactmentTimestamp,
closingTimestamp: closingTimestamp,
@@ -518,6 +530,7 @@ describe(
cy.getByTestId('proposal-update-market-state').within(() => {
getProposalInformationFromTable('Market ID')
.invoke('text')
// @ts-ignore this is any
.and('eq', this.parentMarketId);
getProposalDetailsValue('Termination Price').should(
'contain.text',
@@ -18,6 +18,10 @@ import { ensureSpecifiedUnstakedTokensAreAssociated } from '../../support/stakin
import { ethereumWalletConnect } from '../../support/wallet-eth.functions';
import { vegaWalletSetSpecifiedApprovalAmount } from '../../support/wallet-functions';
// For some reason in this the below imports are typed as the jest version, importing
// them directly is an easy work around.
import { before, beforeEach } from 'mocha';
const proposalListItem = '[data-testid="proposals-list-item"]';
const closedProposals = 'closed-proposals';
const proposalStatus = 'proposal-status';
@@ -36,6 +36,10 @@ import {
import { ethereumWalletConnect } from '../../support/wallet-eth.functions';
import type { testFreeformProposal } from '../../support/common-interfaces';
// For some reason in this the below imports are typed as the jest version, importing
// them directly is an easy work around.
import { before, beforeEach } from 'mocha';
const vegaWalletStakedBalances = 'vega-wallet-balance-staked-validators';
const vegaWalletAssociatedBalance = 'associated-amount';
const vegaWalletNameElement = 'wallet-name';
@@ -301,6 +305,7 @@ context(
cy.getByTestId(voteButtons).should('not.exist');
cy.getByTestId('min-proposal-requirements').should(
'have.text',
// @ts-ignore this is any
`You must have at least ${this.minVoterBalance} VEGA associated to vote on this proposal`
);
});
@@ -30,6 +30,10 @@ import {
vegaWalletTeardown,
} from '../../support/wallet-functions';
// For some reason in this the below imports are typed as the jest version, importing
// them directly is an easy work around.
import { before, beforeEach, it } from 'mocha';
const proposalListItem = '[data-testid="proposals-list-item"]';
const openProposals = 'open-proposals';
const proposalType = 'proposal-type';
@@ -33,6 +33,10 @@ const voteMajorityNotMet = 'token-majority-not-met';
const voteMajorityMet = 'token-majority-met';
const votesForPercentage = 'votes-for-percentage';
// For some reason in this the below imports are typed as the jest version, importing
// them directly is an easy work around.
import { before, beforeEach, describe, it } from 'mocha';
describe('Governance flow for proposal list', { tags: '@slow' }, function () {
before('connect wallets and set approval limit', function () {
vegaWalletSetSpecifiedApprovalAmount('1000');
@@ -26,6 +26,10 @@ import {
vegaWalletTeardown,
} from '../../support/wallet-functions';
// For some reason in this the below imports are typed as the jest version, importing
// them directly is an easy work around.
import { before, beforeEach, describe, it } from 'mocha';
const stakeValidatorListTotalStake = 'total-stake';
const stakeValidatorListTotalShare = 'total-stake-share';
const stakeValidatorListStakePercentage = 'stake-percentage';
@@ -21,6 +21,10 @@ import {
vegaWalletTeardown,
} from '../../support/wallet-functions';
// For some reason in this the below imports are typed as the jest version, importing
// them directly is an easy work around.
import { before, beforeEach, describe, it } from 'mocha';
const ethWalletContainer = 'ethereum-wallet';
const vegaWalletAssociatedBalance = 'currency-value';
const vegaWalletUnstakedBalance = 'vega-wallet-balance-unstaked';
@@ -7,6 +7,10 @@ import {
import { ethereumWalletConnect } from '../../support/wallet-eth.functions';
import { depositAsset } from '../../support/wallet-functions';
// For some reason in this the below imports are typed as the jest version, importing
// them directly is an easy work around.
import { before, beforeEach, it } from 'mocha';
const withdraw = 'withdraw';
const withdrawalForm = 'withdraw-form';
const ethAddressInput = 'eth-address-input';
@@ -12,6 +12,10 @@ import {
} from '../../support/governance.functions';
import { vegaWalletFaucetAssetsWithoutCheck } from '../../support/wallet-functions';
// For some reason in this the below imports are typed as the jest version, importing
// them directly is an easy work around.
import { before, beforeEach, it } from 'mocha';
const vegaWalletPubKey = Cypress.env('vegaWalletPublicKey2');
const vegaPubkeyTruncated = Cypress.env('vegaWalletPublicKey2Short');
const banner = 'view-banner';
@@ -5,6 +5,11 @@ import {
} from '../../support/common.functions';
import { waitForBeginningOfEpoch } from '../../support/staking.functions';
// For some reason in this the below imports are typed as the jest version, importing
// them directly is an easy work around.
import { before, describe, it } from 'mocha';
import { expect } from 'chai';
const viewToggle = 'epoch-reward-view-toggle-total';
const warning = 'callout';
@@ -12,6 +12,10 @@ import {
} from '../../support/staking.functions';
import { previousEpochData } from '../../fixtures/mocks/previous-epoch';
// For some reason in this the below imports are typed as the jest version, importing
// them directly is an easy work around.
import { before, beforeEach, describe, it } from 'mocha';
const guideLink = 'staking-guide-link';
const validatorTitle = 'validator-node-title';
const validatorId = 'validator-id';
@@ -1,6 +1,11 @@
import { convertTokenValueToNumber } from '../../support/common.functions';
import { ethereumWalletConnect } from '../../support/wallet-eth.functions';
// For some reason in this the below imports are typed as the jest version, importing
// them directly is an easy work around.
import { describe, before } from 'mocha';
import { expect } from 'chai';
const walletContainer = 'aside [data-testid="ethereum-wallet"]';
const walletHeader = '[data-testid="wallet-header"] h1';
const connectToEthButton =
@@ -5,6 +5,11 @@ import {
vegaWalletTeardown,
} from '../../support/wallet-functions';
// For some reason in this the below imports are typed as the jest version, importing
// them directly is an easy work around.
import { it } from 'mocha';
import { expect } from 'chai';
const walletContainer = 'aside [data-testid="vega-wallet"]';
const walletHeader = '[data-testid="wallet-header"] h1';
const connectButton = 'connect-vega-wallet';