Add test for status expandable item

This commit is contained in:
B.Melnik 2021-10-19 22:42:30 +03:00
parent bbca8abbb1
commit 428f57948c
No known key found for this signature in database
GPG Key ID: 4A9B2E42E3BD4727
3 changed files with 48 additions and 14 deletions

View File

@ -13,5 +13,6 @@
<file>base/WindowTestCase.qml</file>
<file>tst_chatinfotoolbar.qml</file>
<file>tst_statuslistitem.qml</file>
<file>tst_statusexpandableitem.qml</file>
</qresource>
</RCC>

View File

@ -0,0 +1,45 @@
import QtQuick 2.14
import QtTest 1.14
import "base"
import StatusQ.Components 0.1
WindowTestCase {
name: "StatusExpandableItem test"
when: windowShown
StatusExpandableItem {
id: expandableItem
parent: windowContent
primaryText: "primary text"
secondaryText: "secondary text"
additionalText: "additional text"
expandable: true
expandableComponent: Rectangle {
width: 1000
height: 300
}
}
function initTestCase() {
window.show()
}
function cleanupTestCase() {
window.close()
}
function test_expand() {
verify(!expandableItem.expanded)
mouseClick(expandableItem, expandableItem.width / 2, expandableItem.height / 2, Qt.LeftButton)
verify(expandableItem.expanded)
wait(400) // transition duration
compare(expandableItem.height, 82 + 300 + 22)
}
}

View File

@ -6,21 +6,9 @@ DESTDIR += $${PWD}/bin
DEFINES += PROJECT_PATH=\"$${PWD}\"
DISTFILES += \
base/ChatsModelData.qml \
base/Helpers.qml \
base/LegacyModalsHelpers.qml \
base/ModalHelpers.qml \
base/ProfileModelData.qml \
base/WindowTestCase.qml \
tst_choose_chat_name_modal.qml \
tst_get_started_modal.qml \
tst_initialtest.qml \
tst_profile_popup.qml \
tst_statusButton.qml \
tst_statusChatInfoButton.qml
#DISTFILES += $$
DISTFILES += $$files("status-desktop/ui/*", true)
DISTFILES += $$files("$$PWD/*", true)
QML_IMPORT_PATH += status-desktop/ui/StatusQ/src