@@ -2,6 +2,7 @@ import $ from 'jquery';
22import keyboardMock from '../../../helpers/keyboardMock.js' ;
33import { isRenderer } from 'core/utils/type' ;
44import config from 'core/config' ;
5+ import messageLocalization from 'common/core/localization/message' ;
56
67import ChatTextArea , { CHAT_TEXT_AREA_ATTACH_BUTTON , DEFAULT_ALLOWED_FILE_EXTENSIONS } from '__internal/ui/chat/message_box/chat_text_area' ;
78import Button from 'ui/button' ;
@@ -814,6 +815,50 @@ QUnit.module('ChatTextArea', moduleConfig, () => {
814815
815816 assert . strictEqual ( this . sendButton . option ( 'disabled' ) , true , 'send button is disabled after file removal' ) ;
816817 } ) ;
818+
819+ QUnit . module ( 'Localization' , {
820+ beforeEach : function ( ) {
821+ this . defaultMessage = messageLocalization . format ( 'dxChat-fileLimitReachedWarning' ) ;
822+ this . customMessage = 'Custom file limit message' ;
823+ } ,
824+ afterEach : function ( ) {
825+ messageLocalization . load ( { en : { 'dxChat-fileLimitReachedWarning' : this . defaultMessage } } ) ;
826+ }
827+ } , ( ) => {
828+ QUnit . test ( 'informer should show custom localization message loaded before component initialization' , function ( assert ) {
829+ messageLocalization . load ( { en : { 'dxChat-fileLimitReachedWarning' : this . customMessage } } ) ;
830+
831+ this . reinit ( {
832+ fileUploaderOptions : {
833+ uploadFile : ( ) => { } ,
834+ }
835+ } ) ;
836+
837+ const fileUploader = this . getFileUploader ( ) ;
838+ fileUploader . option ( 'onFileLimitReached' ) ( ) ;
839+
840+ const $informerText = this . $element . find ( `.${ INFORMER_TEXT_CLASS } ` ) ;
841+
842+ assert . strictEqual ( $informerText . text ( ) , this . customMessage , 'custom localization message is shown' ) ;
843+ } ) ;
844+
845+ QUnit . test ( 'informer should show custom localization message loaded after component initialization' , function ( assert ) {
846+ this . reinit ( {
847+ fileUploaderOptions : {
848+ uploadFile : ( ) => { } ,
849+ }
850+ } ) ;
851+
852+ messageLocalization . load ( { en : { 'dxChat-fileLimitReachedWarning' : this . customMessage } } ) ;
853+
854+ const fileUploader = this . getFileUploader ( ) ;
855+ fileUploader . option ( 'onFileLimitReached' ) ( ) ;
856+
857+ const $informerText = this . $element . find ( `.${ INFORMER_TEXT_CLASS } ` ) ;
858+
859+ assert . strictEqual ( $informerText . text ( ) , this . customMessage , 'custom localization message is shown after runtime load' ) ;
860+ } ) ;
861+ } ) ;
817862 } ) ;
818863
819864 QUnit . module ( 'Integration with text option' , ( ) => {
0 commit comments