Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
fix: e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Jun 23, 2022
1 parent 938564e commit 7748430
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 121 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

# Make github action to use the latest version of
# docker compose without it docker compose down
# has issues with memory nil pointer
Expand All @@ -125,7 +125,11 @@ jobs:
- name: Setup scripts
run: |
pnpm scripts:setup
- name: Run test
run: |
pnpm ci:test:coverage
# using same dependencies from cypress/browsers:node16.5.0-chrome97-ff96 ...
# not using directly the container because we still need ubuntu-latest preset
- name: Install Cypress Dependencies
Expand Down Expand Up @@ -174,7 +178,3 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEBUG: "cypress:server:*"
NODE_ENV: "test"

- name: Run test
run: |
pnpm ci:test:coverage
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"devDependencies": {
"@babel/core": "^7.18.2",
"@cypress/react": "^5.12.5",
"@cypress/react": "^6.0.0",
"@jest/types": "^28.1.1",
"@swayswap/test-utils": "workspace:*",
"@swc/core": "^1.2.197",
Expand All @@ -64,7 +64,7 @@
"@types/node": "^17.0.41",
"@types/react": "^18.0.12",
"@types/react-dom": "^18.0.5",
"cypress": "10.2.0",
"cypress": "^10.2.0",
"dotenv": "^16.0.1",
"eslint": "^8.17.0",
"husky": "^8.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"cross-fetch": "^3.1.5",
"decimal.js": "^10.3.1",
"ethers": "^5.6.9",
"framer-motion": "^6.3.12",
"framer-motion": "^6.3.13",
"fuels": "0.0.0-master-b32f29b9",
"graphql-request": "^4.3.0",
"jotai": "^1.7.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/app/src/systems/Pool/pages/RemoveLiquidity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
import { CoinBalance } from "~/systems/Core/components/CoinBalance";
import { useTransactionCost } from "~/systems/Core/hooks/useTransactionCost";
import { txFeedback } from "~/systems/Core/utils/feedback";
import { getTransactionCost } from "~/systems/Core/utils/gas";
import { Button, Card } from "~/systems/UI";

export function RemoveLiquidityPage() {
Expand All @@ -46,10 +47,9 @@ export function RemoveLiquidityPage() {
if (!amount) {
throw new Error('"amount" is required');
}
if (!txCost.total) return;
// TODO: Add way to set min_eth and min_tokens
// https://github.com/FuelLabs/swayswap/issues/55
return submitRemoveLiquidity(contract, amount, txCost);
const contractCall = prepareRemoveLiquidity(contract);
const newTxCost = await getTransactionCost(contractCall);
return submitRemoveLiquidity(contract, amount, newTxCost);
},
{ onSuccess: txFeedback("Liquidity removed successfully!", handleSuccess) }
);
Expand Down
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"eslint-plugin-jest-dom": "^4.0.2",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-testing-library": "^5.5.1",
"prettier": "^2.7.1",
Expand Down
127 changes: 20 additions & 107 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7748430

Please sign in to comment.