Skip to content

Commit

Permalink
Chat: Skip message rendering in onMessageSend
Browse files Browse the repository at this point in the history
  • Loading branch information
marker dao ® committed Oct 10, 2024
1 parent 3ba7d05 commit 79128c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion packages/devextreme/js/__internal/ui/chat/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ class Chat extends Widget<Properties> {
text,
};

this.renderMessage(message);
this._messageSendAction?.({ message, event });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,19 +236,20 @@ QUnit.module('Chat', moduleConfig, () => {
assert.strictEqual(onMessageSend.callCount, 1);
});

QUnit.test('new message should be created after clicking the send button', function(assert) {
QUnit.test('new message should not be created after clicking the send button', function(assert) {
const text = 'new text message';

keyboardMock(this.$input)
.focus()
.type(text);

const numberOfMessagesBefore = this.getBubbles().length;

this.$sendButton.trigger('dxclick');

const $bubbles = this.getBubbles();
const bubble = $bubbles[$bubbles.length - 1];
const numberOfMessagesAfter = this.getBubbles().length;

assert.strictEqual($(bubble).text(), text);
assert.strictEqual(numberOfMessagesAfter, numberOfMessagesBefore);
});

QUnit.test('New message should be correct after clicking the send button', function(assert) {
Expand Down

0 comments on commit 79128c9

Please sign in to comment.