Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Broken CI due to Node 20
  • Loading branch information
KillianH committed Jun 19, 2024
1 parent d71b565 commit d652bfb
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
version: v3.10.0

- uses: azure/setup-kubectl@v3
- uses: azure/setup-kubectl@v4
with:
version: 'v1.29.0'

Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:
with:
version: v3.10.0

- uses: azure/setup-kubectl@v3
- uses: azure/setup-kubectl@v4
with:
version: 'v1.29.0'

Expand Down
2 changes: 2 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ module.exports = defineConfig({
bundler: 'vite',
},
video: false,
viewportWidth: 1920,
viewportHeight: 1080,
supportFile: 'tests/e2e/support/index.js',
fixturesFolder: 'tests/e2e/fixtures/',
downloadsFolder: 'tests/e2e/fixtures/downloads/',
Expand Down
2 changes: 1 addition & 1 deletion src/components/account/erc20/Erc20TokenBalance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<v-card-actions>
<v-dialog
v-model="allowancesDialog"
width="500"
width="600"
>
<template #activator="{ attrs, on }">
<v-btn
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/helpers/testAllowance.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function testAllowanceUsing(

cy.get(`[data-cy=erc20-${contractHash}-${spenderHash}-allowance]`)
.should('be.visible')
.contains(new RegExp(`(\\d+,)?\\d+\.\\d{5} ${contractUnit}`));
.contains(new RegExp(`(\\d+,)?\\d+\.?\\d* ${contractUnit}`));
cy.get(`[data-cy=erc20-${contractHash}-${spenderHash}-allowance-revoke]`)
.should('be.visible')
.click();
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/specs/offlinePaths/Delegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('Delegate', () => {
cy.get('[data-cy=errorBalance]').should('have.length', 1);
cy.get('[data-cy=errorBalance]').should('contain', ' Insufficient funds. You must have more than 502.5 CSPR on your wallet. ');
mockConnection(cy, '01270a577d2d106c4d29402775f3dffcb9f04aad542579dd4d1cfad20572ebcb7c');
cy.get('.v-alert').should('have.length', 0);
cy.get('[data-cy=errorBalance]').should('have.length', 0);
cy.get('[data-cy=submitOperation]').click();
cy.get('[data-cy=amount]').type('9999999999').parents('.v-input__control').find('.v-messages__message')
.should('contain', 'Amount must equal or bellow');
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/specs/offlinePaths/SmartContract.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ describe('Smart Contract', () => {
cy.get('[data-cy=errorBalance]').should('contain', ' Not connected. ');
mockConnection(cy, '01270a577d2d106c4d29402775f3dffcb9f04aad542579dd4d1cfad20572ebcb7a');
cy.get('[data-cy=errorBalance]').should('have.length', 1);
cy.get('[data-cy=errorBalance]').should('contain', ' Insufficient funds. You must have more than 1 CSPR on your wallet. ');
cy.get('[data-cy=errorBalance]').should('contain', ' Insufficient funds. You must have more than 0 CSPR on your wallet. ');
mockConnection(cy, '0124bfdae2ed128fa5e4057bc398e4933329570e47240e57fc92f5611a6178eba5');
cy.get('.v-alert').should('have.length', 0);
cy.get('[data-cy=errorBalance]').should('have.length', 0);
cy.get('[data-cy=submitOperation]').click();
cy.get('[data-cy=amount]').type('9999999').parents('.v-input__control').find('.v-messages__message')
.should('contain', 'Amount must equal or bellow');
Expand Down
12 changes: 6 additions & 6 deletions tests/e2e/specs/offlinePaths/balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ describe('Balance', () => {
cy.get('[data-cy=balance-total-staked] .amount')
.should('be.visible')
.should('not.contain', '0.00000\xa0CSPR')
.contains(/^(\d*,)*\d+\.\d{5} CSPR$/);
.contains(/^(\d*,)*\d+\.\d+ CSPR$/);
cy.get('[data-cy=balance-total-available] .amount')
.should('be.visible')
.should('not.contain', /^0.00000\xa0CSPR$/)
.contains(/^(\d*,)*\d+\.\d{5} CSPR$/);
.contains(/^(\d*,)*\d+\.\d+ CSPR$/);
cy.get('[data-cy=balance-total] .amount')
.should('be.visible')
.should('not.contain', '0.00000\xa0CSPR')
.contains(/^(\d*,)*\d+\.\d{5} CSPR$/);
.contains(/^(\d*,)*\d+\.\d+ CSPR$/);

cy.get('[data-cy=reward-calculator-panel-header]').click();
cy.get('[data-cy=reward-calculator]').should('be.visible');
Expand All @@ -35,12 +35,12 @@ describe('Balance', () => {
.should('not.exist');
cy.get('[data-cy=balance-total-staked] .amount')
.should('be.visible')
.should('contain', '0.00000\xa0CSPR');
.should('contain', '0\xa0CSPR');
cy.get('[data-cy=balance-total-available] .amount')
.should('be.visible')
.should('contain', '0.00000\xa0CSPR');
.should('contain', '0\xa0CSPR');
cy.get('[data-cy=balance-total] .amount')
.should('be.visible')
.should('contain', '0.00000\xa0CSPR');
.should('contain', '0\xa0CSPR');
});
});
4 changes: 0 additions & 4 deletions tests/e2e/specs/offlinePaths/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ describe('Home', () => {

cy.get('[data-cy=humanReadableNetwork]').should('contain', ' Testnet ');
mockConnection(cy, '01270a577d2d106c4d29402775f3dffcb9f04aad542579dd4d1cfad20572ebcb7c');
cy.get('[data-cy=tutorial]').click().get('.v-window__prev button').click()
.should('be.visible');
cy.get('[data-cy=closeTutorial]').click();
cy.get('[data-cy=tutorialDialog]').should('not.be.visible');
cy.get('[data-cy=account]')
.should('be.visible').click();
cy.get('[data-cy=logout]').should('be.visible').click();
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/specs/offlinePaths/transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('Transfer', () => {
cy.get('[data-cy=errorBalance]').should('have.length', 1);
cy.get('[data-cy=errorBalance]').should('contain', ' Insufficient funds. You must have more than 2.6 CSPR on your wallet. ');
mockConnection(cy, '0184f6d260f4ee6869ddb36affe15456de6ae045278fa2f467bb677561ce0dad55');
cy.get('.v-alert').should('have.length', 0);
cy.get('[data-cy=errorBalance]').should('have.length', 0);
cy.get('[data-cy=submitOperation]').click();
cy.get('[data-cy=address]').parents('.v-input__control').find('.v-messages__message').should('contain', 'Address is required');
cy.get('[data-cy=address]').type('NotValidAddress').parents('.v-input__control').find('.v-messages__message')
Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/specs/onlinePaths/NewErc20.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ describe('Deploy & test erc20', () => {

cy.get('[data-cy=erc20-add-card]')
.should('not.exist');
cy.wait(5000);
cy.get(`[data-cy=erc20-balance-${erc20Contract}]`)
.should('be.visible')
.contains(/^(\d*,)*\d+\.\d* TESTERC20$/);
.contains(/^(\d*,)*\d+\.?\d* TESTERC20$/);
});

it('Should let you do a revoke/max of ERC20 allowance', () => {
Expand Down
3 changes: 2 additions & 1 deletion tests/e2e/specs/onlinePaths/NewUniswapErc20.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ describe('Deploy & test Uniswap erc20', () => {

cy.get('[data-cy=erc20-add-card]')
.should('not.exist');
cy.wait(5000);
cy.get(`[data-cy=erc20-balance-${uniswapContract}]`)
.should('be.visible')
.contains(/^(\d*,)*\d+\.\d* TESTUNISWAPERC20$/);
.contains(/^(\d*,)*\d+\.?\d* TESTUNISWAPERC20$/);
});

it('Should let you do a revoke/max of Uniswap ERC20 allowance', () => {
Expand Down

0 comments on commit d652bfb

Please sign in to comment.