-
-
Notifications
You must be signed in to change notification settings - Fork 650
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge migrations to a single tool (#4218)
* Move files around * Move more files * Add migration selector * Remove unused routes * Update nav icon * Add test * Fix TextSelector padding * Update copy slightly * Fix test * Use default param value * Auto select a default migration if possible * Add migration E2E
- Loading branch information
1 parent
e9b5c88
commit c50dc20
Showing
65 changed files
with
338 additions
and
281 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import BasePage from './base-page.po'; | ||
import { setupEthereumMock } from './ethereum-mock'; | ||
import { FIXTURE_HARDHAT_PRIVATE_KEY, PAGES } from './fixtures'; | ||
|
||
export default class MigrationPage extends BasePage { | ||
async navigateToPage() { | ||
this.navigateTo(PAGES.MIGRATE); | ||
} | ||
|
||
async waitPageLoaded(timeout) { | ||
await this.waitForPage(PAGES.MIGRATE, timeout); | ||
} | ||
|
||
async setupMock() { | ||
await setupEthereumMock(FIXTURE_HARDHAT_PRIVATE_KEY, 1); | ||
} | ||
} |
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,47 @@ | ||
import { getByTestId, queryAllByTestId, queryAllByText } from '@testing-library/testcafe'; | ||
|
||
import { injectLS } from './clientScripts'; | ||
import { FIXTURE_HARDHAT, FIXTURES_CONST, PAGES } from './fixtures'; | ||
import { resetFork, setupLEND } from './hardhat-utils'; | ||
import MigrationPage from './migration-page.po'; | ||
import { findByTKey } from './translation-utils'; | ||
|
||
const migrationPage = new MigrationPage(); | ||
|
||
fixture('Migration') | ||
.clientScripts({ content: injectLS(FIXTURE_HARDHAT) }) | ||
.page(PAGES.MIGRATE); | ||
|
||
test('can do a LEND migration', async (t) => { | ||
await resetFork(); | ||
await setupLEND(); | ||
await migrationPage.waitPageLoaded(); | ||
await migrationPage.setupMock(); | ||
|
||
await t.wait(FIXTURES_CONST.TIMEOUT); | ||
|
||
const button = await getByTestId('confirm-migrate'); | ||
await t.click(button); | ||
|
||
const approve = await queryAllByText(findByTKey('APPROVE_AAVE_TOKEN_MIGRATION')) | ||
.with({ | ||
timeout: FIXTURES_CONST.HARDHAT_TIMEOUT | ||
}) | ||
.nth(1); | ||
await t.expect(approve.exists).ok({ timeout: FIXTURES_CONST.HARDHAT_TIMEOUT }); | ||
await t.click(approve); | ||
|
||
await t.wait(FIXTURES_CONST.TIMEOUT); | ||
|
||
const send = await queryAllByText(findByTKey('CONFIRM_TRANSACTION')) | ||
.with({ | ||
timeout: FIXTURES_CONST.HARDHAT_TIMEOUT | ||
}) | ||
.nth(1); | ||
await t.expect(send.exists).ok({ timeout: FIXTURES_CONST.HARDHAT_TIMEOUT }); | ||
await t.click(send); | ||
|
||
await t | ||
.expect(queryAllByTestId('SUCCESS').with({ timeout: FIXTURES_CONST.HARDHAT_TIMEOUT }).count) | ||
.eql(2, { timeout: FIXTURES_CONST.HARDHAT_TIMEOUT }); | ||
}); |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.