فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
test(A04): surface actual Settings UI backup error without exposing synthetic password
davoodmehraban89 committed
Oct 16, 2026 at 19:06 UTC
d95df65f146c58af6cc810dc46e848e7a44b1da1
1 file changed
+10
-2
tests/windows-vm-encrypted-company-backup-browser.js
+10
-2
@@ -18,7 +18,13 @@
18
prompt: window.prompt, create: URL.createObjectURL,
19
revoke: URL.revokeObjectURL,
20
anchorClick: HTMLAnchorElement.prototype.click,
21
- timeout: window.setTimeout
21
+ timeout: window.setTimeout,
22
+ toastError: FINORA.Toast.error
23
+ };
24
+ const capturedErrors = [];
25
+ FINORA.Toast.error = function (message, ...args) {
26
+ capturedErrors.push(String(message).slice(0, 280));
27
+ return original.toastError.call(this, message, ...args);
28
};
29
let exportedBlob = null;
30
let downloadedName = null;
@@ -53,7 +59,8 @@
59
60
await window.SettingsView.downloadBackup();
61
if (!(exportedBlob instanceof Blob)) {
56
- throw Error('Actual SettingsView.downloadBackup did not create a Blob');
62
+ throw Error('Actual SettingsView.downloadBackup did not create a Blob: ' +
63
+ capturedErrors.join(' | '));
64
}
65
const encryptedText = await exportedBlob.text();
66
const envelope = JSON.parse(encryptedText);
@@ -103,5 +110,6 @@
110
URL.revokeObjectURL = original.revoke;
111
HTMLAnchorElement.prototype.click = original.anchorClick;
112
window.setTimeout = original.timeout;
113
+ FINORA.Toast.error = original.toastError;
114
}
115
})()
\ No newline at end of file