Skip to content

Commit

Permalink
Merge pull request #216 from OasisDEX/fixes-2
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
juan-langa authored Apr 12, 2024
2 parents ef55419 + 6ff45a0 commit b65a40f
Show file tree
Hide file tree
Showing 34 changed files with 36 additions and 34 deletions.
19 changes: 9 additions & 10 deletions tests/sharedTestSteps/positionManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ export const openPosition = async ({
borrow,
existingDPM,
adjustRisk,
omni,
protocol,
}: {
app: App;
forkId: string;
deposit: ActionData;
borrow?: ActionData;
existingDPM?: boolean;
adjustRisk?: { positionType?: 'Borrow'; value: number };
omni?: { network: 'ethereum' | 'arbitrum' | 'base' | 'optimism' };
protocol?: 'Ajna' | 'Morpho Blue';
}) => {
await app.position.setup.deposit(deposit);
if (borrow) {
Expand Down Expand Up @@ -69,23 +69,22 @@ export const openPosition = async ({
await tx.confirmAndVerifySuccess({ metamaskAction: 'confirmPermissionToSpend', forkId });
}).toPass({ timeout: longTestTimeout });

if (omni) {
if (protocol) {
// UI sometimes gets stuck after confirming position creation
// - 'Reload' added to avoid flakines
await app.page.reload();
await app.position.setup.goToPosition();
await app.position.overview.shouldBeVisible();
} else {
await app.position.setup.goToPositionShouldBeVisible();
const positionId = await app.position.setup.getNewPositionId();
//
await app.page.waitForTimeout(10_000);
//
await expect(async () => {
// await app.page.goto(positionId.replace(omni.network, `${omni.network}/omni`));
await app.page.goto(positionId);
await app.position.overview.shouldBeVisible();
}).toPass();
} else {
// UI sometimes gets stuck after confirming position creation
// - 'Reload' added to avoid flakines
await app.page.reload();
await app.position.setup.goToPosition();
await app.position.overview.shouldBeVisible();
}
};

Expand Down
1 change: 0 additions & 1 deletion tests/withWallet/aaveV2/aaveV2Earn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ test.describe('Aave V2 Earn - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'ETH', amount: '10.09' },
omni: { network: 'ethereum' },
});
});
});
1 change: 0 additions & 1 deletion tests/withWallet/aaveV2/aaveV2Multiply.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ test.describe('Aave v2 Multiply - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'ETH', amount: '2' },
omni: { network: 'ethereum' },
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ test.describe('Aave v3 Multiply - Arbitrum - Wallet connected', async () => {
forkId,
deposit: { token: 'WBTC', amount: '0.5' },
adjustRisk: { positionType: 'Borrow', value: 0.5 },
omni: { network: 'arbitrum' },
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ test.describe('Aave V3 Borrow - Arbitrum - Wallet connected', async () => {
forkId,
deposit: { token: 'ETH', amount: '7.5' },
borrow: { token: 'USDC', amount: '2000' },
omni: { network: 'arbitrum' },
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ test.describe('Aave v3 Multiply - Arbitrum - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'ETH', amount: '8.12345' },
omni: { network: 'arbitrum' },
});
});

Expand Down
1 change: 0 additions & 1 deletion tests/withWallet/aaveV3/base/aaveV3BorrowBase_1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ test.describe('Aave V3 Borrow - Base - Wallet connected', async () => {
forkId,
deposit: { token: 'ETH', amount: '9.12345' },
borrow: { token: 'USDBC', amount: '2000' },
omni: { network: 'base' },
});
});

Expand Down
1 change: 0 additions & 1 deletion tests/withWallet/aaveV3/base/aaveV3EarnBase.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ test.describe('Aave V3 Earn - Base - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'CBETH', amount: '5' },
omni: { network: 'base' },
});
});

