2018-02-19 18:24:22 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								import { Selector as $ } from 'testcafe'
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 21:08:26 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								import { getNthStatus } from '../utils'
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-19 18:24:22 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								import { foobarRole } from '../roles'
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-03-06 21:32:51 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								fixture`006-tabindex.js`
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-19 18:25:59 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  .page`http://localhost:4002`
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-19 18:24:22 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								test('shows correct tabindex in home timeline', async t => {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  await t.useRole(foobarRole)
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 21:08:26 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(0).getAttribute('tabindex')).eql('0')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(1).getAttribute('tabindex')).eql('0')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(2).getAttribute('tabindex')).eql('0')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(3).getAttribute('tabindex')).eql('0')
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-19 18:24:22 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								test('shows correct tabindex in notifications', async t => {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  await t.useRole(foobarRole)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .navigateTo('/notifications')
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 21:08:26 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(0).getAttribute('tabindex')).eql('0')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(1).getAttribute('tabindex')).eql('0')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(2).getAttribute('tabindex')).eql('0')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .hover(getNthStatus(2))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(3).getAttribute('tabindex')).eql('0')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(4).getAttribute('tabindex')).eql('0')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .hover(getNthStatus(4))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(5).getAttribute('tabindex')).eql('0')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(6).getAttribute('tabindex')).eql('0')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .hover(getNthStatus(6))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(7).getAttribute('tabindex')).eql('0')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(7).getAttribute('aria-setsize')).eql('8')
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-19 18:24:22 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								})
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								test('shows correct tabindex in pinned statuses', async t => {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  await t.useRole(foobarRole)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .navigateTo('/pinned')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect($('.status-article').getAttribute('tabindex')).eql('0')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect($('.status-article').getAttribute('aria-posinset')).eql('0')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect($('.status-article').getAttribute('aria-setsize')).eql('1')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								})
							 |