Review fixes for the charging-case battery: - The case reports whether the glasses are docked. An empty caseInfo (the reply out of the case) now parses as "not docked, no level" instead of nothing, and undocking is reported even when the level and charge state are unchanged. TS keeps the last level but clears caseCharging while the glasses are out of the case. - The phone line shows the charging mark only while it is live: G2 and Case only with a link to the glasses (connected or charging), and Case only while docked. Levels stay as the last known ones. - The session-start case read waits until the layout is up, so a firmware that ignored it could no longer hold up the first frame. When the glasses are already charging at connect, the charging-mode read is the only one; the old duplicate read and its "late ACK" log are gone. - Case dedup state resets on every connect, as wearState does, so each session's read reaches TS. - caseCharging uses > 0 like the headset, and is normalized to 0/1. - iOS now feeds the reading into the shell battery state, and the assistant's describeState includes the case level. - The batteryLine accessors move above connectionStatusLabel's doc comment.
Tests
Faceclaw's pairing logic (app/g2/glasses-hardware-identity.ts,
ble-proximity.ts, even-advertisement.ts, pairing-candidates.ts,
glasses-artwork.ts) is written without NativeScript imports so it can run
under plain node. The tests here cover hardware-identity decoding, proximity
estimation, the advertisement parsers, and left↔right pair grouping.
Run with:
npm test
That compiles the pure modules with the project's TypeScript into
.test-build/ (git-ignored) and runs node --test tests/. No extra
dependencies are needed — the tests are plain .test.cjs files that use
node:test and node:assert.
The shared Kotlin suite runs separately from the Node tests:
npm run test:kotlin
npm run test:kotlin:ios
It includes the migrated compass, R1 battery, gesture and texture Java fixtures, which now call the Kotlin implementation from Android host tests. Common tests also run as native iOS simulator binaries. See the Kotlin README for SDK requirements, source layout and coverage. The compass and battery fixtures retain the golden packets shared with firmware tests.
The native iOS EvenHub probe runs separately on a booted simulator:
node tests/ios-evenhub-native.cjs <simulator-UUID>
It compiles the production WKWebView host into an isolated app and checks local and remote loading, document-start injection, assets, storage and navigation. It then opens Safari to background the probe and verifies that injected timeouts, intervals and animation callbacks still fire, and cancelled timers stay cancelled. A short UIKit background task keeps the test process running without glasses. This covers the ticker's background behavior; sustained execution with BLE and a locked physical phone still requires device testing.
The native Android EvenHub probe runs on a booted emulator or attached device:
node tests/android-evenhub-native.cjs [adb-serial]
It compiles the production EvenHub WebView classes into an isolated APK (with the
Kotlin compiler and AndroidX artifacts a prior ./build.sh cached), installs it,
and checks per-package WebView profiles, that the bridge reaches only the app's
own main frame (not its iframes or pages it navigates to), that host scripts and
timer ticks stay out of other sites, and that a renderer crash leaves the process
running.