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