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 --- tests/tst_smoke.qml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/tst_smoke.qml (limited to 'tests/tst_smoke.qml') diff --git a/tests/tst_smoke.qml b/tests/tst_smoke.qml new file mode 100644 index 0000000..19904a6 --- /dev/null +++ b/tests/tst_smoke.qml @@ -0,0 +1,28 @@ +import QtQuick 2.3 +import QtTest 1.0 + + +TestCase { + name: "SmokeTests" + + property var ctx + + function refresh() { + ctx = JSON.parse(helper.refreshContext()) + } + + function test_helper() { + compare(Boolean(helper), true, "does helper exist?") + } + + function test_model() { + compare(Boolean(jsonModel), true, "does model exist?") + } + + function test_loadCtx() { + refresh() + compare(ctx.appName, "RiseupVPN", "can read appName?") + compare(ctx.tosURL, "https://riseup.net/tos", "can read tosURL?") + compare(ctx.status, "off", "is initial status off?") + } +} -- cgit v1.2.3