Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F112802
D92.1732349514.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D92.1732349514.diff
View Options
diff --git a/src/contents/ui/room-settings/RoomSettingsPage.qml b/src/contents/ui/room-settings/RoomSettingsPage.qml
--- a/src/contents/ui/room-settings/RoomSettingsPage.qml
+++ b/src/contents/ui/room-settings/RoomSettingsPage.qml
@@ -173,6 +173,7 @@
}
Button {
+ objectName: 'leaveRoomButton'
text: l10n.get('room-leave-action')
Layout.fillWidth: true
onClicked: {
@@ -192,6 +193,7 @@
}
property var confirmLeaveOverlay: Kazv.ConfirmationOverlay {
+ objectName: 'confirmLeaveRoomPopup'
parent: roomSettingsPage.overlay
title: l10n.get('room-leave-confirm-popup-title')
message: l10n.get('room-leave-confirm-popup-message')
@@ -205,10 +207,10 @@
trigger: () => room.leaveRoom()
onResolved: {
if (success) {
- showPassiveNotification(l10n.get('leave-room-success-prompt', { room: roomId }));
+ showPassiveNotification(l10n.get('leave-room-success-prompt', { room: room.roomId }));
inviteOverlay.close();
} else {
- showPassiveNotification(l10n.get('leave-room-failed-prompt', { room: roomId, errorCode: data.errorCode, errorMsg: data.error }));
+ showPassiveNotification(l10n.get('leave-room-failed-prompt', { room: room.roomId, errorCode: data.errorCode, errorMsg: data.error }));
}
}
}
diff --git a/src/tests/quick-tests/tst_RoomSettingsPage.qml b/src/tests/quick-tests/tst_RoomSettingsPage.qml
--- a/src/tests/quick-tests/tst_RoomSettingsPage.qml
+++ b/src/tests/quick-tests/tst_RoomSettingsPage.qml
@@ -39,7 +39,8 @@
})
property var roomJoined: Helpers.factory.room({
- membership: MK.MatrixRoom.Join
+ membership: MK.MatrixRoom.Join,
+ leaveRoom: mockHelper.promise(),
})
property var showPassiveNotification: mockHelper.noop()
@@ -117,5 +118,24 @@
roomLeft.forgetRoom.lastRetVal().resolve(false, {});
tryVerify(() => item.showPassiveNotification.calledTimes() === 1);
}
+
+ function test_leaveRoom() {
+ const leaveRoomButton = findChild(pageJoined, 'leaveRoomButton');
+ const confirmPopup = findChild(pageJoined, 'confirmLeaveRoomPopup');
+ verify(leaveRoomButton.visible);
+
+ confirmPopup.accepted();
+ tryVerify(() => roomJoined.leaveRoom.calledTimes() === 1);
+ roomJoined.leaveRoom.lastRetVal().resolve(true, {});
+ console.log(roomJoined.membership);
+ tryVerify(() => item.showPassiveNotification.calledTimes() === 1);
+ }
+
+ function test_leaveRoomFailure() {
+ const confirmPopup = findChild(pageJoined, 'confirmLeaveRoomPopup');
+ confirmPopup.accepted();
+ roomJoined.leaveRoom.lastRetVal().resolve(false, {});
+ tryVerify(() => item.showPassiveNotification.calledTimes() === 1);
+ }
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 12:11 AM (16 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39120
Default Alt Text
D92.1732349514.diff (2 KB)
Attached To
Mode
D92: Fix not show passiveNotification when leave room action resolved
Attached
Detach File
Event Timeline
Log In to Comment