@@ -93,22 +93,30 @@ test('create a default poll', function(assert) {
93
93
[ false , true , true , true , true ] ,
94
94
'status bar has correct items disabled (index)'
95
95
) ;
96
+ assert . ok (
97
+ pageCreateIndex . pollTypeHasFocus ,
98
+ 'poll type selection has autofocus'
99
+ ) ;
96
100
97
101
pageCreateIndex
98
102
. next ( ) ;
99
103
100
104
andThen ( function ( ) {
101
105
assert . equal ( currentPath ( ) , 'create.meta' ) ;
102
106
assert . equal (
103
- pageCreateIndex . statusBar ( ) . active ,
107
+ pageCreateMeta . statusBar ( ) . active ,
104
108
t ( 'create.formStep.meta' ) . toString ( ) ,
105
109
'status bar shows correct item as current path (meta)'
106
110
) ;
107
111
assert . deepEqual (
108
- pageCreateIndex . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
112
+ pageCreateMeta . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
109
113
[ false , false , true , true , true ] ,
110
114
'status bar has correct items disabled (meta)'
111
115
) ;
116
+ assert . ok (
117
+ pageCreateMeta . titleHasFocus ,
118
+ 'title input has autofocus'
119
+ ) ;
112
120
113
121
pageCreateMeta
114
122
. title ( 'default poll' )
@@ -117,12 +125,12 @@ test('create a default poll', function(assert) {
117
125
andThen ( function ( ) {
118
126
assert . equal ( currentPath ( ) , 'create.options' ) ;
119
127
assert . equal (
120
- pageCreateIndex . statusBar ( ) . active ,
128
+ pageCreateOptions . statusBar ( ) . active ,
121
129
t ( 'create.formStep.options.days' ) . toString ( ) ,
122
130
'status bar shows correct item as current path (options.days)'
123
131
) ;
124
132
assert . deepEqual (
125
- pageCreateIndex . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
133
+ pageCreateOptions . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
126
134
[ false , false , false , true , true ] ,
127
135
'status bar has correct items disabled (options)'
128
136
) ;
@@ -135,31 +143,39 @@ test('create a default poll', function(assert) {
135
143
andThen ( function ( ) {
136
144
assert . equal ( currentPath ( ) , 'create.options-datetime' ) ;
137
145
assert . equal (
138
- pageCreateIndex . statusBar ( ) . active ,
146
+ pageCreateOptionsDatetime . statusBar ( ) . active ,
139
147
t ( 'create.formStep.options-datetime' ) . toString ( ) ,
140
148
'status bar shows correct item as current path (options-datetime)'
141
149
) ;
142
150
assert . deepEqual (
143
- pageCreateIndex . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
151
+ pageCreateOptionsDatetime . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
144
152
[ false , false , false , false , true ] ,
145
153
'status bar has correct items disabled (options-datetime)'
146
154
) ;
155
+ assert . ok (
156
+ pageCreateOptionsDatetime . firstTime . inputHasFocus ,
157
+ 'first time input has autofocus'
158
+ ) ;
147
159
148
160
pageCreateOptionsDatetime
149
161
. next ( ) ;
150
162
151
163
andThen ( ( ) => {
152
164
assert . equal ( currentPath ( ) , 'create.settings' ) ;
153
165
assert . equal (
154
- pageCreateIndex . statusBar ( ) . active ,
166
+ pageCreateSettings . statusBar ( ) . active ,
155
167
t ( 'create.formStep.settings' ) . toString ( ) ,
156
168
'status bar shows correct item as current path (settings)'
157
169
) ;
158
170
assert . deepEqual (
159
- pageCreateIndex . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
171
+ pageCreateSettings . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
160
172
[ false , false , false , false , false ] ,
161
173
'status bar has correct items disabled (settings)'
162
174
) ;
175
+ assert . ok (
176
+ pageCreateSettings . availableAnswersHasFocus ,
177
+ 'available answers selection has autofocus'
178
+ ) ;
163
179
164
180
pageCreateSettings
165
181
. next ( ) ;
@@ -197,6 +213,10 @@ test('create a default poll', function(assert) {
197
213
] ,
198
214
'answers are correctly labeled'
199
215
) ;
216
+ assert . ok (
217
+ pagePollParticipation . nameHasFocus ,
218
+ 'name input has autofocus'
219
+ ) ;
200
220
} ) ;
201
221
} ) ;
202
222
} ) ;
@@ -228,12 +248,12 @@ test('create a poll for answering a question', function(assert) {
228
248
andThen ( function ( ) {
229
249
assert . equal ( currentPath ( ) , 'create.meta' ) ;
230
250
assert . equal (
231
- pageCreateIndex . statusBar ( ) . active ,
251
+ pageCreateMeta . statusBar ( ) . active ,
232
252
t ( 'create.formStep.meta' ) . toString ( ) ,
233
253
'status bar shows correct item as current path (meta)'
234
254
) ;
235
255
assert . deepEqual (
236
- pageCreateIndex . statusBar ( ) . toArray ( ) . map ( ( el ) => el . text ) ,
256
+ pageCreateMeta . statusBar ( ) . toArray ( ) . map ( ( el ) => el . text ) ,
237
257
[
238
258
t ( 'create.formStep.type' ) . toString ( ) ,
239
259
t ( 'create.formStep.meta' ) . toString ( ) ,
@@ -243,7 +263,7 @@ test('create a poll for answering a question', function(assert) {
243
263
'status bar has correct items'
244
264
) ;
245
265
assert . deepEqual (
246
- pageCreateIndex . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
266
+ pageCreateMeta . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
247
267
[ false , false , true , true ] ,
248
268
'status bar has correct items disabled (meta)'
249
269
) ;
@@ -255,16 +275,20 @@ test('create a poll for answering a question', function(assert) {
255
275
andThen ( function ( ) {
256
276
assert . equal ( currentPath ( ) , 'create.options' ) ;
257
277
assert . equal (
258
- pageCreateIndex . statusBar ( ) . active ,
278
+ pageCreateOptions . statusBar ( ) . active ,
259
279
t ( 'create.formStep.options.text' ) . toString ( ) ,
260
280
'status bar shows correct item as current path (options.text)'
261
281
) ;
262
282
assert . deepEqual (
263
- pageCreateIndex . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
283
+ pageCreateOptions . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
264
284
[ false , false , false , true ] ,
265
285
'status bar has correct items disabled (options)'
266
286
) ;
267
287
expectComponent ( 'create-options-text' ) ;
288
+ assert . ok (
289
+ pageCreateOptions . firstTextOption . inputHasFocus ,
290
+ 'first option input has autofocus'
291
+ ) ;
268
292
269
293
assert . equal (
270
294
pageCreateOptions . textOptions ( ) . count ,
@@ -281,7 +305,7 @@ test('create a poll for answering a question', function(assert) {
281
305
'validation errors prevents transition'
282
306
) ;
283
307
assert . equal (
284
- pageCreateIndex . statusBar ( ) . active ,
308
+ pageCreateOptions . statusBar ( ) . active ,
285
309
t ( 'create.formStep.options.text' ) . toString ( ) ,
286
310
'status bar shows correct item as current path (options.text)'
287
311
) ;
@@ -333,12 +357,12 @@ test('create a poll for answering a question', function(assert) {
333
357
andThen ( function ( ) {
334
358
assert . equal ( currentPath ( ) , 'create.settings' ) ;
335
359
assert . equal (
336
- pageCreateIndex . statusBar ( ) . active ,
360
+ pageCreateSettings . statusBar ( ) . active ,
337
361
t ( 'create.formStep.settings' ) . toString ( ) ,
338
362
'status bar shows correct item as current path (settings)'
339
363
) ;
340
364
assert . deepEqual (
341
- pageCreateIndex . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
365
+ pageCreateSettings . statusBar ( ) . toArray ( ) . map ( ( el ) => el . isDisabled ) ,
342
366
[ false , false , false , false ] ,
343
367
'status bar has correct items disabled (settings)'
344
368
) ;
0 commit comments