test: add tests for image/video modals (#1045)

should ensure #1042 does not happen again
This commit is contained in:
Nolan Lawson 2019-02-23 21:10:15 -08:00 committed by GitHub
parent df8c49cb57
commit d711b37165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -34,12 +34,16 @@ test('click and close image and video modals', async t => {
await t.expect(modalDialogContents.exists).notOk() await t.expect(modalDialogContents.exists).notOk()
.click($(`${getNthStatusSelector(videoIdx)} .play-video-button`)) .click($(`${getNthStatusSelector(videoIdx)} .play-video-button`))
.expect(modalDialogContents.exists).ok() .expect(modalDialogContents.exists).ok()
.expect($('.modal-dialog video').getAttribute('src')).contains('mp4')
.expect($('.modal-dialog video').getAttribute('poster')).contains('png')
.click(closeDialogButton) .click(closeDialogButton)
.expect(modalDialogContents.exists).notOk() .expect(modalDialogContents.exists).notOk()
.hover(getNthStatus(kittenIdx - 1)) .hover(getNthStatus(kittenIdx - 1))
.hover(getNthStatus(kittenIdx)) .hover(getNthStatus(kittenIdx))
.click($(`${getNthStatusSelector(kittenIdx)} .show-image-button`)) .click($(`${getNthStatusSelector(kittenIdx)} .show-image-button`))
.expect(modalDialogContents.exists).ok() .expect(modalDialogContents.exists).ok()
.expect($('.modal-dialog video').getAttribute('src')).contains('mp4')
.expect($('.modal-dialog video').getAttribute('poster')).contains('png')
.click(closeDialogButton) .click(closeDialogButton)
.expect(modalDialogContents.exists).notOk() .expect(modalDialogContents.exists).notOk()
}) })