elements
elements copied to clipboard
Investigate the possibility of testing elements
Testing GUIs is tricky. but nevertheless, I don't feel good without tests. Right now, I have to build the examples and inspect each one of them to make sure everything is good.
At the very least, a quick testing facility is probably something like:
- Saving the view to a PNG
- Comparing the PNGs to known 'golden' files and reporting the diffs.
It might be possible to simulate user interaction, but that can probably be done later.
You might want to expose an interface that allows issuing events programatically. Eg issue a virtual click at some coordinates and verify that state changed accordingly. If rendering in well-separated from the logic it should be trivial to test correct behavior.