Skip to content

Commit a91e080

Browse files
Chat: add missing parts that are untested in dark theme and compact size mode (#28331)
1 parent a5064cd commit a91e080

11 files changed

+53
-5
lines changed
6.72 KB
Loading
7.07 KB
Loading
6.31 KB
Loading
20.4 KB
Loading
17.4 KB
Loading
19.3 KB
Loading
16.5 KB
Loading
20.4 KB
Loading
16.7 KB
Loading

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

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
22
import Chat from 'devextreme-testcafe-models/chat';
33
import { ClientFunction } from 'testcafe';
4-
import { User } from 'devextreme/ui/chat';
4+
import { Message, User } from 'devextreme/ui/chat';
55
import TabPanel from 'devextreme-testcafe-models/tabPanel';
66
import { createUser, generateMessages, getLongText } from './data';
77
import url from '../../helpers/getPageUrl';
88
import { createWidget } from '../../helpers/createWidget';
99
import { testScreenshot } from '../../helpers/themeUtils';
10+
import { insertStylesheetRulesToPage } from '../../helpers/domUtils';
1011

1112
fixture.disablePageReloads`ChatMessageList`
1213
.page(url(__dirname, '../container.html'));
@@ -152,6 +153,37 @@ test('Messagelist should scrolled to the latest messages after being rendered in
152153
});
153154
});
154155

156+
test('Messagelist with loadindicator appearance on initial loading', async (t) => {
157+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
158+
const chat = new Chat('#container');
159+
160+
await chat.repaint();
161+
await testScreenshot(t, takeScreenshot, 'Messagelist loadindicator position on initial loading.png', { element: '#container' });
162+
163+
await t
164+
.expect(compareResults.isValid())
165+
.ok(compareResults.errorMessages());
166+
}).before(async () => {
167+
await insertStylesheetRulesToPage('.dx-loadindicator-content, .dx-loadindicator-icon, .dx-loadindicator-segment, .dx-loadindicator-segment-inner { animation-play-state: paused !important; }');
168+
169+
await createWidget('dxChat', () => {
170+
const data: Message[] = [];
171+
172+
return {
173+
dataSource: new (window as any).DevExpress.data.CustomStore({
174+
key: 'id',
175+
load: () => new Promise<Message[]>((resolve) => {
176+
setTimeout(() => {
177+
resolve(data);
178+
}, 3000);
179+
}),
180+
}),
181+
width: 400,
182+
height: 600,
183+
};
184+
});
185+
});
186+
155187
test('Messagelist with messageTemplate', async (t) => {
156188
const chat = new Chat('#container');
157189
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);

0 commit comments

Comments
 (0)