Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 235 days
Daniel Deterding (innovaphone) Monday, 15 March 2021, 12:59 PM in response to tsn
Re: Testing app UI
Sorry, there is no working example.

Basically you must fake calls of the update function, where you receive response messages (in the counter example).

Best way would be to write a separate controller object, which you can switch between live and test mode.
In test mode, the controller fakes responses e.g. by calling windows.setTimeout(function() {
update({"mt":"MsgResponse",...})
}, 1);

Like this you you'll get an async answer after 1ms.

So it is some work to get this running to be able to switch between online and offline usage of an app.

Greetings,
Daniel
← You can define your color theme preference here