covered clicked signal

This commit is contained in:
Anastasiya S 2021-10-19 12:11:57 +03:00
parent 39fd4497db
commit c37a85c542
2 changed files with 65 additions and 1 deletions

View File

@ -0,0 +1,63 @@
import QtQuick 2.14
import QtQuick.Window 2.14
import QtTest 1.14
import "base"
import "status-desktop/ui/StatusQ/src/StatusQ/Controls" as DesktopControls
WindowTestCase {
name: "statusChatInfoButton"
when: windowShown
Helpers { id: helpers }
Component {
id: popupComponent
DesktopControls.StatusChatInfoButton {
id: statusChatInfoButton
}
}
SignalSpy {
id: statusChatInfoButtonClickedSpy
signalName: "clicked"
}
SignalSpy {
id: statusChatInfoButtonUnmuteSpy
signalName: "unmute"
}
SignalSpy {
id: pinnedMessagesClickedSpy
signalName: "pinnedMessagesCountClicked"
}
function initTestCase() {
window.show()
}
function cleanupTestCase() {
window.close()
}
function test_case1_statusChatInfoButton_clicked() {
var statusChatInfoButton = popupComponent.createObject(window)
statusChatInfoButton.title = "Status Chat Info Button"
wait(2000)
statusChatInfoButtonClickedSpy.target = statusChatInfoButton
compare(statusChatInfoButtonClickedSpy.count, 0)
mouseClick(statusChatInfoButton, 1, 1, Qt.LeftButton)
wait(2000)
compare(statusChatInfoButtonClickedSpy.count, 1, "Status Chat info button was not clicked")
statusChatInfoButton.destroy()
}
}

View File

@ -17,7 +17,8 @@ DISTFILES += \
tst_get_started_modal.qml \
tst_initialtest.qml \
tst_profile_popup.qml \
tst_statusButton.qml
tst_statusButton.qml \
tst_statusChatInfoButton.qml
DISTFILES += $$files("status-desktop/ui/*", true)