From cdb42f0d6b47a60ceb647e3ac6a6ce66352dbae4 Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Thu, 18 Jun 2020 20:42:29 +0200 Subject: [test] minimal qml tests just a minimal boilerplate. the idea is to import the qml files and assert that the states/widgets change accordingly if we mock the backend status. - Closes: #300 --- gui/backend.go | 11 ++++++++++- gui/qml/main.qml | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'gui') diff --git a/gui/backend.go b/gui/backend.go index f7816ee..4a73cc2 100644 --- a/gui/backend.go +++ b/gui/backend.go @@ -44,7 +44,16 @@ func SubscribeToEvent(event string, f unsafe.Pointer) { //export InitializeBitmaskContext func InitializeBitmaskContext() { - backend.InitializeBitmaskContext() + opts := &backend.InitOpts{} + backend.InitializeBitmaskContext(opts) +} + +//export InitializeTestBitmaskContext +func InitializeTestBitmaskContext() { + opts := &backend.InitOpts{} + opts.SkipLaunch = true + backend.InitializeBitmaskContext(opts) + backend.EnableMockBackend() } //export RefreshContext diff --git a/gui/qml/main.qml b/gui/qml/main.qml index efe0111..4aab7f1 100644 --- a/gui/qml/main.qml +++ b/gui/qml/main.qml @@ -9,7 +9,7 @@ ApplicationWindow { id: app visible: false - property var ctx + property var ctx Connections { target: jsonModel -- cgit v1.2.3