Expand Down
1 change: 0 additions & 1 deletion tests/withWallet/aaveV3/base/aaveV3MultiplyBase.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ test.describe('Aave v3 Multiply - Base - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'CBETH', amount: '14' },
omni: { network: 'base' },
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ test.describe('Aave v3 Multiply - Base - Wallet connected', async () => {
forkId,
deposit: { token: 'ETH', amount: '10' },
adjustRisk: { positionType: 'Borrow', value: 0.4 },
omni: { network: 'base' },
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ test.describe('Aave v3 Multiply - Base - Wallet connected', async () => {
forkId,
deposit: { token: 'ETH', amount: '10' },
adjustRisk: { positionType: 'Borrow', value: 0.4 },
omni: { network: 'base' },
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ test.describe('Aave v3 Multiply - Ethereum - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'DAI', amount: '15000.1234' },
omni: { network: 'ethereum' },
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ test.describe('Aave V3 Borrow - Ethereum - Wallet connected', async () => {
forkId,
deposit: { token: 'CBETH', amount: '7.5' },
borrow: { token: 'ETH', amount: '3' },
omni: { network: 'ethereum' },
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ test.describe('Aave V3 Earn - Ethereum - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'ETH', amount: '10' },
omni: { network: 'ethereum' },
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ test.describe('Aave V3 Borrow - Optimism - Wallet connected', async () => {
forkId,
deposit: { token: 'ETH', amount: '7.5' },
borrow: { token: 'USDC', amount: '2000' },
omni: { network: 'optimism' },
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ test.describe('Aave v3 Multiply - Optimism - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'ETH', amount: '10.12345' },
omni: { network: 'optimism' },
});
});

Expand Down
1 change: 1 addition & 0 deletions tests/withWallet/ajna/arbitrum/ajnaArbitrumBorrow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ test.describe.skip('Ajna Arbitrum Borrow - Wallet connected', async () => {
forkId,
deposit: { token: 'RETH', amount: '0.1' },
borrow: { token: 'ETH', amount: '0.01' },
protocol: 'Ajna',
});
});

Expand Down
1 change: 1 addition & 0 deletions tests/withWallet/ajna/arbitrum/ajnaArbitrumEarn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ test.describe('Ajna Arbitrum Earn - Wallet connected', async () => {
forkId,
deposit: { token: 'WBTC', amount: '1' },
adjustRisk: { value: 0.8 },
protocol: 'Ajna',
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ test.describe.skip('Ajna Arbitrum Multiply - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'RETH', amount: '0.5' },
protocol: 'Ajna',
});
});
});
1 change: 1 addition & 0 deletions tests/withWallet/ajna/base/ajnaBorrowBase.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ test.describe('Ajna Base Borrow - Wallet connected', async () => {
forkId,
deposit: { token: 'WSTETH', amount: '2' },
borrow: { token: 'ETH', amount: '1' },
protocol: 'Ajna',
});
});

Expand Down
7 changes: 6 additions & 1 deletion tests/withWallet/ajna/base/ajnaEarnBase.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ test.describe('Ajna Base Earn - Wallet connected', async () => {
await app.page.goto('/base/ajna/earn/ETH-USDC#setup');
await app.position.setup.acknowlegeAjnaInfo();

await openPosition({ app, forkId, deposit: { token: 'USDC', amount: '5000' } });
await openPosition({
app,
forkId,
deposit: { token: 'USDC', amount: '5000' },
protocol: 'Ajna',
});
});

test('It should allow to simulate an Ajna Base Earn position before opening it', async () => {
Expand Down
1 change: 1 addition & 0 deletions tests/withWallet/ajna/base/ajnaMultiplyBase.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ test.describe('Ajna Base Multiply - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'ETH', amount: '15' },
protocol: 'Ajna',
});
});

Expand Down
1 change: 1 addition & 0 deletions tests/withWallet/ajna/ethereum/ajnaBorrowEthereum.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ test.describe('Ajna Ethereum Borrow - Wallet connected', async () => {
forkId,
deposit: { token: 'RETH', amount: '2' },
borrow: { token: 'ETH', amount: '1.5' },
protocol: 'Ajna',
});
});

