-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Oskar
committed
Jun 11, 2024
1 parent
b11f369
commit d90d318
Showing
10 changed files
with
178 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
...res/dialogs/savings/common/components/maker-transaction-overview/components/RouteItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
packages/app/src/features/dialogs/savings/deposit/e2e/DepositDAI.test-e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { ActionsPageObject } from '@/features/actions/ActionsContainer.PageObject' | ||
import { SavingsPageObject } from '@/pages/Savings.PageObject' | ||
import { DEFAULT_BLOCK_NUMBER } from '@/test/e2e/constants' | ||
import { setup } from '@/test/e2e/setup' | ||
import { setupFork } from '@/test/e2e/setupFork' | ||
import { test } from '@playwright/test' | ||
import { mainnet } from 'viem/chains' | ||
import { SavingsDepositDialogPageObject } from '../SavingsDepositDialog.PageObject' | ||
|
||
test.describe('Deposit DAI on Mainnet', () => { | ||
const fork = setupFork({ blockNumber: DEFAULT_BLOCK_NUMBER, chainId: mainnet.id }) | ||
let savingsPage: SavingsPageObject | ||
let depositDialog: SavingsDepositDialogPageObject | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await setup(page, fork, { | ||
initialPage: 'savings', | ||
account: { | ||
type: 'connected', | ||
assetBalances: { | ||
ETH: 1, | ||
DAI: 10_000, | ||
}, | ||
}, | ||
}) | ||
|
||
savingsPage = new SavingsPageObject(page) | ||
await savingsPage.clickDepositButtonAction('DAI') | ||
|
||
depositDialog = new SavingsDepositDialogPageObject(page) | ||
await depositDialog.fillAmountAction(10_000) | ||
}) | ||
|
||
test('uses native sDai deposit', async ({ page, browser }) => { | ||
await depositDialog.expectToUseNativeSDaiAction({ | ||
title: 'Wrap DAI into sDAI', | ||
type: 'deposit', | ||
}) | ||
}) | ||
|
||
test('displays transaction overview', async () => { | ||
await depositDialog.expectNativeRouteTransactionOverview({ | ||
apy: { | ||
value: '5.00%', | ||
description: 'Earn ~$500.00 DAI per year', | ||
}, | ||
routeItems: [ | ||
{ | ||
tokenAmount: '10,000.00 DAI', | ||
tokenUsdValue: '$10,000.00', | ||
}, | ||
{ | ||
tokenAmount: '9,332.66 sDAI', | ||
tokenUsdValue: '$10,000.00', | ||
}, | ||
], | ||
outcome: '9,332.66 sDAI worth $10,000.00', | ||
}) | ||
}) | ||
|
||
test('executes deposit', async () => { | ||
const actionsContainer = new ActionsPageObject(depositDialog.locatePanelByHeader('Actions')) | ||
await actionsContainer.acceptAllActionsAction(2) | ||
|
||
await depositDialog.expectSuccessPage() | ||
await depositDialog.clickBackToSavingsButton() | ||
|
||
await savingsPage.expectSavingsBalance({ sDaiBalance: '9,332.66 sDAI', estimatedDaiValue: '10,000' }) | ||
await savingsPage.expectCashInWalletAssetBalance('DAI', '-') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters