From 89e36b4b0d1b9482c17375f0f69f5dd1c1f9b3fb Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 21 Dec 2017 19:08:18 +0100 Subject: Verify the newMailButton receives focus initially --- components/kube/qml/ComposerView.qml | 1 + components/kube/tests/tst_composerview.qml | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/components/kube/qml/ComposerView.qml b/components/kube/qml/ComposerView.qml index 2e0267d5..9119de27 100644 --- a/components/kube/qml/ComposerView.qml +++ b/components/kube/qml/ComposerView.qml @@ -106,6 +106,7 @@ Kube.View { spacing: Kube.Units.largeSpacing Kube.PositiveButton { + objectName: "newMailButton" anchors { left: parent.left right: parent.right diff --git a/components/kube/tests/tst_composerview.qml b/components/kube/tests/tst_composerview.qml index 81ad5eaa..52475721 100644 --- a/components/kube/tests/tst_composerview.qml +++ b/components/kube/tests/tst_composerview.qml @@ -26,12 +26,20 @@ TestCase { width: 400 height: 400 name: "ComposerView" + when: windowShown ComposerView { id: composer + focus: true } function test_start() { verify(composer) } + + function test_verifyInitialFocus() { + var newMailButton = findChild(composer, "newMailButton"); + verify(newMailButton) + verify(newMailButton.activeFocus) + } } -- cgit v1.2.3