-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add 24 word mnemonic phrase to recover-account #1070
Changes from 16 commits
36411d4
161960e
d809a9b
9d53ea6
d67324c
a86b563
9446eeb
4e7268a
2d9825e
8416b0c
05e4e31
4512d11
9b438a5
e1f47db
ac2acfc
d515d53
05fd56a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = (path, options) => | ||
options.defaultResolver(path, { | ||
...options, | ||
// Use packageFilter to process parsed `package.json` before the resolution (see https://www.npmjs.com/package/resolve#resolveid-opts-cb) | ||
packageFilter: (pkg) => { | ||
if (pkg.name === "@stellar/design-system") { | ||
return { | ||
...pkg, | ||
// Alter the value of `main` before resolving the package | ||
main: pkg.module || pkg.main, | ||
}; | ||
} | ||
|
||
return { | ||
...pkg, | ||
}; | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ test("Create new wallet", async ({ page }) => { | |
await expect(page).toHaveScreenshot("wallet-create-complete-page.png"); | ||
}); | ||
|
||
test("Import wallet", async ({ page }) => { | ||
test("Import 12 word wallet", async ({ page }) => { | ||
await expect(page).toHaveScreenshot("welcome-page.png"); | ||
await page.getByText("Import Wallet").click(); | ||
await expect( | ||
|
@@ -89,6 +89,57 @@ test("Import wallet", async ({ page }) => { | |
await expect(page).toHaveScreenshot("wallet-import-complete-page.png"); | ||
}); | ||
|
||
test("Import 24 word wallet", async ({ page }) => { | ||
await expect(page).toHaveScreenshot("welcome-page.png"); | ||
await page.getByText("Import Wallet").click(); | ||
await expect( | ||
page.getByText("Import wallet from recovery phrase"), | ||
).toBeVisible(); | ||
await page.locator(".RecoverAccount__phrase-toggle > label").click(); | ||
|
||
// time out to accomodate animation | ||
await page.waitForTimeout(150); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this probably works well enough but wanted to point out that there is also There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, nice! That's much better. I was not psyched about doing this, but couldn't get it to work reliably otherwise |
||
|
||
const TEST_WORDS = [ | ||
"shrug", | ||
"absent", | ||
"sausage", | ||
"later", | ||
"salute", | ||
"mesh", | ||
"increase", | ||
"flavor", | ||
"pilot", | ||
"patch", | ||
"pole", | ||
"twenty", | ||
"chef", | ||
"coffee", | ||
"faint", | ||
"apology", | ||
"crucial", | ||
"scene", | ||
"attend", | ||
"replace", | ||
"wolf", | ||
"error", | ||
"swift", | ||
"device", | ||
]; | ||
|
||
for (let i = 1; i <= TEST_WORDS.length; i++) { | ||
await page.locator(`#MnemonicPhrase-${i}`).fill(TEST_WORDS[i - 1]); | ||
} | ||
|
||
await page.locator("#password-input").fill("My-password123"); | ||
await page.locator("#confirm-password-input").fill("My-password123"); | ||
await page.locator("#termsOfUse-input").check({ force: true }); | ||
await page.getByRole("button", { name: "Import" }).click(); | ||
|
||
await expect(page.getByText("Wallet created successfully!")).toBeVisible(); | ||
await expect(page).toHaveScreenshot("wallet-import-complete-page.png"); | ||
}); | ||
|
||
test("Import wallet with wrong password", async ({ page }) => { | ||
await expect(page).toHaveScreenshot("welcome-page.png"); | ||
await page.getByText("Import Wallet").click(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
position: fixed; | ||
top: 0; | ||
width: 100%; | ||
transition: opacity var(--anim-transition-default); | ||
transition: opacity var(--dropdown-animation); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. apparently this var doesn't exist in the repo anymore, so replacing it with this other animation timing var |
||
|
||
&--failed { | ||
opacity: 1; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,6 @@ | |
"extension", | ||
"@stellar/freighter-api" | ||
], | ||
"resolutions": { | ||
"**/terser-webpack-plugin": "^1.4.3" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Webpack 5 comes with a newer version of this included. This was causing an issue as this old version of Terser contained an outdated JS spec |
||
}, | ||
"scripts": { | ||
"setup": "yarn install && yarn allow-scripts", | ||
"build": "run-p --print-label build:freighter-api build:docs build:extension", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting use-case here:
Webpack/Rollup default to using the file listed under
module
in package.json, but Jest usesmain
. I set this up because I'd like Jest to use the same file path that Webpack will be using