-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8bed7a5
commit 77213f4
Showing
52 changed files
with
636 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; | ||
import Chat from 'devextreme-testcafe-models/chat'; | ||
import { createUser } from './data'; | ||
import url from '../../helpers/getPageUrl'; | ||
import { createWidget } from '../../helpers/createWidget'; | ||
import { getFullThemeName, testScreenshot } from '../../helpers/themeUtils'; | ||
|
||
fixture.disablePageReloads`ChatErrorList` | ||
.page(url(__dirname, '../container.html')); | ||
|
||
test('Errorlist appearance', async (t) => { | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
const chat = new Chat('#container'); | ||
|
||
await testScreenshot(t, takeScreenshot, 'Errorlist with one error.png', { element: '#container' }); | ||
|
||
await chat.option('errors', [ | ||
{ id: 1, message: 'Error Message 1. Error Description...' }, | ||
{ id: 2, message: 'Error Message 2. Message was not sent' }, | ||
{ id: 3, message: 'Error Message 3. An unexpected issue occurred while processing your request. Please check your internet connection or contact support for further assistance.' }, | ||
]); | ||
|
||
await testScreenshot(t, takeScreenshot, 'Errorlist with long text in error.png', { element: '#container', shouldTestInCompact: true }); | ||
|
||
const darkTheme = getFullThemeName().replace('light', 'dark'); | ||
await testScreenshot(t, takeScreenshot, 'Errorlist with long text in error.png', { element: '#container', theme: darkTheme }); | ||
|
||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}).before(async () => { | ||
const userFirst = createUser(1, 'First'); | ||
const userSecond = createUser(2, 'Second'); | ||
const msInDay = 86400000; | ||
const today = new Date().setHours(7, 22, 0, 0); | ||
const yesterday = today - msInDay; | ||
|
||
const items = [{ | ||
timestamp: yesterday, | ||
author: userSecond, | ||
text: 'Message text 1', | ||
}, { | ||
timestamp: yesterday, | ||
author: userSecond, | ||
text: 'Message text 2', | ||
}, { | ||
timestamp: today, | ||
author: userFirst, | ||
text: 'Message text 3', | ||
}, { | ||
timestamp: today, | ||
author: userFirst, | ||
text: 'Message text 4', | ||
}, { | ||
timestamp: today, | ||
author: userFirst, | ||
text: 'Message text 5', | ||
}]; | ||
|
||
return createWidget('dxChat', { | ||
items, | ||
user: userFirst, | ||
width: 400, | ||
height: 600, | ||
errors: [{ id: 1, message: 'Error Message 1. Error Description...' }], | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/devextreme-scss/scss/widgets/base/chat/layout/chat-errorlist/_index.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.dx-chat-errorlist { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.dx-chat-errorlist-error { | ||
align-items: center; | ||
display: flex; | ||
justify-content: center; | ||
} |
33 changes: 33 additions & 0 deletions
33
packages/devextreme-scss/scss/widgets/base/chat/layout/chat-errorlist/_mixins.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@use "../../../icons" as *; | ||
|
||
@mixin chat-errorlist( | ||
$color, | ||
$padding-block, | ||
$padding-inline, | ||
$error-padding-block, | ||
$row-gap, | ||
$icon-size, | ||
$content-column-gap, | ||
) { | ||
.dx-chat-errorlist { | ||
color: $color; | ||
padding-block: $padding-block; | ||
padding-inline: $padding-inline; | ||
row-gap: $row-gap; | ||
} | ||
|
||
.dx-chat-errorlist:empty { | ||
padding-block: 0; | ||
padding-inline: 0; | ||
} | ||
|
||
.dx-chat-errorlist-error { | ||
column-gap: $content-column-gap; | ||
padding-block: $error-padding-block; | ||
} | ||
|
||
.dx-chat-errorlist-error-icon { | ||
@include dx-icon(errorcircle); | ||
@include dx-icon-sizing($icon-size); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.