Skip to content

Commit

Permalink
Chat: Fix line breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
marker-dao authored Sep 10, 2024
1 parent 5c86f71 commit 1a05059
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/testcafe_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ jobs:
{ componentFolder: "common", name: "common" },
{ componentFolder: "common", name: "common - material", theme: 'material.blue.light' },
{ componentFolder: "common", name: "common - fluent", theme: 'fluent.blue.light' },
{ componentFolder: "chat", name: "chat" },
{ componentFolder: "chat", name: "chat - material", theme: 'material.blue.light' },
{ componentFolder: "chat", name: "chat - fluent", theme: 'fluent.blue.light' },
{ componentFolder: "treeList", name: "treeList", concurrency: 1 },
{ componentFolder: "dataGrid", name: "dataGrid (1/5)", indices: "1/5" },
{ componentFolder: "dataGrid", name: "dataGrid (2/5)", indices: "2/5" },
Expand Down
29 changes: 29 additions & 0 deletions e2e/testcafe-devextreme/tests/chat/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
import url from '../../helpers/getPageUrl';
import { createWidget } from '../../helpers/createWidget';
import { testScreenshot } from '../../helpers/themeUtils';
import { appendElementTo } from '../../helpers/domUtils';

fixture.disablePageReloads`Chat`
.page(url(__dirname, '../container.html'));

test('Chat: line breaks', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
await testScreenshot(t, takeScreenshot, 'Chat message bubble line breaks.png', { element: '#container' });

await t
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => {
await appendElementTo('#container', 'div', 'chat');

return createWidget('dxChat', {
height: 500,
width: 300,
items: [
{
text: 'line\nbreak',
},
],
}, '#chat');
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
.dx-chat-message-bubble {
width: auto;
word-break: break-word;
white-space: break-spaces;
}

.dx-chat-message-group-alignment-start {
Expand Down
1 change: 1 addition & 0 deletions packages/testcafe-models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type WidgetName =
| 'dxCalendar'
| 'dxCalendarView'
| 'dxChart'
| 'dxChat'
| 'dxCheckBox'
| 'dxColorBox'
| 'dxContextMenu'
Expand Down

0 comments on commit 1a05059

Please sign in to comment.