Files
slate32/test/settings_busy.lua
T
evan 7510bb38a5 feat(sdcard)!: move the card to /.lua and the shared Lua API
Apps live under /.lua/apps with data in /.lua/data, matching the runtime's
paths. ui.lua and hints.lua ship from the submodule through `make sdcard`
rather than a copy that drifts, so theme.lua and the firmware's own ui.lua
are gone.

App-visible changes: text takes a font role rather than a text size, the
theme palette names roles (color/background) instead of fg/bg, ticks are
timer.every, on_press is on_click, and centring is layout alignment now
that textAlign left the node contract.
2026-08-03 18:32:58 -04:00

26 lines
992 B
Lua

-- Run: lua test/settings_busy.lua
-- The scan and keyboard screens announce themselves before work that blocks the loop for
-- seconds. on_tick runs before draw in the same pass, so anything left for draw() to paint
-- appears only after the blocking call returns -- on a panel ui.screen() has already
-- cleared. These assert the announcement is built and painted by the tap itself.
--
-- Where the notice lands is layout: test/ui_layout_test.cpp asserts centring against the
-- same C++ the panel runs.
package.path = "sdcard/.lua/lib/?.lua;test/?.lua;" .. package.path
local device = require("fake_device").install()
dofile("sdcard/.lua/apps/Settings/main.lua")
init()
device.tap("WiFi")
local drawnBefore = device.drawn
device.tap("scan networks")
-- Built and drawn by the tap, with no draw() in between.
assert(device.labelled("scanning"), "the scan screen did not build its notice")
assert(device.drawn > drawnBefore, "the scan notice was left for the next draw()")
print("ok")