Skip to content

Commit 4882bec

Browse files
committed
add test
1 parent 89ff7d1 commit 4882bec

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

packages/devextreme/testing/tests/DevExpress.ui.widgets/chatParts/chatTextArea.tests.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,28 @@ QUnit.module('ChatTextArea', moduleConfig, () => {
542542

543543
assert.strictEqual(this.sendButton.option('disabled'), true, 'send button is disabled after adding file that fail validation');
544544
});
545+
546+
QUnit.test('send button should not be disabled after removing file that fail validation', function(assert) {
547+
this.reinit({
548+
fileUploaderOptions: {
549+
uploadFile: () => {},
550+
allowedFileExtensions: ['.jpg'],
551+
},
552+
});
553+
const fileUploader = this.getFileUploader();
554+
fileUploader.option('value', [fakeFile]);
555+
fileUploader.upload();
556+
557+
this.clock.tick();
558+
559+
assert.strictEqual(this.sendButton.option('disabled'), true, 'send button is disabled');
560+
561+
const $cancelButton = this.$element.find(`.${FILEUPLOADER_CANCEL_BUTTON_CLASS}`);
562+
563+
$cancelButton.trigger('dxclick');
564+
565+
assert.strictEqual(this.sendButton.option('disabled'), true, 'send button is not disabled');
566+
});
545567
});
546568

547569
QUnit.module('Informer integration', {

0 commit comments

Comments
 (0)