diff --git a/apps/governance-e2e/src/integration/flow/proposal-details.cy.ts b/apps/governance-e2e/src/integration/flow/proposal-details.cy.ts index cef462d61..13b7e19bb 100644 --- a/apps/governance-e2e/src/integration/flow/proposal-details.cy.ts +++ b/apps/governance-e2e/src/integration/flow/proposal-details.cy.ts @@ -361,6 +361,34 @@ describe( stakingPageDisassociateAllTokens(); }); + it('Error message should be displayed if error returned from wallet when voting', function () { + const errorMsg = + 'Application error: party has already submitted the maximum number of transactions of this type per epoch (3)'; + + createRawProposal(); + cy.get('@rawProposal').then((rawProposal) => { + getProposalFromTitle(rawProposal.rationale.title).within(() => + cy.getByTestId(viewProposalButton).click() + ); + cy.intercept('POST', '/api/v2/requests', { + jsonrpc: '2.0', + error: { + code: 2001, + message: 'Application error', + data: 'party has already submitted the maximum number of transactions of this type per epoch (3)', + }, + id: '-PK5EGmErnjLhAmzMeclC', + }); + cy.contains('Vote breakdown').should('be.visible', { timeout: 10000 }); + cy.getByTestId('vote-buttons').contains('for').click(); + cy.getByTestId('dialog-title').should( + 'have.text', + 'Transaction failed' + ); + cy.getByTestId('Error').should('have.text', errorMsg); + }); + }); + it('Able to see successor market details with new and updated values', function () { cy.createMarket(); cy.reload(); diff --git a/apps/governance-e2e/src/support/staking.functions.ts b/apps/governance-e2e/src/support/staking.functions.ts index 4f99e0964..cd198783d 100644 --- a/apps/governance-e2e/src/support/staking.functions.ts +++ b/apps/governance-e2e/src/support/staking.functions.ts @@ -183,9 +183,8 @@ export function clickOnValidatorFromList( cy.get(`[row-id="${validatorNumber}"]`) .should('be.visible') .first() - .within(() => { - cy.get(stakeValidatorListName).click(); - }); + .as('validatorOnList'); + cy.get('@validatorOnList').click(); } }