diff options
| author | cirakg <cirakg@cirakg.xyz> | 2026-10-20 18:36:54 +0200 |
|---|---|---|
| committer | cirakg <cirakg@cirakg.xyz> | 2026-10-20 18:36:54 +0200 |
| commit | 479d7ba2e843d5ea93979f2eed68f4d38d146c25 (patch) | |
| tree | 52b0bc58a7456e8675e977698db20e55515b7100 /source | |
| parent | 151bfda5d4c567ff909a61dc9c90bf8eece1db37 (diff) | |
test(settings): cover every form, symbology and Manage action; send the forms end to end in the UI flow
34 Monkey C tests (154 per device): validation messages, idempotency, the
queue, the About scan, "Encrypt names" and the properties contract. The
UI-test build fills in Add OTP, Add code and Manage like the phone; the flow
checks the new TOTP (309 848 at the frozen time), decodes the Code 128 card
and confirms the queued change to the locked entry with the PIN.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'source')
| -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. |
