mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
feat(spec): merchant-ledger property + login/navigation generators
Property ledgerBalanceMatchesTxns asserts displayed balance equals sum(Given) - sum(Received) on either ledger screen. Catches the class of bug where the server-fed CustomerModel.balance diverges from the local-DB-fed CoreDatabaseDao sums (stale cache, partial sync, deleted-txn handling glitch, etc.). Generators are gated by screen state and weighted to push the run through login -> home -> ledger quickly: enterPhone (100), enterOtp (100), openCustomerOrSupplier (80), taps (10), swipes (2). Phone/OTP read from process.env via esbuild defines so credentials never land in source. cmd/internal-tools/bundle-check is a quick sanity tool to confirm the spec bundles before running uatu test.
This commit is contained in:
1 parent
7aa75f3d9f
commit
4dbad9073e
2 files changed
+130
No files matched your search
@@ -0,0 +1,34 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/priyanshujain/uatu/internal/bundler"
|
||||
)
|
||||
|
||||
func main() {
|
||||
repoRoot, err := os.Getwd()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "getwd: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
specApiPath := filepath.Join(repoRoot, "pkg/spec-api/src/index.ts")
|
||||
|
||||
result, err := bundler.Bundle(bundler.Options{
|
||||
EntryFile: "examples/specs/merchant-ledger.ts",
|
||||
Defines: map[string]string{
|
||||
"UATU_TEST_PHONE": "+910000000000",
|
||||
"UATU_TEST_OTP": "000000",
|
||||
},
|
||||
Aliases: map[string]string{
|
||||
"@uatu/spec": specApiPath,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "bundle: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Printf("bundled: %d bytes, sha256=%s\n", len(result.JavaScript), result.SHA256)
|
||||
}
|
||||
Reference in new issue
Block a user