@@ -7,7 +7,7 @@ const testHelper = new TestHelper()
7
7
8
8
// Example: Adds attribute 'aria-pressed=true' based on the property 'active'
9
9
definitions . push ( {
10
- regexp : / A d d s a t t r i b u t e ' ( [ \w \- \w \s * ] + ) = ( [ a - z ] + ) ' b a s e d o n t h e p r o p e r t y ' ( [ a - z ] + ) ' \. / g,
10
+ regexp : / A d d s a t t r i b u t e ' ( [ \w - ] + ) = ( \w + ) ' b a s e d o n t h e p r o p e r t y ' ( \w + ) ' \. / g,
11
11
testMethod : ( parameters : TestMethod ) => {
12
12
const [ attributeToBeAdded , attributeExpectedValue , propertyDependingOn ] = [ ...parameters . props ]
13
13
const property = { }
@@ -22,7 +22,7 @@ definitions.push({
22
22
23
23
// Example: Adds attribute 'aria-hidden=true' to icon
24
24
definitions . push ( {
25
- regexp : / A d d s a t t r i b u t e ' ( [ \w \- \w \s * ] + ) = ( [ a - z ] + ) ' t o [ a - z ] + / g,
25
+ regexp : / A d d s a t t r i b u t e ' ( [ \w - ] + ) = ( \w + ) ' t o \w + / g,
26
26
testMethod : ( parameters : TestMethod ) => {
27
27
const [ attributeToBeAdded , attributeExpectedValue ] = [ ...parameters . props ]
28
28
const property = { }
@@ -33,7 +33,7 @@ definitions.push({
33
33
34
34
// Example: Adds role='listbox'.
35
35
definitions . push ( {
36
- regexp : / A d d s r o l e = ' ( [ a - z ] + ) ' \. / g,
36
+ regexp : / A d d s r o l e = ' ( \w + ) ' \. / g,
37
37
testMethod : ( parameters : TestMethod ) => {
38
38
const [ roleToBeAdded ] = [ ...parameters . props ]
39
39
const property = { }
@@ -44,7 +44,7 @@ definitions.push({
44
44
45
45
// Example: Adds role 'menuitem' to 'anchor' component's part
46
46
definitions . push ( {
47
- regexp : / A d d s r o l e ' ( [ a - z ] + ) ' t o ' ( [ a - z ] + ) ' c o m p o n e n t ' s p a r t / g,
47
+ regexp : / A d d s r o l e ' ( \w + ) ' t o ' ( [ \w - ] + ) ' c o m p o n e n t ' s p a r t / g,
48
48
testMethod : ( parameters : TestMethod ) => {
49
49
const [ roleToBeAdded , elementWhereToBeAdded ] = [ ...parameters . props ]
50
50
const property = { }
@@ -56,7 +56,7 @@ definitions.push({
56
56
// Example: Adds attribute 'tabIndex=0' to 'anchor' component's part.
57
57
// Adds attribute 'data-is-focusable=true' to 'anchor' component's part.
58
58
definitions . push ( {
59
- regexp : / A d d s a t t r i b u t e ' ( [ a - z A - Z - ] + ) = ( [ a - z 0 - 9 ] + ) ' t o ' ( [ a - z ] + ) ' c o m p o n e n t ' s p a r t \. / g,
59
+ regexp : / A d d s a t t r i b u t e ' ( [ \w - ] + ) = ( [ \w \d ] + ) ' t o ' ( [ \w - ] + ) ' c o m p o n e n t ' s p a r t \. / g,
60
60
testMethod : ( parameters : TestMethod ) => {
61
61
const [ attributeToBeAdded , attributeExpectedValue , elementWhereToBeAdded ] = [
62
62
...parameters . props ,
@@ -73,7 +73,7 @@ definitions.push({
73
73
74
74
// Example: Adds attribute 'aria-expanded=true' based on the property 'menuOpen' if the component has 'menu' property to 'anchor' component's part.
75
75
definitions . push ( {
76
- regexp : / A d d s a t t r i b u t e ' ( [ a - z A - Z - ] + ) = ( [ a - z 0 - 9 ] + ) ' b a s e d o n t h e p r o p e r t y ' ( [ a - z A - Z - ] + ) ' i f t h e c o m p o n e n t h a s ' ( [ a - z - ] + ) ' p r o p e r t y t o ' ( [ a - z - ] + ) ' c o m p o n e n t ' s p a r t \. / g,
76
+ regexp : / A d d s a t t r i b u t e ' ( [ \w - ] + ) = ( [ \w \d ] + ) ' b a s e d o n t h e p r o p e r t y ' ( [ \w - ] + ) ' i f t h e c o m p o n e n t h a s ' ( [ \w - ] + ) ' p r o p e r t y t o ' ( [ \w - ] + ) ' c o m p o n e n t ' s p a r t \. / g,
77
77
testMethod : ( parameters : TestMethod ) => {
78
78
const [
79
79
attributeToBeAdded ,
@@ -110,7 +110,7 @@ definitions.push({
110
110
111
111
// Example: Adds attribute 'aria-label' based on the property 'aria-label' to 'anchor' component's part.
112
112
definitions . push ( {
113
- regexp : / A d d s a t t r i b u t e ' ( [ a - z - ] + ) ' b a s e d o n t h e p r o p e r t y ' ( [ a - z - ] + ) ' t o ' ( [ a - z - ] + ) ' c o m p o n e n t ' s p a r t \. / g,
113
+ regexp : / A d d s a t t r i b u t e ' ( [ \w - ] + ) ' b a s e d o n t h e p r o p e r t y ' ( [ \w - ] + ) ' t o ' ( [ \w - ] + ) ' c o m p o n e n t ' s p a r t \. / g,
114
114
testMethod : ( parameters : TestMethod ) => {
115
115
const [ attributeToBeAdded , propertyDependingOn , elementWhereToBeAdded ] = [ ...parameters . props ]
116
116
const property = { }
@@ -127,7 +127,7 @@ definitions.push({
127
127
128
128
// Adds attribute 'aria-selected=true' to 'anchor' component's part based on the property 'active'. This can be overriden by directly providing 'aria-selected' property to the component.
129
129
definitions . push ( {
130
- regexp : / A d d s a t t r i b u t e ' ( [ a - z A - Z - ] + ) = ( [ a - z 0 - 9 ] + ) ' t o ' ( [ a - z - ] + ) ' c o m p o n e n t ' s p a r t b a s e d o n t h e p r o p e r t y ' [ a - z ] + ' \. T h i s c a n b e o v e r r i d e n b y p r o v i d i n g ' ( [ a - z - ] + ) ' p r o p e r t y d i r e c t l y t o t h e c o m p o n e n t \. / g,
130
+ regexp : / A d d s a t t r i b u t e ' ( [ \w - ] + ) = ( [ \w \d ] + ) ' t o ' ( [ \w - ] + ) ' c o m p o n e n t ' s p a r t b a s e d o n t h e p r o p e r t y ' \w + ' \. T h i s c a n b e o v e r r i d e n b y p r o v i d i n g ' ( [ \w - ] + ) ' p r o p e r t y d i r e c t l y t o t h e c o m p o n e n t \. / g,
131
131
testMethod : ( parameters : TestMethod ) => {
132
132
const [ attributeToBeAdded , valueOfAttributeToBeAdded , component , overridingProperty ] = [
133
133
...parameters . props ,
@@ -146,7 +146,7 @@ definitions.push({
146
146
147
147
// Example: Adds attribute 'aria-disabled=true' based on the property 'disabled'. This can be overriden by providing 'aria-disabled' property directly to the component.
148
148
definitions . push ( {
149
- regexp : / A d d s a t t r i b u t e ' ( [ a - z A - Z - ] + ) = ( [ a - z 0 - 9 ] + ) ' b a s e d o n t h e p r o p e r t y ' [ a - z ] + ' \. T h i s c a n b e o v e r r i d e n b y p r o v i d i n g ' ( [ a - z - ] + ) ' p r o p e r t y d i r e c t l y t o t h e c o m p o n e n t \. / g,
149
+ regexp : / A d d s a t t r i b u t e ' ( [ \w - ] + ) = ( [ \w \d ] + ) ' b a s e d o n t h e p r o p e r t y ' \w + ' \. T h i s c a n b e o v e r r i d e n b y p r o v i d i n g ' ( [ \w - ] + ) ' p r o p e r t y d i r e c t l y t o t h e c o m p o n e n t \. / g,
150
150
testMethod : ( parameters : TestMethod ) => {
151
151
const [ attributeToBeAdded , valueOfAttributeToBeAdded , overridingProperty ] = [
152
152
...parameters . props ,
@@ -188,7 +188,7 @@ function testMethodConditionallyAddAttribute(
188
188
189
189
// Example: Adds attribute 'aria-disabled=true' to 'trigger' component's part if 'disabled' property is true. Does not set the attribute otherwise.
190
190
definitions . push ( {
191
- regexp : / A d d s a t t r i b u t e ' ( [ a - z A - Z - ] + ) = ( [ a - z 0 - 9 ] + ) ' t o ' ( [ a - z - ] + ) ' c o m p o n e n t ' s p a r t i f ' ( [ a - z - ] + ) ' p r o p e r t y i s t r u e \. D o e s n o t s e t t h e a t t r i b u t e o t h e r w i s e \. / g,
191
+ regexp : / A d d s a t t r i b u t e ' ( [ \w - ] + ) = ( [ \w \d ] + ) ' t o ' ( [ \w - ] + ) ' c o m p o n e n t ' s p a r t i f ' ( [ \w - ] + ) ' p r o p e r t y i s t r u e \. D o e s n o t s e t t h e a t t r i b u t e o t h e r w i s e \. / g,
192
192
testMethod : ( parameters : TestMethod ) => {
193
193
const [ attributeToBeAdded , valueOfAttributeToBeAdded , component , propertyDependsOn ] = [
194
194
...parameters . props ,
@@ -208,7 +208,7 @@ definitions.push({
208
208
209
209
// Example: Adds attribute 'aria-disabled=true' to 'trigger' component's part if 'disabled' property is true. Sets the attribute to 'false' otherwise.
210
210
definitions . push ( {
211
- regexp : / A d d s a t t r i b u t e ' ( [ a - z A - Z - ] + ) = ( [ a - z 0 - 9 ] + ) ' t o ' ( [ a - z - ] + ) ' c o m p o n e n t ' s p a r t i f ' ( [ a - z - ] + ) ' p r o p e r t y i s t r u e \. S e t s t h e a t t r i b u t e t o ' ( [ a - z 0 - 9 ] + ) ' o t h e r w i s e \. / g,
211
+ regexp : / A d d s a t t r i b u t e ' ( [ \w - ] + ) = ( [ \w \d ] + ) ' t o ' ( [ \w - ] + ) ' c o m p o n e n t ' s p a r t i f ' ( [ \w - ] + ) ' p r o p e r t y i s t r u e \. S e t s t h e a t t r i b u t e t o ' ( [ \w \d ] + ) ' o t h e r w i s e \. / g,
212
212
testMethod : ( parameters : TestMethod ) => {
213
213
const [
214
214
attributeToBeAdded ,
@@ -232,7 +232,7 @@ definitions.push({
232
232
233
233
// Adds attribute 'aria-haspopup=true' to 'root' component's part if 'menu' menu property is set.
234
234
definitions . push ( {
235
- regexp : / A d d s a t t r i b u t e ' ( [ a - z A - Z - ] + ) = ( [ a - z 0 - 9 ] + ) ' t o ' ( [ a - z - ] + ) ' c o m p o n e n t ' s p a r t i f ' ( [ a - z - ] + ) ' p r o p e r t y i s s e t \. / g,
235
+ regexp : / A d d s a t t r i b u t e ' ( [ \w - ] + ) = ( [ \w \d ] + ) ' t o ' ( [ \w - ] + ) ' c o m p o n e n t ' s p a r t i f ' ( [ \w - ] + ) ' p r o p e r t y i s s e t \. / g,
236
236
testMethod : ( parameters : TestMethod ) => {
237
237
const [
238
238
attributeToBeAdded ,
@@ -256,7 +256,7 @@ definitions.push({
256
256
257
257
// Example: Adds attribute 'aria-hidden=true', if there is no 'alt' property provided.
258
258
definitions . push ( {
259
- regexp : / A d d s a t t r i b u t e ' ( [ \w \- \w \s * ] + ) = ( [ a - z ] + ) ' , i f t h e r e i s n o ' a l t ' p r o p e r t y p r o v i d e d \. + / g,
259
+ regexp : / A d d s a t t r i b u t e ' ( [ \w - ] + ) = ( \w + ) ' , i f t h e r e i s n o ' a l t ' p r o p e r t y p r o v i d e d \. / g,
260
260
testMethod : ( parameters : TestMethod ) => {
261
261
const [ attributeToBeAdded , attributeExpectedValue ] = [ ...parameters . props ]
262
262
const property = { }
@@ -277,7 +277,7 @@ definitions.push({
277
277
278
278
// Example: Adds attribute 'aria-expanded=true' based on the property 'open' if the component has 'hasSubtree' property.
279
279
definitions . push ( {
280
- regexp : / A d d s a t t r i b u t e ' ( [ \w \- \w \s * ] + ) = ( [ a - z ] + ) ' b a s e d o n t h e p r o p e r t y ' ( [ a - z ] + ) ' i f t h e c o m p o n e n t h a s ' ( [ a - z A - Z ] + ) ' p r o p e r t y ./ g,
280
+ regexp : / A d d s a t t r i b u t e ' ( [ \w - ] + ) = ( \w + ) ' b a s e d o n t h e p r o p e r t y ' ( \w + ) ' i f t h e c o m p o n e n t h a s ' ( \w + ) ' p r o p e r t y \ ./ g,
281
281
testMethod : ( parameters : TestMethod ) => {
282
282
const [
283
283
attributeToBeAdded ,
@@ -319,7 +319,7 @@ definitions.push({
319
319
320
320
// Example: Adds role='button' if element type is other than 'button'.
321
321
definitions . push ( {
322
- regexp : / A d d s r o l e = ' ( [ a - z ] + ) ' i f e l e m e n t t y p e i s o t h e r t h a n ' [ a - z ] + ' \. + / g,
322
+ regexp : / A d d s r o l e = ' ( \w + ) ' i f e l e m e n t t y p e i s o t h e r t h a n ' \w + ' \. / g,
323
323
testMethod : ( parameters : TestMethod ) => {
324
324
const [ roleToBeAdded ] = [ ...parameters . props ]
325
325
const property = { }
@@ -338,7 +338,7 @@ definitions.push({
338
338
339
339
// Embeds FocusZone into component allowing arrow key navigation through the children of the component.
340
340
definitions . push ( {
341
- regexp : / E m b e d s F o c u s Z o n e i n t o c o m p o n e n t a l l o w i n g a r r o w k e y n a v i g a t i o n t h r o u g h t h e c h i l d r e n o f t h e c o m p o n e n t \. + / g,
341
+ regexp : / E m b e d s F o c u s Z o n e i n t o c o m p o n e n t a l l o w i n g a r r o w k e y n a v i g a t i o n t h r o u g h t h e c h i l d r e n o f t h e c o m p o n e n t \. / g,
342
342
testMethod : ( parameters : TestMethod ) => {
343
343
const actualFocusZone = parameters . behavior ( { } ) . focusZone
344
344
@@ -356,7 +356,7 @@ definitions.push({
356
356
357
357
// [Circular navigation] Embeds FocusZone into component allowing circular arrow key navigation through the children of the component.
358
358
definitions . push ( {
359
- regexp : / E m b e d s F o c u s Z o n e i n t o c o m p o n e n t a l l o w i n g c i r c u l a r a r r o w k e y n a v i g a t i o n t h r o u g h t h e c h i l d r e n o f t h e c o m p o n e n t \. + / g,
359
+ regexp : / E m b e d s F o c u s Z o n e i n t o c o m p o n e n t a l l o w i n g c i r c u l a r a r r o w k e y n a v i g a t i o n t h r o u g h t h e c h i l d r e n o f t h e c o m p o n e n t \. / g,
360
360
testMethod : ( parameters : TestMethod ) => {
361
361
const actualFocusZone = parameters . behavior ( { } ) . focusZone
362
362
@@ -374,7 +374,7 @@ definitions.push({
374
374
375
375
// Wraps component in FocusZone allowing arrow key navigation through the children of the component.
376
376
definitions . push ( {
377
- regexp : / W r a p s c o m p o n e n t i n F o c u s Z o n e a l l o w i n g a r r o w k e y n a v i g a t i o n t h r o u g h t h e c h i l d r e n o f t h e c o m p o n e n t \. + / g,
377
+ regexp : / W r a p s c o m p o n e n t i n F o c u s Z o n e a l l o w i n g a r r o w k e y n a v i g a t i o n t h r o u g h t h e c h i l d r e n o f t h e c o m p o n e n t \. / g,
378
378
testMethod : ( parameters : TestMethod ) => {
379
379
const actualFocusZone = parameters . behavior ( { } ) . focusZone
380
380
@@ -392,7 +392,7 @@ definitions.push({
392
392
393
393
// [Circular navigation] Wraps component in FocusZone allowing circular arrow key navigation through the children of the component.
394
394
definitions . push ( {
395
- regexp : / W r a p s c o m p o n e n t i n F o c u s Z o n e a l l o w i n g c i r c u l a r a r r o w k e y n a v i g a t i o n t h r o u g h t h e c h i l d r e n o f t h e c o m p o n e n t \. + / g,
395
+ regexp : / W r a p s c o m p o n e n t i n F o c u s Z o n e a l l o w i n g c i r c u l a r a r r o w k e y n a v i g a t i o n t h r o u g h t h e c h i l d r e n o f t h e c o m p o n e n t \. / g,
396
396
testMethod : ( parameters : TestMethod ) => {
397
397
const actualFocusZone = parameters . behavior ( { } ) . focusZone
398
398
@@ -440,7 +440,7 @@ definitions.push({
440
440
441
441
// Triggers 'click' action with 'Enter' or 'Spacebar' on 'root'.
442
442
definitions . push ( {
443
- regexp : / T r i g g e r s ' ( [ a - z A - Z ] + ) ' a c t i o n w i t h ' ( [ a - z A - Z ] + ) ' o r ' ( [ a - z A - Z ] + ) ' o n ' ( [ a - z A - Z ] + ) ' \. + / g,
443
+ regexp : / T r i g g e r s ' ( \w + ) ' a c t i o n w i t h ' ( \w + ) ' o r ' ( \w + ) ' o n ' ( \w + ) ' \. / g,
444
444
testMethod : ( parameters : TestMethod ) => {
445
445
const [ action , firstKey , secondKey , elementToPerformAction ] = [ ...parameters . props ]
446
446
const property = { }
@@ -457,7 +457,7 @@ definitions.push({
457
457
458
458
// Triggers 'closeAllMenus' action with 'Escape' on 'root'.
459
459
definitions . push ( {
460
- regexp : / T r i g g e r s ' ( [ a - z A - Z ] + ) ' a c t i o n w i t h ' ( [ a - z A - Z ] + ) ' o n ' ( [ a - z A - Z ] + ) ' \. + / g,
460
+ regexp : / T r i g g e r s ' ( \w + ) ' a c t i o n w i t h ' ( \w + ) ' o n ' ( \w + ) ' \. / g,
461
461
testMethod : ( parameters : TestMethod ) => {
462
462
const [ action , key , elementToPerformAction ] = [ ...parameters . props ]
463
463
const property = { }
@@ -470,7 +470,7 @@ definitions.push({
470
470
471
471
// Triggers 'openMenu' action with 'ArrowDown' on 'root', when orientaton is horizontal.
472
472
definitions . push ( {
473
- regexp : / T r i g g e r s ' ( [ a - z A - Z ] + ) ' a c t i o n w i t h ' ( [ a - z A - Z ] + ) ' o n ' ( [ a - z A - Z ] + ) ' , w h e n o r i e n t a t i o n i s h o r i z o n t a l \. + / g,
473
+ regexp : / T r i g g e r s ' ( \w + ) ' a c t i o n w i t h ' ( \w + ) ' o n ' ( [ \w - ] + ) ' , w h e n o r i e n t a t i o n i s h o r i z o n t a l \. / g,
474
474
testMethod : ( parameters : TestMethod ) => {
475
475
const [ action , key , elementToPerformAction ] = [ ...parameters . props ]
476
476
const property = { }
@@ -483,7 +483,7 @@ definitions.push({
483
483
484
484
// Triggers 'openMenu' action with 'ArrowRight' on 'root', when orientation is vertical.
485
485
definitions . push ( {
486
- regexp : / T r i g g e r s ' ( [ a - z A - Z ] + ) ' a c t i o n w i t h ' ( [ a - z A - Z ] + ) ' o n ' ( [ a - z A - Z ] + ) ' , w h e n o r i e n t a t i o n i s v e r t i c a l \. + / g,
486
+ regexp : / T r i g g e r s ' ( \w + ) ' a c t i o n w i t h ' ( \w + ) ' o n ' ( [ \w - ] + ) ' , w h e n o r i e n t a t i o n i s v e r t i c a l \. / g,
487
487
testMethod : ( parameters : TestMethod ) => {
488
488
const [ action , key , elementToPerformAction ] = [ ...parameters . props ]
489
489
const propertyVertical = { vertical : true }
@@ -496,7 +496,7 @@ definitions.push({
496
496
497
497
// Implements roving tabIndex
498
498
definitions . push ( {
499
- regexp : / I m p l e m e n t s r o v i n g t a b I n d e x . + / g,
499
+ regexp : / I m p l e m e n t s r o v i n g t a b I n d e x \. / g,
500
500
testMethod : ( parameters : TestMethod ) => {
501
501
const propertyChecked = { checked : true }
502
502
const propertyNotChecked = { checked : false }
0 commit comments