chore(governance): fix failing tests from nightly run (#4453)

This commit is contained in:
Joe Tsang 2023-08-03 10:01:00 +01:00 committed by GitHub
parent 79cf8163be
commit 6686755763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 14 deletions

View File

@ -96,12 +96,14 @@ context('rewards - flow', { tags: '@slow' }, function () {
.within(() => { .within(() => {
cy.get('h2').first().should('contain.text', 'EPOCH'); cy.get('h2').first().should('contain.text', 'EPOCH');
cy.getByTestId('individual-rewards-asset').should('have.text', 'Vega'); cy.getByTestId('individual-rewards-asset').should('have.text', 'Vega');
cy.getByTestId('ACCOUNT_TYPE_GLOBAL_REWARD', rewardsTimeOut) cy.getByTestId('ACCOUNT_TYPE_GLOBAL_REWARD', rewardsTimeOut).should(
.should('contain.text', '0.4415') 'contain.text',
.and('contain.text', '(44.15%)'); '0.4415'
cy.getByTestId('ACCOUNT_TYPE_FEES_INFRASTRUCTURE') );
.should('contain.text', '0.0004') cy.getByTestId('ACCOUNT_TYPE_FEES_INFRASTRUCTURE').should(
.and('contain.text', '(44.15%)'); 'contain.text',
'0.0004'
);
cy.getByTestId('total').should('have.text', '0.4419'); cy.getByTestId('total').should('have.text', '0.4419');
}); });
}); });

View File

@ -339,7 +339,7 @@ context(
cy.getByTestId(vegaWalletCurrencyTitle) cy.getByTestId(vegaWalletCurrencyTitle)
.contains(name) .contains(name)
.parent() .parent()
.siblings() .siblings(txTimeout)
.should((elementAmount) => { .should((elementAmount) => {
const displayedAmount = parseFloat(elementAmount.text()); const displayedAmount = parseFloat(elementAmount.text());
expect(displayedAmount).be.gte(expectedAmount); expect(displayedAmount).be.gte(expectedAmount);

View File

@ -78,13 +78,21 @@ export function stakingPageAssociateTokens(
} }
cy.get(tokenAmountInputBox, epochTimeout).type(amount); cy.get(tokenAmountInputBox, epochTimeout).type(amount);
if (approve) { if (approve) {
cy.get(tokenInputApprove, txTimeout).should('be.enabled').click(); cy.getByTestId('wallet-associate').then((walletAssociateField) => {
cy.contains('Approve $VEGA Tokens for staking on Vega').should( if (
'be.visible' walletAssociateField.find('[data-testid="token-input-approve-button"]')
); .length
cy.contains('Approve $VEGA Tokens for staking on Vega', txTimeout).should( ) {
'not.exist' cy.get(tokenInputApprove, txTimeout).should('be.enabled').click();
); cy.contains('Approve $VEGA Tokens for staking on Vega').should(
'be.visible'
);
cy.contains(
'Approve $VEGA Tokens for staking on Vega',
txTimeout
).should('not.exist');
}
});
} }
cy.get(tokenSubmitButton, txTimeout).should('be.enabled').click(); cy.get(tokenSubmitButton, txTimeout).should('be.enabled').click();