test: improve flakiness of report ui test (#1117)

This commit is contained in:
Nolan Lawson 2019-03-23 18:16:20 -07:00 committed by GitHub
parent 059b455451
commit 5a9d047019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import {
accountProfileMoreOptionsButton,
confirmationDialogCancelButton,
confirmationDialogCancelButton, getNthStatus,
getNthStatusOptionsButton,
modalDialog
} from '../utils'
@ -13,10 +13,13 @@ fixture`028-report-ui.js`
test('Can open a report UI from a status', async t => {
await loginAsFoobar(t)
await t
.hover(getNthStatus(1))
.click(getNthStatusOptionsButton(1))
.click($('.modal-dialog button').withText('Report'))
.expect(modalDialog.innerText).contains('You are reporting @quux')
.expect(modalDialog.find('.recent-statuses').innerText).contains('pinned toot 2')
.expect(modalDialog.find('.recent-statuses').innerText).contains('pinned toot 2', {
timeout: 30000
})
.click(confirmationDialogCancelButton)
.expect(modalDialog.exists).notOk()
})
@ -28,7 +31,9 @@ test('Can open a report UI from an account', async t => {
.click(accountProfileMoreOptionsButton)
.click($('.modal-dialog button').withText('Report'))
.expect(modalDialog.innerText).contains('You are reporting @quux')
.expect(modalDialog.find('.recent-statuses').innerText).contains('pinned toot 2')
.expect(modalDialog.find('.recent-statuses').innerText).contains('pinned toot 2', {
timeout: 30000
})
.click(confirmationDialogCancelButton)
.expect(modalDialog.exists).notOk()
})