testing: add a way to test individual QML components

This is a WIP and is intended to be adapted continuously to support more and more UI elements and reduce the time spent debugging components.

Some components will require additional configuration (e.g. the conversation ID must be set), which may require additional changes.

Change-Id: Iaa5d49693f874202439e746a274da4911adf7d15
This commit is contained in:
Andreas Traczyk
2024-02-01 19:06:01 -05:00
parent 97e477416a
commit ae53d92c2e
9 changed files with 188 additions and 52 deletions

View File

@@ -19,6 +19,8 @@ import QtQuick
import QtQuick.Controls
import QtTest
import net.jami.Adapters 1.1
import "../../../src/app/"
// The purpose of this component is to fake the ApplicationWindow and prevent
@@ -38,11 +40,23 @@ Item {
Component.onCompleted: viewCoordinator.init(this)
// These are our fake app management objects. The caveat is that they
// must be maintained in sync with the actual objects in the app for now.
// The benefit, is that this should be the single place where we need to
// sync them.
property int visibility: 0
Binding {
tw.visibility: uut.Window.window.visibility
when: QTestRootObject.windowShown
}
// WARNING: The following currently must be maintained in tandem with MainApplicationWindow.qml
// Used to manage full screen mode and save/restore window geometry.
property bool isRTL: UtilsAdapter.isRTL
LayoutMirroring.enabled: isRTL
LayoutMirroring.childrenInherit: isRTL
property LayoutManager layoutManager: LayoutManager {
appContainer: null
}
// Used to manage dynamic view loading and unloading.
property ViewManager viewManager: ViewManager {}
// Used to manage the view stack and the current view.
property ViewCoordinator viewCoordinator: ViewCoordinator {}
property QtObject appWindow: QtObject {
property bool useFrameless: false