fix: adjust route strcuture (#2708)

This commit is contained in:
Dexter Edwards 2023-01-24 13:44:11 +00:00 committed by GitHub
parent d7440cfe54
commit bcbc3bb146
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 15 deletions

View File

@ -829,7 +829,7 @@ context(
cy.highlight(`Associating tokens for first time`);
cy.ethereum_wallet_connect();
cy.connectVegaWallet();
cy.get('[href="/validators/associate"]').first().click();
cy.get('[href="/token/associate"]').first().click();
cy.getByTestId('associate-radio-wallet', { timeout: 30000 }).click();
cy.getByTestId('token-amount-input', epochTimeout).type('1');
cy.getByTestId('token-input-submit-button', txTimeout)

View File

@ -7,11 +7,11 @@ const vegaWalletUnstakedBalance =
'[data-testid="vega-wallet-balance-unstaked"]';
const txTimeout = Cypress.env('txTimeout');
const vegaWalletPublicKeyShort = Cypress.env('vegaWalletPublicKeyShort');
const ethWalletAssociateButton = '[href="/validators/associate"]';
const ethWalletAssociateButton = '[href="/token/associate"]';
const associateWalletRadioButton = '[data-testid="associate-radio-wallet"]';
const tokenAmountInputBox = '[data-testid="token-amount-input"]';
const tokenSubmitButton = '[data-testid="token-input-submit-button"]';
const ethWalletDissociateButton = '[href="/validators/disassociate"]';
const ethWalletDissociateButton = '[href="/token/disassociate"]';
const vestingContractSection = '[data-testid="vega-in-vesting-contract"]';
const vegaInWalletSection = '[data-testid="vega-in-wallet"]';
const connectedVegaKey = '[data-testid="connected-vega-key"]';

View File

@ -131,7 +131,7 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
cy.get(associateVegaLink)
.should('be.visible')
.and('have.attr', 'href')
.and('equal', '/validators/associate');
.and('equal', '/token/associate');
});
it('should have STAKING button', function () {
cy.get(stakingBtn)

View File

@ -2,8 +2,8 @@ const walletContainer = '[data-testid="ethereum-wallet"]';
const walletHeader = '[data-testid="wallet-header"] h1';
const connectToEthButton = '[data-testid="connect-to-eth-wallet-button"]';
const connectorList = '[data-testid="web3-connector-list"]';
const associate = '[href="/validators/associate"]';
const disassociate = '[href="/validators/disassociate"]';
const associate = '[href="/token/associate"]';
const disassociate = '[href="/token/disassociate"]';
const disconnect = '[data-testid="disconnect-from-eth-wallet-button"]';
const accountNo = '[data-testid="ethereum-account-truncated"]';
const currencyTitle = '[data-testid="currency-title"]';

View File

@ -3,8 +3,8 @@ const tokenSubmitButton = '[data-testid="token-input-submit-button"]';
const tokenInputApprove = '[data-testid="token-input-approve-button"]';
const addStakeRadioButton = '[data-testid="add-stake-radio"]';
const removeStakeRadioButton = '[data-testid="remove-stake-radio"]';
const ethWalletAssociateButton = '[href="/validators/associate"]';
const ethWalletDissociateButton = '[href="/validators/disassociate"]';
const ethWalletAssociateButton = '[href="/token/associate"]';
const ethWalletDissociateButton = '[href="/token/disassociate"]';
const vegaWalletUnstakedBalance =
'[data-testid="vega-wallet-balance-unstaked"]';
const vegaWalletAssociatedBalance = '[data-testid="currency-value"]';

View File

@ -164,12 +164,12 @@ const ConnectedKey = () => {
)}
</section>
<WalletCardActions>
<Link className="flex-1" to={`${Routes.VALIDATORS}/associate`}>
<Link className="flex-1" to={Routes.ASSOCIATE}>
<Button size="sm" fill={true}>
{t('associate')}
</Button>
</Link>
<Link className="flex-1" to={`${Routes.VALIDATORS}/disassociate`}>
<Link className="flex-1" to={Routes.DISASSOCIATE}>
<Button size="sm" fill={true}>
{t('disassociate')}
</Button>

View File

@ -264,8 +264,6 @@ const routerConfig = [
path: Routes.VALIDATORS,
element: <LazyStaking name="Staking" />,
children: [
{ path: 'associate', element: <LazyStakingAssociate /> },
{ path: 'disassociate', element: <LazyStakingDisassociate /> },
{ path: ':node', element: <LazyStakingNode /> },
{
index: true,
@ -311,6 +309,8 @@ const routerConfig = [
},
],
},
{ path: 'associate', element: <LazyStakingAssociate /> },
{ path: 'disassociate', element: <LazyStakingDisassociate /> },
],
},
{

View File

@ -12,8 +12,8 @@ const Routes = {
REDEEM: '/token/redeem',
WITHDRAWALS: '/token/withdraw',
SUPPLY: '/token/tranches',
ASSOCIATE: '/validators/associate',
DISASSOCIATE: '/validators/disassociate',
ASSOCIATE: '/token/associate',
DISASSOCIATE: '/token/disassociate',
};
export default Routes;

View File

@ -93,7 +93,7 @@ const Home = ({ name }: RouteChildProps) => {
<p>
<Link
data-testid="associate-vega-tokens-link-on-homepage"
to={`${Routes.VALIDATORS}/associate`}
to={Routes.ASSOCIATE}
className="underline text-white"
>
{t('Associate VEGA tokens')}