2018-04-13 04:18:14 +00:00
|
|
|
import {
|
|
|
|
composeInput, getActiveElementClass,
|
|
|
|
getNthComposeReplyButton,
|
|
|
|
getNthComposeReplyInput, getNthReplyButton,
|
|
|
|
getNthStatus
|
|
|
|
} from '../utils'
|
2018-05-26 20:51:41 +00:00
|
|
|
import { loginAsFoobar } from '../roles'
|
2018-04-13 04:18:14 +00:00
|
|
|
|
|
|
|
fixture`111-focus.js`
|
|
|
|
.page`http://localhost:4002`
|
|
|
|
|
|
|
|
test('replying to a toot returns focus to reply button', async t => {
|
2018-05-26 20:51:41 +00:00
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
2018-04-13 04:18:14 +00:00
|
|
|
.typeText(composeInput, 'I would like, if I may, to take you on a strange journey', {paste: true})
|
|
|
|
.pressKey('ctrl+enter')
|
|
|
|
.expect(getNthStatus(0).find('.status-content').innerText).contains('I would like, if I may, to take you on a strange journey')
|
|
|
|
.click(getNthReplyButton(0))
|
|
|
|
.typeText(getNthComposeReplyInput(0), 'How strange was it?', {paste: true})
|
|
|
|
.click(getNthComposeReplyButton(0))
|
|
|
|
.expect(getActiveElementClass()).contains('status-toolbar-reply-button', {timeout: 20000})
|
|
|
|
})
|