@@ -45,8 +45,8 @@ function* surroundingSourceElements(el) {
45
45
46
46
const outputEls = document .querySelectorAll (' article output' );
47
47
48
- function colorFor (index ) {
49
- return [' orange- 500' , ' purple- 500' , ' green- 500' ][index];
48
+ function classNamesFor (index ) {
49
+ return [' border-yellow- 500' , ' border-green- 500 border-dotted ' , ' border-purple- 500 border-double ' ][index]. split ( ' ' ) ;
50
50
}
51
51
52
52
for (const outputEl of outputEls .values ()) {
@@ -65,13 +65,13 @@ for (const outputEl of outputEls.values()) {
65
65
}
66
66
67
67
if (type === ' javascript' ) {
68
- const color = colorFor (javascriptIndex);
68
+ const classNames = classNamesFor (javascriptIndex);
69
69
70
- el .classList .add (' border-l-4' , ` border- ${ color } ` );
70
+ el .classList .add (' border-l-4' , ... classNames );
71
71
72
72
const screen = DOMTesting .within (div);
73
73
const testFunction = new Function (' screen' , ` return ${ code} ` );
74
- testFunction (screen ). classList .add (' border-2 ' , ` border- ${ color } ` );
74
+ []. concat ( testFunction (screen )). forEach ( el => el . classList .add (' border-4 ' , ... classNames) );
75
75
76
76
javascriptIndex++ ;
77
77
}
@@ -167,19 +167,31 @@ screen.getByRole('list');
167
167
168
168
``` html
169
169
<dl >
170
- <dt >Name</dt >
171
- <dd >The Lion King</dd >
170
+ <dt id = movie-1-name >Name</dt >
171
+ <dd aria-labelledby = movie-1-name >The Lion King</dd >
172
172
173
- <dt >Year Released</dt >
174
- <dd >1994</dd >
173
+ <dt id = movie-1-year >Year Released</dt >
174
+ <dd aria-labelledby = movie-1-year >1994</dd >
175
175
176
- <dt >Runtime</dt >
177
- <dd >88 min</dd >
176
+ <dt id = movie-1-runtime >Runtime</dt >
177
+ <dd aria-labelledby = movie-1-runtime >88 min</dd >
178
178
</dl >
179
179
```
180
180
181
181
<output ></output >
182
182
183
+ ``` javascript
184
+ screen .getByRole (' definition' , { name: ' Name' });
185
+ ```
186
+
187
+ ``` javascript
188
+ screen .getByRole (' definition' , { name: ' Year Released' });
189
+ ```
190
+
191
+ ``` javascript
192
+ screen .getByRole (' definition' , { name: ' Runtime' });
193
+ ```
194
+
183
195
## Images
184
196
185
197
``` html
0 commit comments