test(governance): vote error test (#4588)
This commit is contained in:
parent
3e627ff849
commit
80f7a08765
@ -361,6 +361,34 @@ describe(
|
|||||||
stakingPageDisassociateAllTokens();
|
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<testFreeformProposal>('@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 () {
|
it('Able to see successor market details with new and updated values', function () {
|
||||||
cy.createMarket();
|
cy.createMarket();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
|
@ -183,9 +183,8 @@ export function clickOnValidatorFromList(
|
|||||||
cy.get(`[row-id="${validatorNumber}"]`)
|
cy.get(`[row-id="${validatorNumber}"]`)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.first()
|
.first()
|
||||||
.within(() => {
|
.as('validatorOnList');
|
||||||
cy.get(stakeValidatorListName).click();
|
cy.get('@validatorOnList').click();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user