23 lines
1004 B
Lua
23 lines
1004 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;lib/esp32-lua-api/lua/lib/?.lua;test/?.lua;" .. package.path
|
|
|
|
local device = require("fake_device").install()
|
|
|
|
device.start "sdcard/.lua/apps/Settings/Wifi/main.lua"
|
|
|
|
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"
|