2018-02-21 09:26:22 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								import { closeDialogButton, getNthStatus, modalDialogContents, scrollToStatus } from '../utils'
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 09:05:53 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								import { foobarRole } from '../roles'
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-03-06 21:32:51 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								fixture`008-status-media.js`
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 09:05:53 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  .page`http://localhost:4002`
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 09:42:55 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								test('shows sensitive images and videos', async t => {
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 09:05:53 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  await t.useRole(foobarRole)
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-21 09:26:22 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  await scrollToStatus(t, 7)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  await t.expect(getNthStatus(7).find('.status-media img').exists).notOk()
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 21:08:26 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    .click(getNthStatus(7).find('.status-sensitive-media-button'))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(7).find('.status-media img').getAttribute('alt')).eql('kitten')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(7).find('.status-media img').hasAttribute('src')).ok()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .hover(getNthStatus(8))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(8).find('.status-media .play-video-button').exists).notOk()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .click(getNthStatus(8).find('.status-sensitive-media-button'))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(getNthStatus(8).find('.status-media .play-video-button').exists).ok()
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 09:05:53 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								})
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 09:42:55 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								test('click and close image and video modals', async t => {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  await t.useRole(foobarRole)
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-21 09:26:22 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  await scrollToStatus(t, 9)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  await t.expect(modalDialogContents.exists).notOk()
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 21:08:26 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    .click(getNthStatus(9).find('.play-video-button'))
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 09:42:55 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    .expect(modalDialogContents.exists).ok()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .click(closeDialogButton)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(modalDialogContents.exists).notOk()
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 21:08:26 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    .hover(getNthStatus(11))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .hover(getNthStatus(12))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .click(getNthStatus(12).find('.show-image-button'))
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 09:42:55 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    .expect(modalDialogContents.exists).ok()
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .click(closeDialogButton)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    .expect(modalDialogContents.exists).notOk()
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-20 21:30:16 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								})
							 |