Skip to content

Commit

Permalink
Fix invalid pools page loading (#61)
Browse files Browse the repository at this point in the history
* Fix invalid pools page loading

* resolve PR comments.

* More resilient checks

* Delete unused components

* Remove props drilling

* Fix missing navigation on smol screens

* Actually fix the pool header

* Cannot rerun failing tests

* Reduce default timeouts but use long timeouts only for long transactions

* Remove overflow hidden as popover menu is technically invisible

---------

Co-authored-by: Rick <[email protected]>
Co-authored-by: peiman3 <[email protected]>
Co-authored-by: Noisekit <[email protected]>
  • Loading branch information
4 people authored Nov 26, 2024
1 parent 782c150 commit 7aa6117
Show file tree
Hide file tree
Showing 32 changed files with 228 additions and 415 deletions.
15 changes: 7 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ commands:
steps:
- run:
name: 'Install IPFS'
command: |
command: |-
LATEST_VERSION=$(curl -sSL https://dist.ipfs.tech/go-ipfs/versions | tail -n 1)
LATEST_VERSION_NUMBER=${LATEST_VERSION#*v}
DOWNLOAD_URL="https://dist.ipfs.tech/go-ipfs/${LATEST_VERSION}/go-ipfs_${LATEST_VERSION}_linux-amd64.tar.gz"
Expand All @@ -90,7 +90,7 @@ commands:
- run: ipfs add --progress=true --pin=true --recursive "<< parameters.source-dir >>"
- run:
name: 'Save IPFS_CID'
command: |
command: |-
export IPFS_CID=$(ipfs add --progress=false --pin=true --recursive --quieter "<< parameters.source-dir >>")
echo $IPFS_CID
echo "export IPFS_CID=$IPFS_CID" >> $BASH_ENV
Expand All @@ -99,12 +99,12 @@ commands:
command: curl --silent --request POST --user "$IPFS_USER:$IPFS_PASS" "<< parameters.ipfs-api >>/pin/add?recursive=true&progress=true&arg=$IPFS_CID"
- run:
name: 'Publish IPFS_CID to IPNS key << parameters.ipns-key >>'
command: |
command: |-
curl --silent --request POST --user "$IPFS_USER:$IPFS_PASS" "<< parameters.ipfs-api >>/name/publish?key=<< parameters.ipns-key >>&arg=$IPFS_CID" | tee /tmp/name-publish-$IPFS_CID.log
cat /tmp/name-publish-$IPFS_CID.log | jq
- run:
name: 'Pin to Synthetix IPFS cluster'
command: |
command: |-
curl --silent --request POST --user "$IPFS_USER:$IPFS_PASS" "<< parameters.ipfs-cluster-api >>/pin/add?arg=$IPFS_CID" | tee /tmp/pin-add-$IPFS_CID.log
cat /tmp/pin-add-$IPFS_CID.log | jq
Expand Down Expand Up @@ -165,14 +165,13 @@ jobs:
command: wget --retry-connrefused --waitretry=20 --read-timeout=20 --timeout=15 -t 10 http://localhost:3000

- run:
name: 'Run tests'
working_directory: liquidity/cypress
command: |
command: |-
echo "0" > /tmp/cypress_exit_code
export NODE_ENV=test
export CYPRESS_INFURA_KEY=$INFURA_KEY
circleci tests glob 'cypress/e2e/**/*.e2e.js' | circleci tests run --verbose --split-by=timings --command="xargs yarn cypress run --e2e --spec" || echo $? > /tmp/cypress_exit_code
yarn cypress run --e2e || echo $? > /tmp/cypress_exit_code
- save_cache:
key: *anvil-fork-cache
Expand Down
71 changes: 0 additions & 71 deletions liquidity/components/PoolBox/PoolBox.tsx

This file was deleted.

1 change: 0 additions & 1 deletion liquidity/components/PoolBox/index.ts

This file was deleted.

17 changes: 0 additions & 17 deletions liquidity/components/PoolBox/package.json

This file was deleted.

47 changes: 0 additions & 47 deletions liquidity/components/PoolSelector/PoolItem.tsx

This file was deleted.

33 changes: 0 additions & 33 deletions liquidity/components/PoolSelector/PoolSelector.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions liquidity/components/PoolSelector/index.ts

This file was deleted.

15 changes: 0 additions & 15 deletions liquidity/components/PoolSelector/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion liquidity/cypress/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = defineConfig({
openMode: 0,
},

defaultCommandTimeout: 300_000,
defaultCommandTimeout: 30_000,
execTimeout: 60_000,
taskTimeout: 60_000,
},
Expand Down
6 changes: 5 additions & 1 deletion liquidity/cypress/cypress/e2e/1-main/Create_Account.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ describe('Create Account', () => {

cy.get('[data-cy="wallet button"]').click();
cy.get('[data-cy="accounts list"]').children().should('have.length', 1);
cy.contains('[data-cy="create new account button"]', 'Create Account').should('exist');
cy.wait(1000);
cy.contains('[data-cy="create new account button"]', 'Create Account')
.should('exist')
.and('be.visible')
.and('be.enabled');
cy.get('[data-cy="create new account button"]').click();
cy.get('[data-cy="accounts list"]').children().should('have.length', 2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ describe('Manage SNX Position - Borrow', () => {
cy.get('[data-cy="borrow confirm button"]').should('include.text', 'Execute Transaction');
cy.get('[data-cy="borrow confirm button"]').click();

cy.contains('[data-status="info"]', 'Debt successfully Updated').should('exist');
cy.contains('[data-status="success"]', 'Debt successfully Updated', {
timeout: 180_000,
}).should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ describe('Manage SNX Position - Deposit', () => {
cy.get('[data-cy="deposit confirm button"]').should('include.text', 'Execute Transaction');
cy.get('[data-cy="deposit confirm button"]').click();

cy.contains(
'[data-status="success"]',
'Your locked collateral amount has been updated.'
).should('exist');
cy.contains('[data-status="success"]', 'Your locked collateral amount has been updated.', {
timeout: 180_000,
}).should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ describe('Create Account', () => {

cy.get('[data-cy="wallet button"]').click();
cy.get('[data-cy="accounts list"]').children().should('have.length', 1);
cy.contains('[data-cy="create new account button"]', 'Create Account').should('exist');
cy.contains('[data-cy="create new account button"]', 'Create Account')
.should('exist')
.and('be.visible')
.and('be.enabled');
cy.get('[data-cy="create new account button"]').click();
cy.get('[data-cy="accounts list"]').children().should('have.length', 2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ describe('Manage WETH Position - Borrow', () => {
cy.get('[data-cy="claim confirm button"]').should('include.text', 'Execute Transaction');
cy.get('[data-cy="claim confirm button"]').click();

cy.contains('[data-status="info"]', 'Debt successfully Updated').should('exist');
cy.contains('[data-status="success"]', 'Debt successfully Updated', {
timeout: 180_000,
}).should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ describe('Manage WETH Position - Deposit', () => {
cy.get('[data-cy="deposit confirm button"]').should('include.text', 'Execute Transaction');
cy.get('[data-cy="deposit confirm button"]').click();

cy.contains(
'[data-status="success"]',
'Your locked collateral amount has been updated.'
).should('exist');
cy.contains('[data-status="success"]', 'Your locked collateral amount has been updated.', {
timeout: 180_000,
}).should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ describe('Manage WETH Position - Repay', () => {
cy.get('[data-cy="repay confirm button"]').should('include.text', 'Execute Transaction');
cy.get('[data-cy="repay confirm button"]').click();
cy.contains('[data-status="success"]', 'Your debt has been repaid.').should('exist');
cy.contains('[data-status="info"]', 'Debt successfully Updated').should('exist');

cy.contains('[data-status="success"]', 'Debt successfully Updated', {
timeout: 180_000,
}).should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ describe('Create Account', () => {

cy.get('[data-cy="wallet button"]').click();
cy.get('[data-cy="accounts list"]').children().should('have.length', 1);
cy.contains('[data-cy="create new account button"]', 'Create Account').should('exist');
cy.contains('[data-cy="create new account button"]', 'Create Account')
.should('exist')
.and('be.visible')
.and('be.enabled');
cy.get('[data-cy="create new account button"]').click();
cy.get('[data-cy="accounts list"]').children().should('have.length', 2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ describe('Manage Static AaveUSDC Position - Deposit', () => {
cy.get('[data-cy="deposit confirm button"]').should('include.text', 'Execute Transaction');
cy.get('[data-cy="deposit confirm button"]').click();

cy.contains(
'[data-status="success"]',
'Your locked collateral amount has been updated.'
).should('exist');
cy.contains('[data-status="success"]', 'Your locked collateral amount has been updated.', {
timeout: 180_000,
}).should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ describe('Manage USDC Position - Deposit', () => {
cy.get('[data-cy="deposit confirm button"]').should('include.text', 'Execute Transaction');
cy.get('[data-cy="deposit confirm button"]').click();

cy.contains(
'[data-status="success"]',
'Your locked collateral amount has been updated.'
).should('exist');
cy.contains('[data-status="success"]', 'Your locked collateral amount has been updated.', {
timeout: 180_000,
}).should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ describe('should be able to unlock USDC collateral after depositing', () => {
cy.get('[data-cy="undelegate confirm button"]').should('include.text', 'Execute Transaction');
cy.get('[data-cy="undelegate confirm button"]').click();

cy.contains(
'[data-status="success"]',
'Your locked collateral amount has been updated.'
).should('exist');
cy.contains('[data-status="success"]', 'Your locked collateral amount has been updated.', {
timeout: 180_000,
}).should('exist');
});
});
Loading

0 comments on commit 7aa6117

Please sign in to comment.