Expand Down
7 changes: 6 additions & 1 deletion tests/withWallet/ajna/ethereum/ajnaEarnethereum.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ test.describe('Ajna Ethereum Earn - Wallet connected', async () => {
await app.page.goto('/ethereum/ajna/earn/RETH-ETH#setup');
await app.position.setup.acknowlegeAjnaInfo();

await openPosition({ app, forkId, deposit: { token: 'ETH', amount: '20' } });
await openPosition({
app,
forkId,
deposit: { token: 'ETH', amount: '20' },
protocol: 'Ajna',
});
});

test('It should allow to simulate an Ajna Ethereum Earn position before opening it', async () => {
Expand Down
7 changes: 6 additions & 1 deletion tests/withWallet/ajna/ethereum/ajnaMultiplyEthereum.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ test.describe('Ajna Ethereum Multiply - Wallet connected', async () => {
await app.page.goto('/ethereum/ajna/multiply/RETH-ETH#setup');
await app.position.setup.acknowlegeAjnaInfo();

await openPosition({ app, forkId, deposit: { token: 'RETH', amount: '2' } });
await openPosition({
app,
forkId,
deposit: { token: 'RETH', amount: '2' },
protocol: 'Ajna',
});
});

test('It should adjust risk of an existing Ajna Ethereum Multiply position - Up @regression', async () => {
Expand Down
1 change: 1 addition & 0 deletions tests/withWallet/ajna/optimism/ajnaOptimismEarn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ test.describe('Ajna Optimism Earn & Borrow - Wallet connected', async () => {
forkId,
deposit: { token: 'ETH', amount: '10' },
adjustRisk: { value: 0.8 },
protocol: 'Ajna',
});
});

Expand Down
1 change: 1 addition & 0 deletions tests/withWallet/morphoBlue/morphoBlueBorrow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ test.describe('Morpho Blue Borrow - Wallet connected', async () => {
forkId,
deposit: { token: 'WSTETH', amount: '10' },
borrow: { token: 'USDC', amount: '8000.12' },
protocol: 'Morpho Blue',
});
});

Expand Down
1 change: 1 addition & 0 deletions tests/withWallet/morphoBlue/morphoBlueMultiply.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ test.describe('Morpho Blue Multiply - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'WSTETH', amount: '30.12345' },
protocol: 'Morpho Blue',
});
});

Expand Down
1 change: 0 additions & 1 deletion tests/withWallet/spark/earn/sparkEarn1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ test.describe('Spark Earn - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'RETH', amount: '7.5' },
omni: { network: 'ethereum' },
});
});

Expand Down
1 change: 0 additions & 1 deletion tests/withWallet/spark/multiply/sparkMultiply2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ test.describe('Spark Multiply - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'SDAI', amount: '20000' },
omni: { network: 'ethereum' },
});
});

Expand Down
1 change: 0 additions & 1 deletion tests/withWallet/spark/multiply/sparkMultiply3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ test.describe('Spark Multiply - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'ETH', amount: '10' },
omni: { network: 'ethereum' },
});
});

Expand Down
1 change: 0 additions & 1 deletion tests/withWallet/spark/multiply/sparkMultiply4.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ test.describe('Spark Multiply - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'WBTC', amount: '1' },
omni: { network: 'ethereum' },
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ test.describe('Spark Multiply - Mainnet - Wallet connected', async () => {
app,
forkId,
deposit: { token: 'WBTC', amount: '1' },
omni: { network: 'ethereum' },
adjustRisk: { positionType: 'Borrow', value: 0.5 },
});
});
Expand Down
1 change: 0 additions & 1 deletion tests/withWallet/spark/sparkBorrow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ test.describe('Spark Borrow - Wallet connected', async () => {
forkId,
deposit: { token: 'ETH', amount: '7.5' },
borrow: { token: 'DAI', amount: '5000' },
omni: { network: 'ethereum' },
});
});

Expand Down

0 comments on commit b65a40f

Please sign in to comment.