2018-04-13 06:18:14 +02:00
|
|
|
import {
|
2019-02-23 18:47:36 +01:00
|
|
|
composeInput, getActiveElementClassList,
|
2018-04-13 06:18:14 +02:00
|
|
|
getNthComposeReplyButton,
|
|
|
|
getNthComposeReplyInput, getNthReplyButton,
|
2018-06-09 06:54:21 +02:00
|
|
|
getNthStatusSelector
|
2018-04-13 06:18:14 +02:00
|
|
|
} from '../utils'
|
2018-05-26 22:51:41 +02:00
|
|
|
import { loginAsFoobar } from '../roles'
|
2018-06-09 06:54:21 +02:00
|
|
|
import { Selector as $ } from 'testcafe'
|
2018-04-13 06:18:14 +02:00
|
|
|
|
|
|
|
fixture`111-focus.js`
|
|
|
|
.page`http://localhost:4002`
|
|
|
|
|
|
|
|
test('replying to a toot returns focus to reply button', async t => {
|
2018-05-26 22:51:41 +02:00
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
2018-08-30 06:42:57 +02:00
|
|
|
.typeText(composeInput, 'I would like, if I may, to take you on a strange journey', { paste: true })
|
2018-04-13 06:18:14 +02:00
|
|
|
.pressKey('ctrl+enter')
|
2019-02-28 17:56:25 +01:00
|
|
|
.expect($(`${getNthStatusSelector(1)} .status-content`).innerText).contains('I would like, if I may, to take you on a strange journey')
|
|
|
|
.click(getNthReplyButton(1))
|
|
|
|
.typeText(getNthComposeReplyInput(1), 'How strange was it?', { paste: true })
|
|
|
|
.click(getNthComposeReplyButton(1))
|
2019-02-23 18:47:36 +01:00
|
|
|
.expect(getActiveElementClassList()).contains('status-toolbar-reply-button', { timeout: 20000 })
|
2018-04-13 06:18:14 +02:00
|
|
|
})
|