diff options
Diffstat (limited to 'source/app')
| -rw-r--r-- | source/app/Fixtures.mc | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/source/app/Fixtures.mc b/source/app/Fixtures.mc index 31d4021..463780c 100644 --- a/source/app/Fixtures.mc +++ b/source/app/Fixtures.mc @@ -1,5 +1,5 @@ // Author: cirakg & claude ai -// Summary: Debug-only fake entries (and, in UI tests, a fake import via the settings form); release builds get empty stubs. +// Summary: Debug-only fake entries (and, in UI tests, a fake import and filled-in forms via settings); release builds get empty stubs. // // All data is fabricated: the secrets are the RFC 4226/6238 test keys and the // names are made up. The UI-test build (source/util/TestMode.mc) wipes the @@ -67,9 +67,39 @@ module Fixtures { vault.lock(); if (TestMode.ON) { startImport(); + sendForms(vault); } } + // UI-test build: the other forms, filled in as the phone would (README + // 16, M7 end-to-end): Add OTP (a TOTP whose code the screenshot shows), + // Add code (a Code 128 card whose screenshot must decode) and Manage + // entry (Bank's group renamed: Bank is locked, so the change waits for + // the PIN, which the UI flow confirms from the menu). They are applied + // after the import, in README 10.3 order, so the new entries end the + // list. + function sendForms(vault as Vault) as Void { + Application.Properties.setValue("otpType", Entry.OTP_TOTP); + Application.Properties.setValue("otpIssuer", "Mailbox"); + Application.Properties.setValue("otpAccount", "fixture@example.com"); + Application.Properties.setValue("otpSecret", "JBSW Y3DP EHPK 3PXP"); // lint: allow-literal (the classic "Hello!" demo key) + Application.Properties.setValue("otpAlgorithm", Hashes.SHA1); + Application.Properties.setValue("otpDigits", 6); + Application.Properties.setValue("otpPeriod", 30); + Application.Properties.setValue("otpGroup", "Personal"); + Application.Properties.setValue("otpAdd", true); + Application.Properties.setValue("codeName", "Locker"); + Application.Properties.setValue("codeSymbology", Codes.CODE128); + Application.Properties.setValue("codePayload", "FAKE-0042"); + Application.Properties.setValue("codeGroup", "Personal"); + Application.Properties.setValue("codeAdd", true); + var ids = vault.ids(); + Application.Properties.setValue("mgId", ids[2]); // Bank + Application.Properties.setValue("mgAction", ManageAction.EDIT); + Application.Properties.setValue("mgGroup", "Money"); + Application.Properties.setValue("mgApply", true); + } + // UI-test build: an Aegis import of 100 entries through the settings // form, the same path as the phone: 97 new, one duplicate of GitHub, one // error and one skipped type. The results screen opens when it's done. |
