fix: the delete wallet screens name the wallet's own key material (closes #529)
DeleteWallet and DeleteWalletLostPassword told key and xprv wallets that their recovery phrase was the way back, but those wallets have none. Both screens now name the recovery phrase, the private key or the extended private key, according to the wallet's kind. The noun comes from keyMaterialName() in the popup view helpers, which DeleteAddress now uses too in place of its own two-way choice, so these three screens get it from one place. The lost-password screen's route-back sentence is reworded to fit all three kinds. Model: opus-5-5
This commit was merged in pull request #590.
This commit is contained in:
@@ -259,6 +259,36 @@ describe("reaching the screen", () => {
|
||||
});
|
||||
});
|
||||
|
||||
// Both screens tell the user what they need to get the wallet back, and a
|
||||
// key or xprv wallet has no recovery phrase: telling its owner to rely on
|
||||
// one sends them looking for words that do not exist
|
||||
// (https://git.eeqj.de/sneak/AutistMask/issues/529).
|
||||
describe("what the screens say the wallet's backup is", () => {
|
||||
test.each([
|
||||
["hd", "recovery phrase"],
|
||||
["key", "private key"],
|
||||
["xprv", "extended private key"],
|
||||
])(
|
||||
"a wallet of type %s is told about its %s",
|
||||
async (type, keyMaterial) => {
|
||||
const { deleteWallet, state } = load();
|
||||
state.wallets[1].type = type;
|
||||
|
||||
deleteWallet.show(1);
|
||||
expect(state.currentView).toBe("delete-wallet-confirm");
|
||||
expect(node("delete-wallet-key-material").textContent).toBe(
|
||||
keyMaterial,
|
||||
);
|
||||
|
||||
await click("btn-delete-wallet-lost-password");
|
||||
expect(state.currentView).toBe(VIEW);
|
||||
expect(node("delete-wallet-lost-key-material").textContent).toBe(
|
||||
keyMaterial,
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
describe("the typed confirmation", () => {
|
||||
test("a name that is not the wallet's deletes nothing", async () => {
|
||||
const { deleteWallet, state, storage } = load();
|
||||
|
||||
Reference in New Issue
Block a user