Page MenuHomePhorge

D111.1729327449.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D111.1729327449.diff

diff --git a/src/contents/ui/SendMessageBox.qml b/src/contents/ui/SendMessageBox.qml
--- a/src/contents/ui/SendMessageBox.qml
+++ b/src/contents/ui/SendMessageBox.qml
@@ -181,6 +181,7 @@
}
ToolButton {
+ objectName: 'sendButton'
action: sendAction
display: AbstractButton.IconOnly
}
@@ -235,6 +236,7 @@
sendMessageBox.draftRelType = '';
sendMessageBox.draftRelatedTo = '';
}
+ enabled: textArea.text !== ''
}
Kirigami.Action {
id: sendMediaFileAction
diff --git a/src/tests/quick-tests/tst_SendMessageBox.qml b/src/tests/quick-tests/tst_SendMessageBox.qml
--- a/src/tests/quick-tests/tst_SendMessageBox.qml
+++ b/src/tests/quick-tests/tst_SendMessageBox.qml
@@ -20,6 +20,7 @@
width: 800
height: 600
+ property var mockHelper: TestHelpers.MockHelper {}
function makeRoom () {
return {
timeline () {
@@ -41,6 +42,8 @@
members () {
return membersModel;
},
+ setTyping: mockHelper.noop(),
+ sendTextMessage: mockHelper.noop(),
};
}
@@ -73,6 +76,7 @@
function init() {
membersModel.count = 2;
findChild(sendMessageBox, 'draftMessage').text = '';
+ mockHelper.clearAll();
}
function test_empty() {
@@ -204,5 +208,18 @@
const completionPopup = findChild(sendMessageBox, 'completionPopup');
tryVerify(() => !completionPopup.opened);
}
+
+ function test_emptySend() {
+ mouseClick(findChild(sendMessageBox, 'sendButton'));
+ verify(room.sendTextMessage.calledTimes() === 0);
+
+ const textArea = findChild(sendMessageBox, 'draftMessage');
+ mouseClick(textArea);
+ tryVerify(() => textArea.activeFocus);
+ keySequence('Ctrl+Enter');
+ verify(room.sendTextMessage.calledTimes() === 0);
+ keySequence('Ctrl+Return');
+ verify(room.sendTextMessage.calledTimes() === 0);
+ }
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 19, 1:44 AM (22 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26448
Default Alt Text
D111.1729327449.diff (1 KB)

Event Timeline