-
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
Showing
24 changed files
with
2,262 additions
and
2,240 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
195 changes: 0 additions & 195 deletions
195
packages/app/src/features/dialogs/savings/withdraw/SavingsWithdrawDialog.test-e2e.ts
This file was deleted.
Oops, something went wrong.
81 changes: 81 additions & 0 deletions
81
packages/app/src/features/dialogs/savings/withdraw/e2e/base/General.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,81 @@ | ||
import { SavingsPageObject } from '@/pages/Savings.PageObject' | ||
import { BASE_DEFAULT_BLOCK_NUMBER } from '@/test/e2e/constants' | ||
import { setup } from '@/test/e2e/setup' | ||
import { test } from '@playwright/test' | ||
import { base } from 'viem/chains' | ||
import { SavingsDialogPageObject } from '../../../common/e2e/SavingsDialog.PageObject' | ||
|
||
test.describe('Without send mode', () => { | ||
test('can switch between tokens', async ({ page }) => { | ||
const testContext = await setup(page, { | ||
blockchain: { | ||
chainId: base.id, | ||
blockNumber: BASE_DEFAULT_BLOCK_NUMBER, | ||
}, | ||
initialPage: 'savings', | ||
account: { | ||
type: 'connected-random', | ||
assetBalances: { | ||
ETH: 1, | ||
sUSDS: 1000, | ||
}, | ||
}, | ||
}) | ||
|
||
const savingsPage = new SavingsPageObject(testContext) | ||
|
||
await savingsPage.clickWithdrawSUsdsButtonAction() | ||
|
||
const withdrawalDialog = new SavingsDialogPageObject({ testContext, type: 'withdraw' }) | ||
|
||
await withdrawalDialog.fillAmountAction(1000) | ||
await withdrawalDialog.actionsContainer.expectEnabledActionAtIndex(0) | ||
await withdrawalDialog.actionsContainer.expectActions([ | ||
{ type: 'approve', asset: 'sUSDS' }, | ||
{ type: 'withdrawFromSavings', asset: 'USDS', savingsAsset: 'sUSDS', mode: 'withdraw' }, | ||
]) | ||
|
||
await withdrawalDialog.selectAssetAction('USDC') | ||
await withdrawalDialog.fillAmountAction(1000) | ||
await withdrawalDialog.actionsContainer.expectEnabledActionAtIndex(0) | ||
await withdrawalDialog.actionsContainer.expectActions([ | ||
{ type: 'approve', asset: 'sUSDS' }, | ||
{ type: 'withdrawFromSavings', asset: 'USDC', savingsAsset: 'sUSDS', mode: 'withdraw' }, | ||
]) | ||
|
||
await withdrawalDialog.selectAssetAction('USDS') | ||
await withdrawalDialog.fillAmountAction(1000) | ||
await withdrawalDialog.actionsContainer.expectEnabledActionAtIndex(0) | ||
await withdrawalDialog.actionsContainer.expectActions([ | ||
{ type: 'approve', asset: 'sUSDS' }, | ||
{ type: 'withdrawFromSavings', asset: 'USDS', savingsAsset: 'sUSDS', mode: 'withdraw' }, | ||
]) | ||
}) | ||
}) | ||
|
||
test.describe('With send mode', () => { | ||
test('can select only supported assets', async ({ page }) => { | ||
const testContext = await setup(page, { | ||
blockchain: { | ||
chainId: base.id, | ||
blockNumber: BASE_DEFAULT_BLOCK_NUMBER, | ||
}, | ||
initialPage: 'savings', | ||
account: { | ||
type: 'connected-random', | ||
assetBalances: { | ||
USDS: 100, | ||
sUSDS: 10_000, | ||
}, | ||
}, | ||
}) | ||
|
||
const savingsPage = new SavingsPageObject(testContext) | ||
await savingsPage.clickSendSUsdsButtonAction() | ||
|
||
const sendDialog = new SavingsDialogPageObject({ testContext, type: 'send' }) | ||
|
||
await sendDialog.openAssetSelectorAction() | ||
await sendDialog.expectAssetSelectorOptions(['USDC', 'USDS']) | ||
}) | ||
}) |
Oops, something went wrong.