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.

Pick-to: 6.4 6.5
Change-Id: I803db9664ad46a83dbe6b47c53448530c30d6150
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This commit is contained in:
Doris Verria 2023-02-02 18:32:47 +01:00
parent f69b6f0940
commit 4a9be82a38
1 changed files with 4 additions and 0 deletions

View File

@ -127,6 +127,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)
@ -145,6 +147,7 @@ TestCase {
control.closePolicy = Popup.CloseOnReleaseOutside
control.open()
verify(control.visible)
openedSpy.wait()
mousePress(testCase, 1, 1)
compare(rejectedSpy.count, 3)
@ -300,6 +303,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)