-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Toast(fluent theme) - Change height & text color (#25907)
Co-authored-by: EugeniyKiyashko <[email protected]>
- Loading branch information
1 parent
51f885f
commit 960df0b
Showing
15 changed files
with
121 additions
and
20 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
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
Binary file added
BIN
+10.2 KB
...e/testing/testcafe/tests/editors/overlays/etalons/Toasts (fluent-blue-dark).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.2 KB
.../testing/testcafe/tests/editors/overlays/etalons/Toasts (fluent-blue-light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.2 KB
.../testcafe/tests/editors/overlays/etalons/Toasts (fluent-blue-light-compact).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.2 KB
...treme/testing/testcafe/tests/editors/overlays/etalons/Toasts (generic-dark).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.3 KB
...reme/testing/testcafe/tests/editors/overlays/etalons/Toasts (generic-light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
...ting/testcafe/tests/editors/overlays/etalons/Toasts (generic-light-compact).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.49 KB
...testing/testcafe/tests/editors/overlays/etalons/Toasts (material-blue-dark).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.75 KB
...esting/testcafe/tests/editors/overlays/etalons/Toasts (material-blue-light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.07 KB
...estcafe/tests/editors/overlays/etalons/Toasts (material-blue-light-compact).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions
64
packages/devextreme/testing/testcafe/tests/editors/overlays/toast.ts
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,64 @@ | ||
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; | ||
import { ClientFunction, Selector } from 'testcafe'; | ||
import url from '../../../helpers/getPageUrl'; | ||
import { getFullThemeName, getThemeName, testScreenshot } from '../../../helpers/themeUtils'; | ||
import { insertStylesheetRulesToPage, setClassAttribute } from '../../../helpers/domUtils'; | ||
|
||
fixture.disablePageReloads`Toast` | ||
.page(url(__dirname, '../../container.html')); | ||
|
||
const types = ['info', 'warning', 'error', 'success']; | ||
const STACK_CONTAINER_SELECTOR = '.dx-toast-stack'; | ||
|
||
const showToast = ClientFunction( | ||
(type) => { | ||
(window as any).DevExpress.ui.notify( | ||
{ | ||
message: `Toast ${type}`, | ||
type, | ||
displayTime: 35000000, | ||
animation: { | ||
show: { | ||
type: 'fade', duration: 0, | ||
}, | ||
hide: { type: 'fade', duration: 0 }, | ||
}, | ||
}, | ||
{ | ||
position: 'top center', | ||
direction: 'down-push', | ||
}, | ||
); | ||
}, | ||
); | ||
|
||
const hideAllToasts = ClientFunction(() => { | ||
(window as any).DevExpress.ui.hideToasts(); | ||
}); | ||
|
||
test('Toasts', async (t) => { | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
|
||
await testScreenshot(t, takeScreenshot, 'Toasts.png', { element: STACK_CONTAINER_SELECTOR, shouldTestInCompact: true }); | ||
await testScreenshot(t, takeScreenshot, 'Toasts.png', { | ||
element: STACK_CONTAINER_SELECTOR, | ||
theme: `${getFullThemeName().replace('light', 'dark')}`, | ||
}); | ||
|
||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}).before(async () => { | ||
await Promise.all(types.map((type) => showToast(type))); | ||
|
||
await insertStylesheetRulesToPage(`${STACK_CONTAINER_SELECTOR} { padding: 20px; }`); | ||
await setClassAttribute(Selector(STACK_CONTAINER_SELECTOR), `dx-theme-${getThemeName()}-typography`); | ||
}).after(async () => { | ||
await hideAllToasts(); | ||
|
||
await ClientFunction(() => { | ||
$(STACK_CONTAINER_SELECTOR).remove(); | ||
}, { | ||
dependencies: { STACK_CONTAINER_SELECTOR }, | ||
})(); | ||
}); |