99import url from '../../../helpers/getPageUrl' ;
1010import { createWidget } from '../../../helpers/createWidget' ;
1111import { testScreenshot } from '../../../helpers/themeUtils' ;
12- import { appendElementTo , insertStylesheetRulesToPage , setStyleAttribute } from '../../../helpers/domUtils' ;
12+ import { appendElementTo , setStyleAttribute } from '../../../helpers/domUtils' ;
1313import asyncForEach from '../../../helpers/asyncForEach' ;
1414
1515const AVATAR_SELECTOR = '.dx-avatar' ;
@@ -111,11 +111,9 @@ test('Messagegroup scenarios in disabled state', async (t) => {
111111 const userFirst = createUser ( 1 , 'First' ) ;
112112 const userSecond = createUser ( 2 , 'Second' ) ;
113113
114- await insertStylesheetRulesToPage ( '#container { display: flex; flex-wrap: wrap; gap: 2px; padding: 20px; }' ) ;
115-
116114 await asyncForEach ( [ 1 , 2 , 3 , 4 ] , async ( bubbleCount , idx ) => {
117115 const chatId = `#chat_${ idx } ` ;
118- await appendElementTo ( '#container ' , 'div' , `chat_${ idx } ` ) ;
116+ await appendElementTo ( '#chat-wrapper ' , 'div' , `chat_${ idx } ` ) ;
119117
120118 const items = generateMessages ( bubbleCount , userFirst , userSecond , false , false , 4 , 2 ) ;
121119
@@ -131,11 +129,14 @@ test('Messagegroup scenarios in disabled state', async (t) => {
131129 await chat . repaint ( ) ;
132130 } ) ;
133131
134- await testScreenshot ( t , takeScreenshot , 'Messagegroup appearance in disabled state.png' , { element : '#container ' } ) ;
132+ await testScreenshot ( t , takeScreenshot , 'Messagegroup appearance in disabled state.png' , { element : '#chat-wrapper ' } ) ;
135133
136134 await t
137135 . expect ( compareResults . isValid ( ) )
138136 . ok ( compareResults . errorMessages ( ) ) ;
137+ } ) . before ( async ( ) => {
138+ await appendElementTo ( '#container' , 'div' , 'chat-wrapper' ) ;
139+ await setStyleAttribute ( Selector ( '#chat-wrapper' ) , 'display: flex; flex-wrap: wrap; gap: 2px; width: 1270px; padding: 20px; transform: scale(0.9);' ) ;
139140} ) ;
140141
141142test ( 'Messagegroup scenarios in RTL mode' , async ( t ) => {
@@ -144,11 +145,9 @@ test('Messagegroup scenarios in RTL mode', async (t) => {
144145 const userFirst = createUser ( 1 , 'First' ) ;
145146 const userSecond = createUser ( 2 , 'Second' ) ;
146147
147- await insertStylesheetRulesToPage ( '#container { display: flex; flex-wrap: wrap; gap: 2px; padding: 20px; }' ) ;
148-
149148 await asyncForEach ( [ 1 , 2 , 3 , 4 ] , async ( bubbleCount , idx ) => {
150149 const chatId = `#chat_${ idx } ` ;
151- await appendElementTo ( '#container ' , 'div' , `chat_${ idx } ` ) ;
150+ await appendElementTo ( '#chat-wrapper ' , 'div' , `chat_${ idx } ` ) ;
152151
153152 const items = generateMessages ( bubbleCount , userFirst , userSecond , false , false , 4 , 2 ) ;
154153
@@ -164,13 +163,14 @@ test('Messagegroup scenarios in RTL mode', async (t) => {
164163 await chat . repaint ( ) ; // NOTE: WA to make it stable in Material theme.
165164 } ) ;
166165
167- await testScreenshot ( t , takeScreenshot , 'Messagegroup appearance in RTL mode.png' , { element : '#container ' } ) ;
166+ await testScreenshot ( t , takeScreenshot , 'Messagegroup appearance in RTL mode.png' , { element : '#chat-wrapper ' } ) ;
168167
169168 await t
170169 . expect ( compareResults . isValid ( ) )
171170 . ok ( compareResults . errorMessages ( ) ) ;
172171} ) . before ( async ( ) => {
173- await setStyleAttribute ( Selector ( '#container' ) , 'width: 1270px' ) ;
172+ await appendElementTo ( '#container' , 'div' , 'chat-wrapper' ) ;
173+ await setStyleAttribute ( Selector ( '#chat-wrapper' ) , 'display: flex; flex-wrap: wrap; gap: 2px; width: 1270px; padding: 20px; transform: scale(0.9);' ) ;
174174} ) ;
175175
176176test ( 'MessageGroup with edited messages' , async ( t ) => {
0 commit comments