diff options
Diffstat (limited to 'tests/auto/controls/data/tst_menuitem.qml')
-rw-r--r-- | tests/auto/controls/data/tst_menuitem.qml | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/tests/auto/controls/data/tst_menuitem.qml b/tests/auto/controls/data/tst_menuitem.qml index 8581a43f..be0c0652 100644 --- a/tests/auto/controls/data/tst_menuitem.qml +++ b/tests/auto/controls/data/tst_menuitem.qml @@ -40,7 +40,7 @@ import QtQuick 2.2 import QtTest 1.0 -import Qt.labs.controls 1.0 +import QtQuick.Controls 2.0 TestCase { id: testCase @@ -58,7 +58,37 @@ TestCase { function test_baseline() { var control = menuItem.createObject(testCase) verify(control) - compare(control.baselineOffset, control.label.y + control.label.baselineOffset) + compare(control.baselineOffset, control.contentItem.y + control.contentItem.baselineOffset) + control.destroy() + } + + function test_checkable() { + var control = menuItem.createObject(testCase) + verify(control) + verify(control.hasOwnProperty("checkable")) + verify(!control.checkable) + + mouseClick(control) + verify(!control.checked) + + control.checkable = true + mouseClick(control) + verify(control.checked) + + mouseClick(control) + verify(!control.checked) + + control.destroy() + } + + function test_highlighted() { + var control = menuItem.createObject(testCase) + verify(control) + verify(!control.highlighted) + + control.highlighted = true + verify(control.highlighted) + control.destroy() } } |