1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-12 02:07:26 +01:00

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

View File

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