test(1872): add test for validator status (#2193)

* test: add test for validator status

* chore: fix lint
This commit is contained in:
Joe Tsang 2022-11-23 14:16:51 +00:00 committed by GitHub
parent 22c1a4ad6a
commit f212f5bb28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -4,6 +4,7 @@ const validatorTitle = '[data-testid="validator-node-title"]';
const validatorId = '[data-testid="validator-id"]';
const validatorPubKey = '[data-testid="validator-public-key"]';
const ethAddressLink = '[data-testid="link"]';
const validatorStatus = '[data-testid="validator-status"]';
const totalStake = '[data-testid="total-stake"]';
const pendingStake = '[data-testid="pending-stake"]';
const stakedByOperator = '[data-testid="staked-by-operator"]';
@ -162,6 +163,10 @@ context('Staking Page - verify elements on page', function () {
});
// TODO validators missing url for more information about them 2001-STKE-09
it('Should be able to see validator status', function () {
cy.get(validatorStatus).should('have.text', 'Consensus');
});
// 2001-STKE-012
it('Should be able to see total stake', function () {
cy.get(totalStake).invoke('text').should('match', stakeNumberRegex);

View File

@ -71,7 +71,9 @@ export const ValidatorTable = ({
</KeyValueTableRow>
<KeyValueTableRow>
<span>{t('STATUS')}</span>
<span>{t(statusTranslationKey(node.rankingScore.status))}</span>
<span data-testid="validator-status">
{t(statusTranslationKey(node.rankingScore.status))}
</span>
</KeyValueTableRow>
<KeyValueTableRow>
<span>{t('IP ADDRESS')}</span>