Update signals and objectNames usage

This commit is contained in:
B.Melnik 2021-10-15 11:10:55 +03:00
parent 6203df4da0
commit 1523b96702
No known key found for this signature in database
GPG Key ID: 4A9B2E42E3BD4727
2 changed files with 11 additions and 11 deletions

View File

@ -31,7 +31,7 @@ WindowTestCase {
// Catching editClickedSignal // Catching editClickedSignal
SignalSpy { SignalSpy {
id: editClickedSpy id: editClickedSpy
signalName: "editAvatarButtonClicked" signalName: "headerImageClicked"
} }
/////// ///////
@ -54,7 +54,7 @@ WindowTestCase {
propfilePopup.destroy() propfilePopup.destroy()
} }
function test_case2CurrentUser() { function test_case2_current_user() {
profileModel.profile.pubKey = "current-user" profileModel.profile.pubKey = "current-user"
var propfilePopup = popupComponent.createObject(window) var propfilePopup = popupComponent.createObject(window)
wait(2000) wait(2000)
@ -62,9 +62,9 @@ WindowTestCase {
editClickedSpy.target = propfilePopup editClickedSpy.target = propfilePopup
verify(propfilePopup.isCurrentUser, "User should be current") verify(propfilePopup.isCurrentUser, "User should be current")
wait(5000) wait(5000)
var editbButton = helpers.getObjectByObjectName(propfilePopup.background, "editAvatarButton") var editbButton = helpers.getObjectByObjectName(propfilePopup.background, "editAvatarImage")
verify(!!editbButton, "object with name \"editAvatarButton\" not found") verify(!!editbButton, "object with name \"editAvatarImage\" not found")
verify(editbButton.visible, "editAvatarButton should be visible") verify(editbButton.visible, "editAvatarImage should be visible")
compare(editClickedSpy.count, 0) compare(editClickedSpy.count, 0)
mouseClick(editbButton, 1, 1, Qt.LeftButton) mouseClick(editbButton, 1, 1, Qt.LeftButton)
@ -73,16 +73,16 @@ WindowTestCase {
propfilePopup.destroy() propfilePopup.destroy()
} }
function test_case3NotCurrentUser() { function test_case3_not_current_user() {
profileModel.profile.pubKey = "another-user" profileModel.profile.pubKey = "another-user"
var propfilePopup = popupComponent.createObject(window) var propfilePopup = popupComponent.createObject(window)
wait(2000) wait(2000)
propfilePopup.openPopup(true, "Test user", "current-user", "", "bla bla test it bitch", "Nickname") propfilePopup.openPopup(true, "Test user", "current-user", "", "bla bla test it bitch", "Nickname")
wait(5000) wait(5000)
verify(!propfilePopup.isCurrentUser, "User should be is not current") verify(!propfilePopup.isCurrentUser, "User should be is not current")
var editbButton = helpers.getObjectByObjectName(propfilePopup.background, "editAvatarButton") var editbButton = helpers.getObjectByObjectName(propfilePopup.background, "editAvatarImage")
verify(!!editbButton, "object with name \"editAvatarButton\" not found") verify(!!editbButton, "object with name \"editAvatarImage\" not found")
verify(!editbButton.visible, "editAvatarButton should be not visible") verify(!editbButton.visible, "editAvatarImage should be not visible")
propfilePopup.destroy() propfilePopup.destroy()
} }
} }

View File

@ -11,10 +11,10 @@ DISTFILES += \
base/Helpers.qml \ base/Helpers.qml \
base/ProfileModelData.qml \ base/ProfileModelData.qml \
base/WindowTestCase.qml \ base/WindowTestCase.qml \
tst_Modals.qml \
tst_choose_chat_name_modal.qml \ tst_choose_chat_name_modal.qml \
tst_get_started_modal.qml \ tst_get_started_modal.qml \
tst_initialtest.qml tst_initialtest.qml \
tst_profile_popup.qml
DISTFILES += $$files("status-desktop/ui/*", true) DISTFILES += $$files("status-desktop/ui/*", true)