2018-04-12 21:18:14 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								import {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  composeInput, getActiveElementClass,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  getNthComposeReplyButton,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  getNthComposeReplyInput, getNthReplyButton,
							 | 
						
					
						
							
								
									
										
										
										
											2018-06-08 21:54:21 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  getNthStatusSelector
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-12 21:18:14 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								} from '../utils'
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-26 13:51:41 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								import { loginAsFoobar } from '../roles'
							 | 
						
					
						
							
								
									
										
										
										
											2018-06-08 21:54:21 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								import { Selector as $ } from 'testcafe'
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-12 21:18:14 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								fixture`111-focus.js`
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  .page`http://localhost:4002`
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								test('replying to a toot returns focus to reply button', async t => {
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-26 13:51:41 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  await loginAsFoobar(t)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  await t
							 | 
						
					
						
							
								
									
										
										
										
											2018-08-29 21:42:57 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    .typeText(composeInput, 'I would like, if I may, to take you on a strange journey', { paste: true })
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-12 21:18:14 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .pressKey('ctrl+enter')
							 | 
						
					
						
							
								
									
										
										
										
											2018-06-08 21:54:21 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    .expect($(`${getNthStatusSelector(0)} .status-content`).innerText).contains('I would like, if I may, to take you on a strange journey')
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-12 21:18:14 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .click(getNthReplyButton(0))
							 | 
						
					
						
							
								
									
										
										
										
											2018-08-29 21:42:57 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    .typeText(getNthComposeReplyInput(0), 'How strange was it?', { paste: true })
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-12 21:18:14 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .click(getNthComposeReplyButton(0))
							 | 
						
					
						
							
								
									
										
										
										
											2018-08-29 21:42:57 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    .expect(getActiveElementClass()).contains('status-toolbar-reply-button', { timeout: 20000 })
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-12 21:18:14 -07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								})
							 |