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