diff options
author | Doris Verria <doris.verria@qt.io> | 2023-02-02 18:32:47 +0100 |
---|---|---|
committer | Doris Verria <doris.verria@qt.io> | 2023-02-16 10:50:44 +0100 |
commit | db851d1f33e20fee7a17ed02f3f85e2981dd1c06 (patch) | |
tree | 7222e8bee122dfbbd87bbe1898723e2436a7888b | |
parent | 5001df10a10481cb93aac12b9350bd49a5d40e0f (diff) |
tst_dialog: Fix testing for implicitWidth and wait for enter transitions
- The Dialog’s implicitWidth is set to the max between the header’s,
footer’s, and background’s implicitWidth. So, when testing that the
dialog’s implicitWidth is equal to that of the header, we should first
make sure that the IW of the background and footer is smaller.
- Wait for all enter transitions to finish before assuming that the
dialog is opened.
Change-Id: I803db9664ad46a83dbe6b47c53448530c30d6150
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 4a9be82a382b58155949ad4ec75e8ce4e12c47e6)
-rw-r--r-- | tests/auto/quickcontrols2/controls/data/tst_dialog.qml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/quickcontrols2/controls/data/tst_dialog.qml b/tests/auto/quickcontrols2/controls/data/tst_dialog.qml index 6aa9d39af0..821c7999e0 100644 --- a/tests/auto/quickcontrols2/controls/data/tst_dialog.qml +++ b/tests/auto/quickcontrols2/controls/data/tst_dialog.qml @@ -125,6 +125,8 @@ TestCase { control.closePolicy = Popup.CloseOnPressOutside control.open() verify(control.visible) + // wait for enter transitions to finish + openedSpy.wait() mousePress(testCase, 1, 1) compare(rejectedSpy.count, 3) @@ -143,6 +145,7 @@ TestCase { control.closePolicy = Popup.CloseOnReleaseOutside control.open() verify(control.visible) + openedSpy.wait() mousePress(testCase, 1, 1) compare(rejectedSpy.count, 3) @@ -298,6 +301,7 @@ TestCase { compare(control.implicitHeight, control.contentItem.implicitHeight + control.topPadding + control.bottomPadding + control.header.implicitHeight + control.footer.implicitHeight) + control.footer.implicitWidth = 0 control.header.implicitWidth = 150 compare(control.implicitWidth, control.header.implicitWidth) |