Skip to content

Commit 101d4a1

Browse files
author
marker dao ®
committed
fix(e2e): Fix container styles
1 parent 02daaf9 commit 101d4a1

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

e2e/testcafe-devextreme/tests/editors/chat/messageGroup.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import url from '../../../helpers/getPageUrl';
1010
import { createWidget } from '../../../helpers/createWidget';
1111
import { testScreenshot } from '../../../helpers/themeUtils';
12-
import { appendElementTo, insertStylesheetRulesToPage, setStyleAttribute } from '../../../helpers/domUtils';
12+
import { appendElementTo, setStyleAttribute } from '../../../helpers/domUtils';
1313
import asyncForEach from '../../../helpers/asyncForEach';
1414

1515
const 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

141142
test('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

176176
test('MessageGroup with edited messages', async (t) => {

e2e/testcafe-devextreme/tests/editors/chat/messageList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ test('Messagelist should scrolled to the latest messages after being rendered in
133133

134134
return createWidget('dxTabPanel', {
135135
width: 400,
136-
height: 570,
136+
height: 600,
137137
deferRendering: true,
138138
templatesRenderAsynchronously: true,
139139
dataSource: [{

0 commit comments

Comments
 (0)