-
Notifications
You must be signed in to change notification settings - Fork 600
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
a111f26
commit 47a0c8a
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
packages/devextreme/testing/testcafe/tests/gallery/accessibility.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,50 @@ | ||
/* eslint-disable no-restricted-syntax */ | ||
import url from '../../helpers/getPageUrl'; | ||
import createWidget from '../../helpers/createWidget'; | ||
import { a11yCheck } from '../../helpers/accessibilityUtils'; | ||
|
||
fixture.disablePageReloads`Gallery` | ||
.page(url(__dirname, '../../container.html')); | ||
|
||
function getGallerySettings(settings) { | ||
const items = [{ | ||
ID: '1', | ||
Name: 'First', | ||
}, | ||
{ | ||
ID: '2', | ||
Name: 'Second', | ||
}]; | ||
|
||
return { | ||
items, | ||
height: 100, | ||
loop: true, | ||
itemTemplate(item) { | ||
const result = document.createElement('div'); | ||
const span = document.createElement('span'); | ||
|
||
span.innerText = item.name; | ||
result.appendChild(span); | ||
|
||
return result; | ||
}, | ||
...settings, | ||
}; | ||
} | ||
|
||
test('Checking Gallery via aXe when width was not set', async (t) => { | ||
await a11yCheck(t); | ||
}).before(async () => createWidget( | ||
'dxGallery', | ||
getGallerySettings({}), | ||
)); | ||
|
||
test('Checking Gallery via aXe when width was set', async (t) => { | ||
await a11yCheck(t); | ||
}).before(async () => createWidget( | ||
'dxGallery', | ||
getGallerySettings({ | ||
width: '100%', | ||
}), | ||
)); |