fix(sample-app): address PR #18 review findings (#19)

- WebLedgerStore.accountExistsByName case-insensitive (matches SQL COLLATE NOCASE)
- drop SampleApplication.maybeInjectDebugError; sample spec now passes clean
- drop noLogcatErrors from sample spec (default matches system-wide E logs)
- openRandomAccount picks uniformly from findAll instead of first match
- clear txnError on any add-transaction interaction, not only valid amount input
- escapeForAdbInputText quotes shell metacharacters (quotes, backslash, etc.)
- extract buildClearKeyevents helper with empty/normal/cap tests
- broaden spec_integration_test.go to cover home, add-account, ledger,
  add-transaction action generators
- document FocusTracker single-focus invariant
This commit is contained in:
pj authored and GitHub committed 2026-04-20 13:31:50 +07:00
1 parent 8381a98aaf
commit c1de4bf57a
8 files changed
+284 -26

No files matched your search

+8 -5
View File
@@ -14,7 +14,7 @@ import {
waitOnce,
weighted,
} from "@uatu/spec";
import { noLogcatErrors, noUncaughtExceptions } from "@uatu/spec/defaults/properties";
import { noUncaughtExceptions } from "@uatu/spec/defaults/properties";
interface AccountSnapshot {
id: string;
@@ -90,7 +90,9 @@ const txnCredit = extract((state) => state.ax.find("desc:txn_credit"));
const txnDebit = extract((state) => state.ax.find("desc:txn_debit"));
const txnSubmit = extract((state) => state.ax.find("desc:txn_submit"));
const backButton = extract((state) => state.ax.find("desc:Back"));
const anyAccountCard = extract((state) => state.ax.find("descPrefix:account_card:"));
const allAccountCards = extract((state) =>
state.ax.findAll("descPrefix:account_card:"),
);
const accountCountNonNegative = always(() => accountCount.current >= 0);
@@ -334,8 +336,10 @@ const openAddAccount = actions(() => {
const openRandomAccount = actions(() => {
if (route.current !== "home") return [];
const card = anyAccountCard.current;
return card ? [Tap({ on: card })] : [];
const cards = allAccountCards.current;
if (cards.length === 0) return [];
const card = cards[Math.floor(Math.random() * cards.length)];
return [Tap({ on: card })];
});
const logoutAction = actions(() => {
@@ -411,7 +415,6 @@ export const properties = {
...stateMachine,
...liveness,
noUncaughtExceptions,
noLogcatErrors,
};
export const actionsRoot = weighted(