qml_tests launch all the tests related to the interface. The daemon and libclient SHOULD be trusted in this part, we do not want to test scenarios related to connectivity. Ideally, we should work on fake data to avoid depending on network events. This may be difficult sometimes and some tools may be missed because tests in this part are a work in progress. Here are some tools/principles to be able to quickly write tests.
### Mocking Data
Let's say I want to test the UI for an AccountComboBox depending on a list of accounts. Instead of creating accounts, we should create a fake list.
The easy way to do this is to serialize/unserialize a real AccountComboBox model. First, we need to get a serialized model:
Now, the developper can easily use it in a test. The best way is to add this data in a variable or a separated js file (cf https://doc.qt.io/qt-6/qtqml-documents-networktransparency.html). And use it in a test e.g.: