aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quickcontrols/controls/data/tst_action.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quickcontrols/controls/data/tst_action.qml')
-rw-r--r--tests/auto/quickcontrols/controls/data/tst_action.qml30
1 files changed, 21 insertions, 9 deletions
diff --git a/tests/auto/quickcontrols/controls/data/tst_action.qml b/tests/auto/quickcontrols/controls/data/tst_action.qml
index 845a6507af..f2b7a8674d 100644
--- a/tests/auto/quickcontrols/controls/data/tst_action.qml
+++ b/tests/auto/quickcontrols/controls/data/tst_action.qml
@@ -1,5 +1,5 @@
// Copyright (C) 2017 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtTest
@@ -24,18 +24,20 @@ TestCase {
SignalSpy { }
}
- function test_empty() {
+ function init() {
failOnWarning(/.?/)
+ }
+ function test_empty() {
let control = createTemporaryObject(component, testCase)
verify(control)
}
function test_enabled() {
- var action = createTemporaryObject(component, testCase)
+ let action = createTemporaryObject(component, testCase)
verify(action)
- var spy = createTemporaryObject(signalSpy, testCase, {target: action, signalName: "triggered"})
+ let spy = createTemporaryObject(signalSpy, testCase, {target: action, signalName: "triggered"})
verify(spy.valid)
action.trigger()
@@ -53,24 +55,34 @@ TestCase {
Component {
id: buttonAndMenu
Item {
+ objectName: "container"
+
property alias button: button
property alias menu: menu
property alias menuItem: menuItem
property alias action: sharedAction
property var lastSource
+
Action {
id: sharedAction
+ objectName: "sharedAction"
text: "Shared"
shortcut: "Ctrl+B"
onTriggered: (source) => lastSource = source
}
Button {
id: button
+ objectName: "button"
action: sharedAction
+
Menu {
id: menu
+ objectName: "menu"
+ contentItem.objectName: "menuContentItem"
+
MenuItem {
id: menuItem
+ objectName: "menuItem"
action: sharedAction
}
}
@@ -79,7 +91,7 @@ TestCase {
}
function test_shared() {
- var container = createTemporaryObject(buttonAndMenu, testCase)
+ let container = createTemporaryObject(buttonAndMenu, testCase)
verify(container)
keyClick(Qt.Key_B, Qt.ControlModifier)
@@ -116,10 +128,10 @@ TestCase {
}
function test_repeater() {
- var container = createTemporaryObject(actionAndRepeater, testCase)
+ let container = createTemporaryObject(actionAndRepeater, testCase)
verify(container)
- var spy = signalSpy.createObject(container, {target: container.action, signalName: "triggered"})
+ let spy = signalSpy.createObject(container, {target: container.action, signalName: "triggered"})
verify(spy.valid)
keyClick(Qt.Key_A, Qt.ControlModifier)
@@ -150,7 +162,7 @@ TestCase {
}
function test_shortcutBinding() {
- var container = createTemporaryObject(shortcutBinding, testCase);
+ let container = createTemporaryObject(shortcutBinding, testCase);
verify(container)
compare(container.indirect.nativeText, container.direct.nativeText);
}
@@ -178,7 +190,7 @@ TestCase {
function test_shortcutCleanup() {
{
- var container = createTemporaryObject(shortcutCleanup, testCase);
+ let container = createTemporaryObject(shortcutCleanup, testCase);
verify(container)
container.action.shortcut = "Delete"
container.menu.open()