Merge branch 'master' into task/token-flow-tests

This commit is contained in:
AndyWhiteVega 2022-07-01 13:26:42 +01:00
commit 056edfe132
3 changed files with 48 additions and 0 deletions
apps
token-e2e/src
token/src/routes/rewards/home

View File

@ -0,0 +1,41 @@
import navigation from '../locators/navigation.locators';
import rewards from '../locators/rewards.locators';
context('Rewards Page - verify elements on page', function () {
before('navigate to rewards page', function () {
cy.visit('/')
.get(navigation.section)
.within(() => {
cy.get(navigation.rewards).click();
});
});
describe('with wallets disconnected', function () {
it('should have REWARDS tab highlighted', function () {
cy.get(navigation.section).within(() => {
cy.get(navigation.rewards).should('have.attr', 'aria-current');
});
});
it('should have rewards header visible', function () {
cy.get(rewards.pageHeader)
.should('be.visible')
.and('have.text', 'Rewards');
});
it('should have epoch warning', function () {
cy.get(rewards.warning)
.should('be.visible')
.and(
'have.text',
'Rewards are credited 5 minutes after the epoch ends.This delay is set by a network parameter'
);
});
it('should have connect Vega wallet button', function () {
cy.get(rewards.connectToVegaBtn)
.should('be.visible')
.and('have.text', 'Connect Vega wallet');
});
});
});

View File

@ -0,0 +1,6 @@
import common from './common.locators';
export default {
...common,
connectToVegaBtn: '[data-testid="connect-to-vega-wallet-btn"]',
};

View File

@ -149,6 +149,7 @@ export const RewardsIndex = () => {
) : (
<Button
className="mt-12"
data-testid="connect-to-vega-wallet-btn"
onClick={() =>
appDispatch({
type: AppStateActionType.SET_VEGA_WALLET_OVERLAY,