Skip to content

Commit f8ffde5

Browse files
authored
DropDownBox: reduce count of accessibility checks (#29875)
1 parent 6a0383e commit f8ffde5

File tree

15 files changed

+347
-107
lines changed

15 files changed

+347
-107
lines changed

e2e/testcafe-devextreme/tests/accessibility/common/autocomplete.ts renamed to e2e/testcafe-devextreme/tests/accessibility/common/autocomplete/buttonsAndLabels.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
import { Properties } from 'devextreme/ui/autocomplete.d';
2-
import url from '../../../helpers/getPageUrl';
3-
import { testAccessibility, Configuration } from '../../../helpers/accessibility/test';
4-
import { Options } from '../../../helpers/generateOptionMatrix';
2+
import url from '../../../../helpers/getPageUrl';
3+
import { testAccessibility, Configuration } from '../../../../helpers/accessibility/test';
4+
import { Options } from '../../../../helpers/generateOptionMatrix';
55

66
fixture.disablePageReloads`Accessibility`
7-
.page(url(__dirname, '../../container.html'));
7+
.page(url(__dirname, '../../../container.html'));
88

99
const items = ['Item_1', 'Item_2', 'Item_3'];
1010

1111
const options: Options<Properties> = {
1212
dataSource: [[], items],
13-
placeholder: [undefined, 'placeholder'],
13+
value: ['Item_1'],
14+
label: [undefined, 'label'],
1415
showClearButton: [true, false],
15-
value: [undefined, 'Item_1'],
16-
disabled: [true, false],
17-
readOnly: [true, false],
18-
opened: [true, false],
19-
deferRendering: [true, false],
20-
searchTimeout: [0],
16+
showDropDownButton: [true, false],
2117
inputAttr: [{ 'aria-label': 'aria-label' }],
2218
buttons: [
2319
undefined,
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { Properties } from 'devextreme/ui/autocomplete.d';
2+
import url from '../../../../helpers/getPageUrl';
3+
import { testAccessibility, Configuration } from '../../../../helpers/accessibility/test';
4+
import { Options } from '../../../../helpers/generateOptionMatrix';
5+
6+
fixture.disablePageReloads`Accessibility`
7+
.page(url(__dirname, '../../../container.html'));
8+
9+
const items = ['Item_1', 'Item_2', 'Item_3'];
10+
11+
const options: Options<Properties> = {
12+
dataSource: [[], items],
13+
placeholder: [undefined, 'placeholder'],
14+
value: [undefined, 'Item_1'],
15+
disabled: [true, false],
16+
readOnly: [true, false],
17+
opened: [true, false],
18+
deferRendering: [true, false],
19+
searchTimeout: [0],
20+
inputAttr: [{ 'aria-label': 'aria-label' }],
21+
};
22+
23+
const a11yCheckConfig = {
24+
rules: {
25+
// NOTE: color-contrast issues
26+
'color-contrast': { enabled: false },
27+
},
28+
};
29+
30+
const configuration: Configuration = {
31+
component: 'dxAutocomplete',
32+
a11yCheckConfig,
33+
options,
34+
};
35+
36+
testAccessibility(configuration);
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { Properties } from 'devextreme/ui/color_box.d';
2+
import url from '../../../../helpers/getPageUrl';
3+
import { testAccessibility, Configuration } from '../../../../helpers/accessibility/test';
4+
import { Options } from '../../../../helpers/generateOptionMatrix';
5+
6+
fixture.disablePageReloads`Accessibility`
7+
.page(url(__dirname, '../../../container.html'));
8+
9+
const options: Options<Properties> = {
10+
value: ['#f05b41'],
11+
label: [undefined, 'label'],
12+
showClearButton: [true, false],
13+
showDropDownButton: [true, false],
14+
inputAttr: [{ 'aria-label': 'aria-label' }],
15+
buttons: [
16+
undefined,
17+
[
18+
{
19+
name: 'today',
20+
location: 'before',
21+
options: {
22+
text: 'Today',
23+
stylingMode: 'text',
24+
onClick: () => {},
25+
},
26+
},
27+
],
28+
],
29+
};
30+
31+
const a11yCheckConfig = {
32+
rules: {
33+
// NOTE: color-contrast issues
34+
'color-contrast': { enabled: false },
35+
},
36+
};
37+
38+
const configuration: Configuration = {
39+
component: 'dxColorBox',
40+
a11yCheckConfig,
41+
options,
42+
};
43+
44+
testAccessibility(configuration);

e2e/testcafe-devextreme/tests/accessibility/common/colorBox.ts renamed to e2e/testcafe-devextreme/tests/accessibility/common/colorBox/common.ts

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Properties } from 'devextreme/ui/color_box.d';
2-
import url from '../../../helpers/getPageUrl';
3-
import { testAccessibility, Configuration } from '../../../helpers/accessibility/test';
4-
import { Options } from '../../../helpers/generateOptionMatrix';
2+
import url from '../../../../helpers/getPageUrl';
3+
import { testAccessibility, Configuration } from '../../../../helpers/accessibility/test';
4+
import { Options } from '../../../../helpers/generateOptionMatrix';
55

66
fixture.disablePageReloads`Accessibility`
7-
.page(url(__dirname, '../../container.html'));
7+
.page(url(__dirname, '../../../container.html'));
88

99
const options: Options<Properties> = {
1010
value: [undefined, '#f05b41'],
@@ -13,23 +13,9 @@ const options: Options<Properties> = {
1313
editAlphaChannel: [true, false],
1414
placeholder: [undefined, 'placeholder'],
1515
applyValueMode: ['instantly', 'useButtons'],
16-
inputAttr: [{ 'aria-label': 'aria-label' }],
1716
opened: [true, false],
1817
deferRendering: [true, false],
19-
buttons: [
20-
undefined,
21-
[
22-
{
23-
name: 'today',
24-
location: 'before',
25-
options: {
26-
text: 'Today',
27-
stylingMode: 'text',
28-
onClick: () => {},
29-
},
30-
},
31-
],
32-
],
18+
inputAttr: [{ 'aria-label': 'aria-label' }],
3319
};
3420

3521
const a11yCheckConfig = {
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { Properties } from 'devextreme/ui/date_box.d';
2+
import url from '../../../../helpers/getPageUrl';
3+
import { testAccessibility, Configuration } from '../../../../helpers/accessibility/test';
4+
import { Options } from '../../../../helpers/generateOptionMatrix';
5+
6+
fixture.disablePageReloads`Accessibility`
7+
.page(url(__dirname, '../../../container.html'));
8+
9+
const now = new Date();
10+
11+
const options: Options<Properties> = {
12+
value: [now],
13+
label: [undefined, 'label'],
14+
showClearButton: [true, false],
15+
showDropDownButton: [true, false],
16+
inputAttr: [{ 'aria-label': 'aria-label' }],
17+
opened: [true],
18+
buttons: [
19+
undefined,
20+
[
21+
{
22+
name: 'today',
23+
location: 'before',
24+
options: {
25+
text: 'Today',
26+
stylingMode: 'text',
27+
onClick: () => {},
28+
},
29+
},
30+
],
31+
],
32+
};
33+
34+
const a11yCheckConfig = {
35+
rules: {
36+
// NOTE: color-contrast issues
37+
'color-contrast': { enabled: false },
38+
},
39+
};
40+
41+
const configuration: Configuration = {
42+
component: 'dxDateBox',
43+
a11yCheckConfig,
44+
options,
45+
};
46+
47+
testAccessibility(configuration);

e2e/testcafe-devextreme/tests/accessibility/common/dateBox.ts renamed to e2e/testcafe-devextreme/tests/accessibility/common/dateBox/common.ts

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { ClientFunction } from 'testcafe';
22
import { Properties } from 'devextreme/ui/date_box.d';
33
import DateBox from 'devextreme-testcafe-models/dateBox';
4-
import url from '../../../helpers/getPageUrl';
5-
import { defaultSelector, testAccessibility, Configuration } from '../../../helpers/accessibility/test';
6-
import { Options } from '../../../helpers/generateOptionMatrix';
4+
import url from '../../../../helpers/getPageUrl';
5+
import { defaultSelector, testAccessibility, Configuration } from '../../../../helpers/accessibility/test';
6+
import { Options } from '../../../../helpers/generateOptionMatrix';
77

88
fixture.disablePageReloads`Accessibility`
9-
.page(url(__dirname, '../../container.html'));
9+
.page(url(__dirname, '../../../container.html'));
1010

1111
const now = new Date();
1212

@@ -19,20 +19,6 @@ const options: Options<Properties> = {
1919
applyValueMode: ['instantly', 'useButtons'],
2020
inputAttr: [{ 'aria-label': 'aria-label' }],
2121
deferRendering: [true, false],
22-
buttons: [
23-
undefined,
24-
[
25-
{
26-
name: 'today',
27-
location: 'before',
28-
options: {
29-
text: 'Today',
30-
stylingMode: 'text',
31-
onClick: () => {},
32-
},
33-
},
34-
],
35-
],
3622
};
3723

3824
const created = async (t: TestController, optionConfiguration): Promise<void> => {
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { Properties } from 'devextreme/ui/date_range_box.d';
2+
import url from '../../../../helpers/getPageUrl';
3+
import { testAccessibility, Configuration } from '../../../../helpers/accessibility/test';
4+
import { Options } from '../../../../helpers/generateOptionMatrix';
5+
6+
fixture.disablePageReloads`Accessibility`
7+
.page(url(__dirname, '../../../container.html'));
8+
9+
const msInDay = 1000 * 60 * 60 * 24;
10+
const now = new Date();
11+
const initialValue = [
12+
new Date(now.getTime() - msInDay * 3),
13+
new Date(now.getTime() + msInDay * 3),
14+
];
15+
16+
const options: Options<Properties> = {
17+
value: [initialValue],
18+
showClearButton: [true, false],
19+
showDropDownButton: [true, false],
20+
endDateInputAttr: [{ 'aria-label': 'aria-label' }],
21+
startDateInputAttr: [{ 'aria-label': 'aria-label' }],
22+
buttons: [
23+
undefined,
24+
[
25+
{
26+
name: 'today',
27+
location: 'before',
28+
options: {
29+
text: 'Today',
30+
stylingMode: 'text',
31+
onClick: () => {},
32+
},
33+
},
34+
],
35+
],
36+
};
37+
38+
const a11yCheckConfig = {
39+
rules: {
40+
// NOTE: color-contrast issues
41+
'color-contrast': { enabled: false },
42+
},
43+
};
44+
45+
const configuration: Configuration = {
46+
component: 'dxDateRangeBox',
47+
a11yCheckConfig,
48+
options,
49+
};
50+
51+
testAccessibility(configuration);

e2e/testcafe-devextreme/tests/accessibility/common/dateRangeBox.ts renamed to e2e/testcafe-devextreme/tests/accessibility/common/dateRangeBox/common.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Properties } from 'devextreme/ui/date_range_box.d';
2-
import url from '../../../helpers/getPageUrl';
3-
import { testAccessibility, Configuration } from '../../../helpers/accessibility/test';
4-
import { Options } from '../../../helpers/generateOptionMatrix';
2+
import url from '../../../../helpers/getPageUrl';
3+
import { testAccessibility, Configuration } from '../../../../helpers/accessibility/test';
4+
import { Options } from '../../../../helpers/generateOptionMatrix';
55

66
fixture.disablePageReloads`Accessibility`
7-
.page(url(__dirname, '../../container.html'));
7+
.page(url(__dirname, '../../../container.html'));
88

99
const msInDay = 1000 * 60 * 60 * 24;
1010
const now = new Date();

e2e/testcafe-devextreme/tests/accessibility/common/dropDownBox.ts renamed to e2e/testcafe-devextreme/tests/accessibility/common/dropDownBox/buttonsAndLabels.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
import { Properties } from 'devextreme/ui/drop_down_box.d';
2-
import url from '../../../helpers/getPageUrl';
3-
import { testAccessibility, Configuration } from '../../../helpers/accessibility/test';
4-
import { Options } from '../../../helpers/generateOptionMatrix';
2+
import url from '../../../../helpers/getPageUrl';
3+
import { testAccessibility, Configuration } from '../../../../helpers/accessibility/test';
4+
import { Options } from '../../../../helpers/generateOptionMatrix';
55

66
fixture.disablePageReloads`Accessibility`
7-
.page(url(__dirname, '../../container.html'));
7+
.page(url(__dirname, '../../../container.html'));
88

99
const items = ['Download Trial For Visual Studio', 'Download Trial For All Platforms', 'Package Managers'];
1010

1111
const options: Options<Properties> = {
1212
dataSource: [[], items],
13-
disabled: [true, false],
14-
readOnly: [true, false],
15-
name: [undefined, 'name'],
16-
text: [undefined, 'Download Trial'],
13+
value: [items[0]],
1714
label: [undefined, 'label'],
1815
showClearButton: [true, false],
1916
showDropDownButton: [true, false],
20-
opened: [true, false],
21-
deferRendering: [true, false],
2217
buttons: [
2318
undefined,
2419
[
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { Properties } from 'devextreme/ui/drop_down_box.d';
2+
import url from '../../../../helpers/getPageUrl';
3+
import { testAccessibility, Configuration } from '../../../../helpers/accessibility/test';
4+
import { Options } from '../../../../helpers/generateOptionMatrix';
5+
6+
fixture.disablePageReloads`Accessibility`
7+
.page(url(__dirname, '../../../container.html'));
8+
9+
const items = ['Download Trial For Visual Studio', 'Download Trial For All Platforms', 'Package Managers'];
10+
11+
const options: Options<Properties> = {
12+
dataSource: [[], items],
13+
disabled: [true, false],
14+
readOnly: [true, false],
15+
opened: [true, false],
16+
deferRendering: [true, false],
17+
inputAttr: [{ 'aria-label': 'DropDownBox' }],
18+
};
19+
20+
const a11yCheckConfig = {
21+
// NOTE: color-contrast issues
22+
rules: { 'color-contrast': { enabled: false } },
23+
};
24+
25+
const configuration: Configuration = {
26+
component: 'dxDropDownBox',
27+
a11yCheckConfig,
28+
options,
29+
};
30+
31+
testAccessibility(configuration);

0 commit comments

Comments
 (0)