2019-02-19 03:55:44 +00:00
|
|
|
import {
|
|
|
|
accountProfileMoreOptionsButton,
|
2019-03-24 01:16:20 +00:00
|
|
|
confirmationDialogCancelButton, getNthStatus,
|
2019-02-19 03:55:44 +00:00
|
|
|
getNthStatusOptionsButton,
|
|
|
|
modalDialog
|
|
|
|
} from '../utils'
|
|
|
|
import { loginAsFoobar } from '../roles'
|
|
|
|
import { Selector as $ } from 'testcafe'
|
|
|
|
|
|
|
|
fixture`028-report-ui.js`
|
|
|
|
.page`http://localhost:4002`
|
|
|
|
|
|
|
|
test('Can open a report UI from a status', async t => {
|
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
2019-03-24 01:16:20 +00:00
|
|
|
.hover(getNthStatus(1))
|
2019-02-28 16:56:25 +00:00
|
|
|
.click(getNthStatusOptionsButton(1))
|
2019-02-19 03:55:44 +00:00
|
|
|
.click($('.modal-dialog button').withText('Report'))
|
|
|
|
.expect(modalDialog.innerText).contains('You are reporting @quux')
|
2019-03-24 01:16:20 +00:00
|
|
|
.expect(modalDialog.find('.recent-statuses').innerText).contains('pinned toot 2', {
|
|
|
|
timeout: 30000
|
|
|
|
})
|
2019-02-19 03:55:44 +00:00
|
|
|
.click(confirmationDialogCancelButton)
|
|
|
|
.expect(modalDialog.exists).notOk()
|
|
|
|
})
|
|
|
|
|
|
|
|
test('Can open a report UI from an account', async t => {
|
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
|
|
|
.navigateTo('/accounts/3')
|
|
|
|
.click(accountProfileMoreOptionsButton)
|
|
|
|
.click($('.modal-dialog button').withText('Report'))
|
|
|
|
.expect(modalDialog.innerText).contains('You are reporting @quux')
|
2019-03-24 01:16:20 +00:00
|
|
|
.expect(modalDialog.find('.recent-statuses').innerText).contains('pinned toot 2', {
|
|
|
|
timeout: 30000
|
|
|
|
})
|
2019-02-19 03:55:44 +00:00
|
|
|
.click(confirmationDialogCancelButton)
|
|
|
|
.expect(modalDialog.exists).notOk()
|
|
|
|
})
|