diff options
Diffstat (limited to 'framework/qml/tests/tst_texteditor.qml')
-rw-r--r-- | framework/qml/tests/tst_texteditor.qml | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/framework/qml/tests/tst_texteditor.qml b/framework/qml/tests/tst_texteditor.qml new file mode 100644 index 00000000..21ebe642 --- /dev/null +++ b/framework/qml/tests/tst_texteditor.qml | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * Copyright 2017 Christian Mollekopf <mollekopf@kolabsystems.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU Library General Public License as | ||
6 | * published by the Free Software Foundation; either version 2, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU Library General Public License for more details | ||
13 | * | ||
14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | import QtQuick 2.7 | ||
21 | import QtTest 1.0 | ||
22 | import org.kube.framework 1.0 as Kube | ||
23 | |||
24 | |||
25 | TestCase { | ||
26 | id: testCase | ||
27 | width: 400 | ||
28 | height: 400 | ||
29 | name: "TextEditor" | ||
30 | |||
31 | Kube.TextEditor { | ||
32 | id: editor | ||
33 | initialText: "Foobar" | ||
34 | htmlEnabled: false | ||
35 | } | ||
36 | |||
37 | function test_1initialText() { | ||
38 | compare(editor.text, editor.initialText) | ||
39 | } | ||
40 | |||
41 | function test_2htmlConversion() { | ||
42 | editor.htmlEnabled = true | ||
43 | editor.htmlEnabled = false | ||
44 | compare(editor.text, editor.initialText) | ||
45 | } | ||
46 | } | ||