2018-05-26 21:51:41 +01:00
|
|
|
import { loginAsFoobar } from '../roles'
|
2018-03-10 06:31:26 +00:00
|
|
|
import {
|
2018-03-30 09:06:17 +01:00
|
|
|
composeInput, getNthComposeReplyButton, getNthComposeReplyInput, getNthReplyButton, getNthStatus, getUrl,
|
|
|
|
homeNavButton, notificationsNavButton,
|
2018-03-10 06:31:26 +00:00
|
|
|
postStatusButton
|
|
|
|
} from '../utils'
|
|
|
|
|
|
|
|
fixture`103-compose.js`
|
|
|
|
.page`http://localhost:4002`
|
|
|
|
|
|
|
|
test('statuses show up in home timeline', async t => {
|
2018-05-26 21:51:41 +01:00
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
2018-08-30 05:42:57 +01:00
|
|
|
.typeText(composeInput, 'hello world', { paste: true })
|
2018-03-10 06:31:26 +00:00
|
|
|
.click(postStatusButton)
|
2019-02-28 16:56:25 +00:00
|
|
|
.expect(getNthStatus(1).innerText).contains('hello world')
|
2018-03-10 06:31:26 +00:00
|
|
|
.click(notificationsNavButton)
|
|
|
|
.expect(getUrl()).contains('/notifications')
|
|
|
|
.click(homeNavButton)
|
|
|
|
.expect(getUrl()).eql('http://localhost:4002/')
|
2019-02-28 16:56:25 +00:00
|
|
|
.expect(getNthStatus(1).innerText).contains('hello world')
|
2018-03-10 06:31:26 +00:00
|
|
|
.navigateTo('/')
|
2019-02-28 16:56:25 +00:00
|
|
|
.expect(getNthStatus(1).innerText).contains('hello world')
|
2018-03-10 06:31:26 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
test('statuses in threads show up in right order', async t => {
|
2018-05-26 21:51:41 +01:00
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
2018-03-10 06:31:26 +00:00
|
|
|
.navigateTo('/accounts/5')
|
2019-02-28 16:56:25 +00:00
|
|
|
.click(getNthStatus(3))
|
2018-03-10 06:31:26 +00:00
|
|
|
.expect(getUrl()).contains('/statuses')
|
2019-02-28 16:56:25 +00:00
|
|
|
.click(getNthReplyButton(4))
|
|
|
|
.typeText(getNthComposeReplyInput(4), 'my reply!', { paste: true })
|
|
|
|
.click(getNthComposeReplyButton(4))
|
|
|
|
.expect(getNthComposeReplyInput(4).exists).notOk()
|
|
|
|
.expect(getNthStatus(6).innerText).contains('@baz my reply!')
|
2018-03-10 06:31:26 +00:00
|
|
|
.navigateTo('/accounts/5')
|
2019-02-28 16:56:25 +00:00
|
|
|
.click(getNthStatus(3))
|
|
|
|
.expect(getNthStatus(6).innerText).contains('@baz my reply!')
|
2018-03-10 06:31:26 +00:00
|
|
|
})
|