|
1 | 1 | import { ClientFunction } from 'testcafe';
|
2 |
| -import { isMaterialBased, isFluent } from '../../../helpers/themeUtils'; |
| 2 | +import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; |
| 3 | +import { isMaterialBased, isFluent, testScreenshot } from '../../../helpers/themeUtils'; |
3 | 4 | import url from '../../../helpers/getPageUrl';
|
4 | 5 | import List from '../../../model/list';
|
5 | 6 | import { createWidget } from '../../../helpers/createWidget';
|
@@ -323,6 +324,49 @@ test('Disabled item should be focused on tab press to match accessibility criter
|
323 | 324 | searchEnabled: true,
|
324 | 325 | }));
|
325 | 326 |
|
| 327 | +test('The delete button should be displayed correctly after the list item focused (T1216108)', async (t) => { |
| 328 | + const { takeScreenshot, compareResults } = createScreenshotsComparer(t); |
| 329 | + const list = new List('#container'); |
| 330 | + |
| 331 | + await list.focus(); |
| 332 | + |
| 333 | + await testScreenshot(t, takeScreenshot, 'List delete button when item is focused.png'); |
| 334 | + |
| 335 | + await t |
| 336 | + .expect(compareResults.isValid()) |
| 337 | + .ok(compareResults.errorMessages()); |
| 338 | +}).before(async () => createWidget('dxList', { |
| 339 | + dataSource: [{ |
| 340 | + text: 'item 1', |
| 341 | + icon: 'user', |
| 342 | + }], |
| 343 | + allowItemDeleting: true, |
| 344 | + itemDeleteMode: 'static', |
| 345 | +})); |
| 346 | + |
| 347 | +test('The button icon in custom template should be displayed correctly after the list item focused (T1216108)', async (t) => { |
| 348 | + const { takeScreenshot, compareResults } = createScreenshotsComparer(t); |
| 349 | + const list = new List('#container'); |
| 350 | + |
| 351 | + await list.focus(); |
| 352 | + |
| 353 | + await testScreenshot(t, takeScreenshot, 'List icon in button when item is focused.png'); |
| 354 | + |
| 355 | + await t |
| 356 | + .expect(compareResults.isValid()) |
| 357 | + .ok(compareResults.errorMessages()); |
| 358 | +}).before(async () => createWidget('dxList', { |
| 359 | + dataSource: [{ text: 'item 1' }], |
| 360 | + itemTemplate: (_, __, element) => { |
| 361 | + const button = ($('<div>') as any).dxButton({ |
| 362 | + text: 'custom', |
| 363 | + icon: 'home', |
| 364 | + }); |
| 365 | + |
| 366 | + element.append(button); |
| 367 | + }, |
| 368 | +})); |
| 369 | + |
326 | 370 | test('Checking simple list with selectAll and "more" button via aXe', async (t) => {
|
327 | 371 | await a11yCheck(t);
|
328 | 372 | }).before(async () => createWidget('dxList', {
|
|
0 commit comments