From f212f5bb28840f95ac2c96c57ac15e49f2caf6aa Mon Sep 17 00:00:00 2001 From: Joe Tsang <30622993+jtsang586@users.noreply.github.com> Date: Wed, 23 Nov 2022 14:16:51 +0000 Subject: [PATCH] test(1872): add test for validator status (#2193) * test: add test for validator status * chore: fix lint --- apps/token-e2e/src/integration/view/staking.cy.js | 5 +++++ apps/token/src/routes/staking/node/validator-table.tsx | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/token-e2e/src/integration/view/staking.cy.js b/apps/token-e2e/src/integration/view/staking.cy.js index acf56ad3d..0f973cb5b 100644 --- a/apps/token-e2e/src/integration/view/staking.cy.js +++ b/apps/token-e2e/src/integration/view/staking.cy.js @@ -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); diff --git a/apps/token/src/routes/staking/node/validator-table.tsx b/apps/token/src/routes/staking/node/validator-table.tsx index 88fb654d3..39894f76a 100644 --- a/apps/token/src/routes/staking/node/validator-table.tsx +++ b/apps/token/src/routes/staking/node/validator-table.tsx @@ -71,7 +71,9 @@ export const ValidatorTable = ({ {t('STATUS')} - {t(statusTranslationKey(node.rankingScore.status))} + + {t(statusTranslationKey(node.rankingScore.status))} + {t('IP ADDRESS')}