1
0
mirror of https://github.com/nolanlawson/pinafore synced 2025-02-10 00:10:47 +01:00

41 lines
1.4 KiB
JavaScript
Raw Normal View History

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