-
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
8 changed files
with
496 additions
and
478 deletions.
There are no files selected for viewing
121 changes: 62 additions & 59 deletions
121
packages/app/src/features/dialogs/convert-stables/e2e/base/UsdcToUsds.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 |
---|---|---|
@@ -1,66 +1,69 @@ | ||
// import { SavingsPageObject } from '@/pages/Savings.PageObject' | ||
// import { setupFork } from '@/test/e2e/forking/setupFork' | ||
// import { setup } from '@/test/e2e/setup' | ||
// import { test } from '@playwright/test' | ||
// import { base } from 'viem/chains' | ||
// import { ConvertStablesDialogPageObject } from '../../ConvertStablesDialog.PageObject' | ||
import { SavingsPageObject } from '@/pages/Savings.PageObject' | ||
import { setup } from '@/test/e2e/setup' | ||
import { test } from '@playwright/test' | ||
import { base } from 'viem/chains' | ||
import { ConvertStablesDialogPageObject } from '../../ConvertStablesDialog.PageObject' | ||
import { BASE_DEFAULT_BLOCK_NUMBER } from '@/test/e2e/constants' | ||
|
||
// test.describe('Convert USDC to USDS', () => { | ||
// const fork = setupFork({ chainId: base.id, blockNumber: 22143788n, useTenderlyVnet: true }) | ||
// let savingsPage: SavingsPageObject | ||
// let convertStablesDialog: ConvertStablesDialogPageObject | ||
test.describe('Convert USDC to USDS', () => { | ||
let savingsPage: SavingsPageObject | ||
let convertStablesDialog: ConvertStablesDialogPageObject | ||
|
||
// test.beforeEach(async ({ page }) => { | ||
// await setup(page, fork, { | ||
// initialPage: 'savings', | ||
// account: { | ||
// type: 'connected-random', | ||
// assetBalances: { | ||
// ETH: 1, | ||
// USDC: 10_000, | ||
// }, | ||
// }, | ||
// }) | ||
test.beforeEach(async ({ page }) => { | ||
const testContext =await setup(page, { | ||
blockchain: { | ||
blockNumber: BASE_DEFAULT_BLOCK_NUMBER, | ||
chainId: base.id, | ||
}, | ||
initialPage: 'savings', | ||
account: { | ||
type: 'connected-random', | ||
assetBalances: { | ||
ETH: 1, | ||
USDC: 10_000, | ||
}, | ||
}, | ||
}) | ||
|
||
// savingsPage = new SavingsPageObject(page) | ||
// await savingsPage.clickConvertStablesButtonAction() | ||
savingsPage = new SavingsPageObject(testContext) | ||
await savingsPage.clickConvertStablesButtonAction() | ||
|
||
// convertStablesDialog = new ConvertStablesDialogPageObject(page) | ||
// await convertStablesDialog.selectAssetInAction('USDC') | ||
// await convertStablesDialog.selectAssetOutAction('USDS') | ||
// await convertStablesDialog.fillAmountInAction(10_000) | ||
// }) | ||
convertStablesDialog = new ConvertStablesDialogPageObject(testContext) | ||
await convertStablesDialog.selectAssetInAction('USDC') | ||
await convertStablesDialog.selectAssetOutAction('USDS') | ||
await convertStablesDialog.fillAmountInAction(10_000) | ||
}) | ||
|
||
// test('uses psm convert action', async () => { | ||
// await convertStablesDialog.actionsContainer.expectEnabledActionAtIndex(0) | ||
// await convertStablesDialog.actionsContainer.expectActions([ | ||
// { type: 'approve', asset: 'USDC' }, | ||
// { type: 'psmConvert', inToken: 'USDC', outToken: 'USDS' }, | ||
// ]) | ||
// }) | ||
test('uses psm convert action', async () => { | ||
await convertStablesDialog.actionsContainer.expectEnabledActionAtIndex(0) | ||
await convertStablesDialog.actionsContainer.expectActions([ | ||
{ type: 'approve', asset: 'USDC' }, | ||
{ type: 'psmConvert', inToken: 'USDC', outToken: 'USDS' }, | ||
]) | ||
}) | ||
|
||
// test('displays transaction overview', async () => { | ||
// await convertStablesDialog.expectTransactionOverview({ | ||
// routeItems: [ | ||
// { | ||
// tokenAmount: '10,000.00 USDC', | ||
// tokenUsdValue: '$10,000.00', | ||
// }, | ||
// { | ||
// tokenAmount: '10,000.00 USDS', | ||
// tokenUsdValue: '$10,000.00', | ||
// }, | ||
// ], | ||
// outcome: '10,000.00 USDS', | ||
// outcomeUsd: '$10,000.00', | ||
// }) | ||
// }) | ||
test('displays transaction overview', async () => { | ||
await convertStablesDialog.expectTransactionOverview({ | ||
routeItems: [ | ||
{ | ||
tokenAmount: '10,000.00 USDC', | ||
tokenUsdValue: '$10,000.00', | ||
}, | ||
{ | ||
tokenAmount: '10,000.00 USDS', | ||
tokenUsdValue: '$10,000.00', | ||
}, | ||
], | ||
outcome: '10,000.00 USDS', | ||
outcomeUsd: '$10,000.00', | ||
}) | ||
}) | ||
|
||
// test('executes conversion', async () => { | ||
// await convertStablesDialog.actionsContainer.acceptAllActionsAction(2) | ||
// await convertStablesDialog.expectSuccessPage() | ||
// await convertStablesDialog.clickBackToSavingsButton() | ||
// await savingsPage.expectStablecoinsInWalletAssetBalance('USDC', '-') | ||
// await savingsPage.expectStablecoinsInWalletAssetBalance('USDS', '10,000.00') | ||
// }) | ||
// }) | ||
test('executes conversion', async () => { | ||
await convertStablesDialog.actionsContainer.acceptAllActionsAction(2) | ||
await convertStablesDialog.expectSuccessPage() | ||
await convertStablesDialog.clickBackToSavingsButton() | ||
await savingsPage.expectStablecoinsInWalletAssetBalance('USDC', '-') | ||
await savingsPage.expectStablecoinsInWalletAssetBalance('USDS', '10,000.00') | ||
}) | ||
}) |
121 changes: 62 additions & 59 deletions
121
packages/app/src/features/dialogs/convert-stables/e2e/base/UsdsToUsdc.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 |
---|---|---|
@@ -1,66 +1,69 @@ | ||
// import { SavingsPageObject } from '@/pages/Savings.PageObject' | ||
// import { setupFork } from '@/test/e2e/forking/setupFork' | ||
// import { setup } from '@/test/e2e/setup' | ||
// import { test } from '@playwright/test' | ||
// import { base } from 'viem/chains' | ||
// import { ConvertStablesDialogPageObject } from '../../ConvertStablesDialog.PageObject' | ||
import { SavingsPageObject } from '@/pages/Savings.PageObject' | ||
import { setup } from '@/test/e2e/setup' | ||
import { test } from '@playwright/test' | ||
import { base } from 'viem/chains' | ||
import { ConvertStablesDialogPageObject } from '../../ConvertStablesDialog.PageObject' | ||
import { BASE_DEFAULT_BLOCK_NUMBER } from '@/test/e2e/constants' | ||
|
||
// test.describe('Convert USDS to USDC', () => { | ||
// const fork = setupFork({ chainId: base.id, blockNumber: 22143788n, useTenderlyVnet: true }) | ||
// let savingsPage: SavingsPageObject | ||
// let convertStablesDialog: ConvertStablesDialogPageObject | ||
test.describe('Convert USDS to USDC', () => { | ||
let savingsPage: SavingsPageObject | ||
let convertStablesDialog: ConvertStablesDialogPageObject | ||
|
||
// test.beforeEach(async ({ page }) => { | ||
// await setup(page, fork, { | ||
// initialPage: 'savings', | ||
// account: { | ||
// type: 'connected-random', | ||
// assetBalances: { | ||
// ETH: 1, | ||
// USDS: 10_000, | ||
// }, | ||
// }, | ||
// }) | ||
test.beforeEach(async ({ page }) => { | ||
const testContext = await setup(page, { | ||
blockchain: { | ||
blockNumber: BASE_DEFAULT_BLOCK_NUMBER, | ||
chainId: base.id, | ||
}, | ||
initialPage: 'savings', | ||
account: { | ||
type: 'connected-random', | ||
assetBalances: { | ||
ETH: 1, | ||
USDS: 10_000, | ||
}, | ||
}, | ||
}) | ||
|
||
// savingsPage = new SavingsPageObject(page) | ||
// await savingsPage.clickConvertStablesButtonAction() | ||
savingsPage = new SavingsPageObject(testContext) | ||
await savingsPage.clickConvertStablesButtonAction() | ||
|
||
// convertStablesDialog = new ConvertStablesDialogPageObject(page) | ||
// await convertStablesDialog.selectAssetInAction('USDS') | ||
// await convertStablesDialog.selectAssetOutAction('USDC') | ||
// await convertStablesDialog.fillAmountInAction(10_000) | ||
// }) | ||
convertStablesDialog = new ConvertStablesDialogPageObject(testContext) | ||
await convertStablesDialog.selectAssetInAction('USDS') | ||
await convertStablesDialog.selectAssetOutAction('USDC') | ||
await convertStablesDialog.fillAmountInAction(10_000) | ||
}) | ||
|
||
// test('uses psm convert action', async () => { | ||
// await convertStablesDialog.actionsContainer.expectEnabledActionAtIndex(0) | ||
// await convertStablesDialog.actionsContainer.expectActions([ | ||
// { type: 'approve', asset: 'USDS' }, | ||
// { type: 'psmConvert', inToken: 'USDS', outToken: 'USDC' }, | ||
// ]) | ||
// }) | ||
test('uses psm convert action', async () => { | ||
await convertStablesDialog.actionsContainer.expectEnabledActionAtIndex(0) | ||
await convertStablesDialog.actionsContainer.expectActions([ | ||
{ type: 'approve', asset: 'USDS' }, | ||
{ type: 'psmConvert', inToken: 'USDS', outToken: 'USDC' }, | ||
]) | ||
}) | ||
|
||
// test('displays transaction overview', async () => { | ||
// await convertStablesDialog.expectTransactionOverview({ | ||
// routeItems: [ | ||
// { | ||
// tokenAmount: '10,000.00 USDS', | ||
// tokenUsdValue: '$10,000.00', | ||
// }, | ||
// { | ||
// tokenAmount: '10,000.00 USDC', | ||
// tokenUsdValue: '$10,000.00', | ||
// }, | ||
// ], | ||
// outcome: '10,000.00 USDC', | ||
// outcomeUsd: '$10,000.00', | ||
// }) | ||
// }) | ||
test('displays transaction overview', async () => { | ||
await convertStablesDialog.expectTransactionOverview({ | ||
routeItems: [ | ||
{ | ||
tokenAmount: '10,000.00 USDS', | ||
tokenUsdValue: '$10,000.00', | ||
}, | ||
{ | ||
tokenAmount: '10,000.00 USDC', | ||
tokenUsdValue: '$10,000.00', | ||
}, | ||
], | ||
outcome: '10,000.00 USDC', | ||
outcomeUsd: '$10,000.00', | ||
}) | ||
}) | ||
|
||
// test('executes conversion', async () => { | ||
// await convertStablesDialog.actionsContainer.acceptAllActionsAction(2) | ||
// await convertStablesDialog.expectSuccessPage() | ||
// await convertStablesDialog.clickBackToSavingsButton() | ||
// await savingsPage.expectStablecoinsInWalletAssetBalance('USDS', '-') | ||
// await savingsPage.expectStablecoinsInWalletAssetBalance('USDC', '10,000.00') | ||
// }) | ||
// }) | ||
test('executes conversion', async () => { | ||
await convertStablesDialog.actionsContainer.acceptAllActionsAction(2) | ||
await convertStablesDialog.expectSuccessPage() | ||
await convertStablesDialog.clickBackToSavingsButton() | ||
await savingsPage.expectStablecoinsInWalletAssetBalance('USDS', '-') | ||
await savingsPage.expectStablecoinsInWalletAssetBalance('USDC', '10,000.00') | ||
}) | ||
}) |
122 changes: 62 additions & 60 deletions
122
packages/app/src/features/dialogs/convert-stables/e2e/mainnet/DaiToUsdc.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 |
---|---|---|
@@ -1,67 +1,69 @@ | ||
// import { SavingsPageObject } from '@/pages/Savings.PageObject' | ||
// import { DEFAULT_BLOCK_NUMBER } from '@/test/e2e/constants' | ||
// import { setupFork } from '@/test/e2e/forking/setupFork' | ||
// import { setup } from '@/test/e2e/setup' | ||
// import { test } from '@playwright/test' | ||
// import { mainnet } from 'viem/chains' | ||
// import { ConvertStablesDialogPageObject } from '../../ConvertStablesDialog.PageObject' | ||
import { SavingsPageObject } from '@/pages/Savings.PageObject' | ||
import { DEFAULT_BLOCK_NUMBER } from '@/test/e2e/constants' | ||
import { setup } from '@/test/e2e/setup' | ||
import { test } from '@playwright/test' | ||
import { mainnet } from 'viem/chains' | ||
import { ConvertStablesDialogPageObject } from '../../ConvertStablesDialog.PageObject' | ||
|
||
// test.describe('Convert DAI to USDC', () => { | ||
// const fork = setupFork({ blockNumber: DEFAULT_BLOCK_NUMBER, chainId: mainnet.id, useTenderlyVnet: true }) | ||
// let savingsPage: SavingsPageObject | ||
// let convertStablesDialog: ConvertStablesDialogPageObject | ||
test.describe('Convert DAI to USDC', () => { | ||
let savingsPage: SavingsPageObject | ||
let convertStablesDialog: ConvertStablesDialogPageObject | ||
|
||
// test.beforeEach(async ({ page }) => { | ||
// await setup(page, fork, { | ||
// initialPage: 'savings', | ||
// account: { | ||
// type: 'connected-random', | ||
// assetBalances: { | ||
// ETH: 1, | ||
// DAI: 10_000, | ||
// }, | ||
// }, | ||
// }) | ||
test.beforeEach(async ({ page }) => { | ||
const testContext = await setup(page, { | ||
blockchain: { | ||
blockNumber: DEFAULT_BLOCK_NUMBER, | ||
chainId: mainnet.id, | ||
}, | ||
initialPage: 'savings', | ||
account: { | ||
type: 'connected-random', | ||
assetBalances: { | ||
ETH: 1, | ||
DAI: 10_000, | ||
}, | ||
}, | ||
}) | ||
|
||
// savingsPage = new SavingsPageObject(page) | ||
// await savingsPage.clickConvertStablesButtonAction() | ||
savingsPage = new SavingsPageObject(testContext) | ||
await savingsPage.clickConvertStablesButtonAction() | ||
|
||
// convertStablesDialog = new ConvertStablesDialogPageObject(page) | ||
// await convertStablesDialog.selectAssetInAction('DAI') | ||
// await convertStablesDialog.selectAssetOutAction('USDC') | ||
// await convertStablesDialog.fillAmountInAction(10_000) | ||
// }) | ||
convertStablesDialog = new ConvertStablesDialogPageObject(testContext) | ||
await convertStablesDialog.selectAssetInAction('DAI') | ||
await convertStablesDialog.selectAssetOutAction('USDC') | ||
await convertStablesDialog.fillAmountInAction(10_000) | ||
}) | ||
|
||
// test('uses psm convert action', async () => { | ||
// await convertStablesDialog.actionsContainer.expectEnabledActionAtIndex(0) | ||
// await convertStablesDialog.actionsContainer.expectActions([ | ||
// { type: 'approve', asset: 'DAI' }, | ||
// { type: 'psmConvert', inToken: 'DAI', outToken: 'USDC' }, | ||
// ]) | ||
// }) | ||
test('uses psm convert action', async () => { | ||
await convertStablesDialog.actionsContainer.expectEnabledActionAtIndex(0) | ||
await convertStablesDialog.actionsContainer.expectActions([ | ||
{ type: 'approve', asset: 'DAI' }, | ||
{ type: 'psmConvert', inToken: 'DAI', outToken: 'USDC' }, | ||
]) | ||
}) | ||
|
||
// test('displays transaction overview', async () => { | ||
// await convertStablesDialog.expectTransactionOverview({ | ||
// routeItems: [ | ||
// { | ||
// tokenAmount: '10,000.00 DAI', | ||
// tokenUsdValue: '$10,000.00', | ||
// }, | ||
// { | ||
// tokenAmount: '10,000.00 USDC', | ||
// tokenUsdValue: '$10,000.00', | ||
// }, | ||
// ], | ||
// outcome: '10,000.00 USDC', | ||
// outcomeUsd: '$10,000.00', | ||
// }) | ||
// }) | ||
test('displays transaction overview', async () => { | ||
await convertStablesDialog.expectTransactionOverview({ | ||
routeItems: [ | ||
{ | ||
tokenAmount: '10,000.00 DAI', | ||
tokenUsdValue: '$10,000.00', | ||
}, | ||
{ | ||
tokenAmount: '10,000.00 USDC', | ||
tokenUsdValue: '$10,000.00', | ||
}, | ||
], | ||
outcome: '10,000.00 USDC', | ||
outcomeUsd: '$10,000.00', | ||
}) | ||
}) | ||
|
||
// test('executes conversion', async () => { | ||
// await convertStablesDialog.actionsContainer.acceptAllActionsAction(2) | ||
// await convertStablesDialog.expectSuccessPage() | ||
// await convertStablesDialog.clickBackToSavingsButton() | ||
// await savingsPage.expectStablecoinsInWalletAssetBalance('DAI', '-') | ||
// await savingsPage.expectStablecoinsInWalletAssetBalance('USDC', '10,000.00') | ||
// }) | ||
// }) | ||
test('executes conversion', async () => { | ||
await convertStablesDialog.actionsContainer.acceptAllActionsAction(2) | ||
await convertStablesDialog.expectSuccessPage() | ||
await convertStablesDialog.clickBackToSavingsButton() | ||
await savingsPage.expectStablecoinsInWalletAssetBalance('DAI', '-') | ||
await savingsPage.expectStablecoinsInWalletAssetBalance('USDC', '10,000.00') | ||
}) | ||
}) |
Oops, something went wrong.