fix: the StateRecovery erase warning names every kind of wallet backup (closes #593)
The StateRecovery erase warning told every user to rely on each wallet's recovery phrase. A wallet imported from a private key or an extended private key has none; its backup is that key. The warning now names all three, in the words the delete-wallet screens use, and README's StateRecovery entry says what a wallet can be added again from. A test reads the warning. Model: opus-5-5
This commit was merged in pull request #680.
This commit is contained in:
@@ -23,6 +23,9 @@
|
||||
// version field, and showing those users a wipe prompt would be a worse defect
|
||||
// than the one being fixed. It is migrated in place and keeps working.
|
||||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const {
|
||||
bootPopup,
|
||||
cleanupPopup,
|
||||
@@ -148,6 +151,29 @@ describe("the destructive reset on the recovery screen", () => {
|
||||
});
|
||||
});
|
||||
|
||||
// A key or xprv wallet has no recovery phrase, so the erase warning names all
|
||||
// three backups (https://git.eeqj.de/sneak/AutistMask/issues/593). The boot
|
||||
// harness holds no static text, so this reads the markup itself.
|
||||
describe("the erase warning on the recovery screen", () => {
|
||||
test("names the recovery phrase, the private key and the extended private key", () => {
|
||||
const html = fs.readFileSync(
|
||||
path.join(__dirname, "..", "src", "popup", "index.html"),
|
||||
"utf8",
|
||||
);
|
||||
const start = html.indexOf('id="view-state-recovery"');
|
||||
const end = html.indexOf('id="btn-state-recovery-reset"', start);
|
||||
const screenText = html
|
||||
.slice(start, end)
|
||||
.replace(/<[^>]*>/g, " ")
|
||||
.replace(/\s+/g, " ");
|
||||
|
||||
expect(screenText).toContain(
|
||||
"If you kept a copy of a wallet's recovery phrase, private key or " +
|
||||
"extended private key, you can add that wallet again.",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("a popup already open when the stored profile becomes unreadable", () => {
|
||||
// https://git.eeqj.de/sneak/AutistMask/issues/373. The popup used to stay
|
||||
// on the wallet list with the last good balances, and only a reopen
|
||||
|
||||
Reference in New Issue
Block a user