-
-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Disable 0x validation of swaps * Fix issue where account wouldn't be reset when too low base asset balance * Fix bug with expiry countdown * Potential solution with doing some of the gas estimation ourselves * Simplify base asset detection * Fix test * Fix an issue with the latest version of Ethers * Fix tests * Remove commented code * Remove console.log * Move network selection to state * Update copy * Scan tokens when swap finished * Move some logic from StoreProvider to a saga * Add test for new saga * Add test for overwriting existing tx * Add basic e2e test * Add test for reverse swap quotes * Add missing test * Move selectors to hooks * Fix typing issues with selectors
- Loading branch information
1 parent
0b5ba7e
commit 5e34ef4
Showing
27 changed files
with
387 additions
and
162 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,18 @@ | ||
import { Selector, t } from 'testcafe'; | ||
|
||
import BasePage from './base-page.po'; | ||
import { FIXTURE_SEND_AMOUNT, PAGES } from './fixtures'; | ||
|
||
export default class SwapPage extends BasePage { | ||
async navigateToPage() { | ||
this.navigateTo(PAGES.SWAP); | ||
} | ||
|
||
async waitPageLoaded(timeout) { | ||
await this.waitForPage(PAGES.SWAP, timeout); | ||
} | ||
|
||
async fillForm() { | ||
await t.typeText(Selector('input[name="swap-from"]').parent(), FIXTURE_SEND_AMOUNT); | ||
} | ||
} |
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,24 @@ | ||
import { getByText } from '@testing-library/testcafe'; | ||
|
||
import { injectLS } from './clientScripts'; | ||
import { FIXTURE_LOCALSTORAGE_WITH_ONE_ACC, FIXTURES_CONST, PAGES } from './fixtures'; | ||
import SwapPage from './swap-page.po'; | ||
import { findByTKey } from './translation-utils'; | ||
|
||
const swapPage = new SwapPage(); | ||
|
||
fixture('Swap') | ||
.clientScripts({ content: injectLS(FIXTURE_LOCALSTORAGE_WITH_ONE_ACC) }) | ||
.page(PAGES.SWAP); | ||
|
||
test('Can get swap quote', async (t) => { | ||
await swapPage.waitPageLoaded(); | ||
|
||
/* Fill out form */ | ||
await swapPage.fillForm(); | ||
await t.wait(FIXTURES_CONST.TIMEOUT); | ||
|
||
// Has received swap quote | ||
const quote = await getByText(findByTKey('YOUR_QUOTE')); | ||
await t.expect(quote).ok(); | ||
}); |
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
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
Oops, something went wrong.