test(sweep): add capture surfaces for the Wave-2 fund/secret modals
Register sweep surfaces for the redesigned Wave-2 modals so they get captured for visual review: modal-shield + modal-merge (ShieldDialog's two modes), modal-transfer (a z->t transfer so the converted deshielding DialogWarningHeader renders), and modal-key-export (KeyExportDialog — named distinctly from the settings modal-export-key). Each setup opens the dialog through its public show() without clicking any button, so no async RPC fires; teardown closes it. Adds a static hide() to ShieldDialog and KeyExportDialog for clean sweep teardown (AddressTransferDialog already had close()). KeyExportDialog::hide() also clears the revealed key + frees its QR, mirroring the dialog's own close/dismiss secret-wipe. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,9 @@
|
||||
#include "ui/windows/request_payment_dialog.h"
|
||||
#include "ui/windows/validate_address_dialog.h"
|
||||
#include "ui/windows/address_label_dialog.h"
|
||||
#include "ui/windows/shield_dialog.h"
|
||||
#include "ui/windows/address_transfer_dialog.h"
|
||||
#include "ui/windows/key_export_dialog.h"
|
||||
#include "ui/pages/settings_page.h"
|
||||
#include "util/platform.h"
|
||||
#include "wallet/wallet_capabilities.h"
|
||||
@@ -347,6 +350,29 @@ void App::buildSweepCatalog()
|
||||
add("modal-antivirus", ui::NavPage::Mining,
|
||||
[](App& a) { a.pending_antivirus_dialog_ = true; },
|
||||
[](App& a) { a.pending_antivirus_dialog_ = false; });
|
||||
// Wave-2 fund/secret dialogs (setup never fires the async RPC — no button is clicked).
|
||||
add("modal-shield", ui::NavPage::Send,
|
||||
[](App&) { ui::ShieldDialog::showShieldCoinbase(); },
|
||||
[](App&) { ui::ShieldDialog::hide(); });
|
||||
add("modal-merge", ui::NavPage::Send,
|
||||
[](App&) { ui::ShieldDialog::showMerge(); },
|
||||
[](App&) { ui::ShieldDialog::hide(); });
|
||||
// z->t transfer so the (converted) deshielding DialogWarningHeader renders.
|
||||
add("modal-transfer", ui::NavPage::Overview,
|
||||
[](App& a) {
|
||||
ui::AddressTransferInfo info;
|
||||
info.fromAddr = kDemoZAddr;
|
||||
info.toAddr = "t1DemoTransparentReceiveAddress00000";
|
||||
info.fromBalance = 12.5; info.toBalance = 3.0;
|
||||
info.fromIsZ = true; info.toIsZ = false;
|
||||
ui::AddressTransferDialog::show(&a, info);
|
||||
},
|
||||
[](App&) { ui::AddressTransferDialog::close(); });
|
||||
// Distinct from the settings "modal-export-key" (App::renderExportKeyDialog) — this is the
|
||||
// per-address KeyExportDialog opened from Overview address rows.
|
||||
add("modal-key-export", ui::NavPage::Overview,
|
||||
[](App&) { ui::KeyExportDialog::show(kDemoZAddr, ui::KeyExportDialog::KeyType::Private); },
|
||||
[](App&) { ui::KeyExportDialog::hide(); });
|
||||
add("modal-about", ui::NavPage::Overview,
|
||||
[](App& a) { a.show_about_ = true; }, [](App& a) { a.show_about_ = false; });
|
||||
add("modal-settings", ui::NavPage::Settings,
|
||||
|
||||
Reference in New Issue
Block a user