1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-15 11:48:35 +01:00
Pinafore-Web-Client-Frontend/tests/spec/008-status-media.js
2018-03-06 21:32:51 -08:00

35 lines
1.4 KiB
JavaScript

import { closeDialogButton, getNthStatus, modalDialogContents, scrollToStatus } from '../utils'
import { foobarRole } from '../roles'
fixture`008-status-media.js`
.page`http://localhost:4002`
test('shows sensitive images and videos', async t => {
await t.useRole(foobarRole)
await scrollToStatus(t, 7)
await t.expect(getNthStatus(7).find('.status-media img').exists).notOk()
.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()
})
test('click and close image and video modals', async t => {
await t.useRole(foobarRole)
await scrollToStatus(t, 9)
await t.expect(modalDialogContents.exists).notOk()
.click(getNthStatus(9).find('.play-video-button'))
.expect(modalDialogContents.exists).ok()
.click(closeDialogButton)
.expect(modalDialogContents.exists).notOk()
.hover(getNthStatus(11))
.hover(getNthStatus(12))
.click(getNthStatus(12).find('.show-image-button'))
.expect(modalDialogContents.exists).ok()
.click(closeDialogButton)
.expect(modalDialogContents.exists).notOk()
})