@@ -18,6 +18,7 @@ const CHAT_MESSAGEGROUP_CLASS = 'dx-chat-messagegroup';
1818const CHAT_MESSAGELIST_CLASS = 'dx-chat-messagelist' ;
1919const CHAT_ALERTLIST_CLASS = 'dx-chat-alertlist' ;
2020const CHAT_MESSAGEBUBBLE_CLASS = 'dx-chat-messagebubble' ;
21+ const CHAT_MESSAGEBUBBLE_CONTENT_CLASS = 'dx-chat-messagebubble-content' ;
2122const CHAT_MESSAGEBOX_CLASS = 'dx-chat-messagebox' ;
2223const CHAT_MESSAGEBOX_BUTTON_CLASS = 'dx-chat-messagebox-button' ;
2324const CHAT_MESSAGEBOX_TEXTAREA_CLASS = 'dx-chat-messagebox-textarea' ;
@@ -84,6 +85,7 @@ const moduleConfig = {
8485 this . getMessageGroups = ( ) => this . $element . find ( `.${ CHAT_MESSAGEGROUP_CLASS } ` ) ;
8586 this . getDayHeaders = ( ) => this . $element . find ( `.${ CHAT_MESSAGELIST_DAY_HEADER_CLASS } ` ) ;
8687 this . getBubbles = ( ) => this . $element . find ( `.${ CHAT_MESSAGEBUBBLE_CLASS } ` ) ;
88+ this . getBubblesContents = ( ) => this . $element . find ( `.${ CHAT_MESSAGEBUBBLE_CONTENT_CLASS } ` ) ;
8789
8890 init ( ) ;
8991 }
@@ -255,9 +257,9 @@ QUnit.module('Chat', () => {
255257 messageTemplate,
256258 } ) ;
257259
258- const $bubble = this . getBubbles ( ) ;
260+ const $bubbleContent = this . getBubblesContents ( ) ;
259261
260- assert . strictEqual ( $bubble . text ( ) , 'text: CustomText' ) ;
262+ assert . strictEqual ( $bubbleContent . text ( ) , 'text: CustomText' ) ;
261263 } ) ;
262264
263265 QUnit . test ( 'messageTemplate should set bubble content at runtime' , function ( assert ) {
@@ -271,9 +273,9 @@ QUnit.module('Chat', () => {
271273
272274 this . instance . option ( 'messageTemplate' , messageTemplate ) ;
273275
274- const $bubble = this . getBubbles ( ) ;
276+ const $bubbleContent = this . getBubbles ( ) ;
275277
276- assert . strictEqual ( $bubble . text ( ) , 'text: CustomText' ) ;
278+ assert . strictEqual ( $bubbleContent . text ( ) , 'text: CustomText' ) ;
277279 } ) ;
278280
279281 QUnit . test ( 'messageTemplate function should have correct parameters' , function ( assert ) {
@@ -307,9 +309,9 @@ QUnit.module('Chat', () => {
307309
308310 this . instance . renderMessage ( { text : 'new message' } ) ;
309311
310- const $bubble = this . getBubbles ( ) ;
312+ const $bubbleContent = this . getBubblesContents ( ) ;
311313
312- assert . strictEqual ( $bubble . text ( ) , 'text: new message' ) ;
314+ assert . strictEqual ( $bubbleContent . text ( ) , 'text: new message' ) ;
313315 } ) ;
314316
315317 QUnit . test ( 'messageTemplate should not have excess call count' , function ( assert ) {
@@ -336,9 +338,9 @@ QUnit.module('Chat', () => {
336338 messageTemplate : 'hello' ,
337339 } ) ;
338340
339- const $bubble = this . getBubbles ( ) ;
341+ const $bubbleContent = this . getBubblesContents ( ) ;
340342
341- assert . strictEqual ( $bubble . text ( ) , 'hello' ) ;
343+ assert . strictEqual ( $bubbleContent . text ( ) , 'hello' ) ;
342344 } ) ;
343345
344346 QUnit . test ( 'messageTemplate specified as a string with a html element should set bubble content' , function ( assert ) {
@@ -347,11 +349,11 @@ QUnit.module('Chat', () => {
347349 messageTemplate : '<p>p text</p>' ,
348350 } ) ;
349351
350- const $bubble = this . getBubbles ( ) ;
351- const $bubbleContent = $bubble . children ( ) ;
352+ const $bubbleContent = this . getBubblesContents ( ) ;
353+ const $bubbleContentChild = $bubbleContent . children ( ) ;
352354
353- assert . strictEqual ( $bubbleContent . text ( ) , 'p text' , 'template text is correct' ) ;
354- assert . strictEqual ( $bubbleContent . prop ( 'tagName' ) , 'P' , 'templte tag element is correct' ) ;
355+ assert . strictEqual ( $bubbleContentChild . text ( ) , 'p text' , 'template text is correct' ) ;
356+ assert . strictEqual ( $bubbleContentChild . prop ( 'tagName' ) , 'P' , 'templte tag element is correct' ) ;
355357 } ) ;
356358 } ) ;
357359
0 commit comments