2018-05-26 22:51:41 +02:00
|
|
|
import { loginAsFoobar } from '../roles'
|
2018-03-19 18:09:05 +01:00
|
|
|
import {
|
|
|
|
getNthStatus, homeNavButton, localTimelineNavButton, sleep
|
|
|
|
} from '../utils'
|
|
|
|
import {
|
|
|
|
postAs
|
|
|
|
} from '../serverActions'
|
|
|
|
|
|
|
|
fixture`107-streaming-gap.js`
|
|
|
|
.page`http://localhost:4002`
|
|
|
|
|
|
|
|
test('fills in a status posted while away from timeline', async t => {
|
2018-03-20 02:00:49 +01:00
|
|
|
let timeout = 30000
|
2018-03-19 18:09:05 +01:00
|
|
|
|
2018-05-26 22:51:41 +02:00
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
2018-03-19 18:09:05 +01:00
|
|
|
.click(localTimelineNavButton)
|
2019-02-28 17:56:25 +01:00
|
|
|
.expect(getNthStatus(1).exists).ok({ timeout })
|
|
|
|
.hover(getNthStatus(1))
|
2018-03-19 18:09:05 +01:00
|
|
|
await postAs('admin', 'heyo')
|
2019-02-28 17:56:25 +01:00
|
|
|
await t.expect(getNthStatus(1).innerText).contains('heyo', { timeout })
|
2018-03-19 18:09:05 +01:00
|
|
|
.click(homeNavButton)
|
2019-02-28 17:56:25 +01:00
|
|
|
.hover(getNthStatus(1))
|
2018-03-19 18:09:05 +01:00
|
|
|
await postAs('admin', 'posted this while you were away!')
|
2019-02-28 17:56:25 +01:00
|
|
|
await t.expect(getNthStatus(1).innerText).contains('posted this while you were away!', { timeout })
|
2018-03-19 18:09:05 +01:00
|
|
|
.click(localTimelineNavButton)
|
2019-02-28 17:56:25 +01:00
|
|
|
.expect(getNthStatus(1).innerText).contains('posted this while you were away!', { timeout })
|
|
|
|
.expect(getNthStatus(2).innerText).contains('heyo', { timeout })
|
2018-03-23 01:55:57 +01:00
|
|
|
await sleep(5000)
|
2018-03-19 18:09:05 +01:00
|
|
|
await postAs('admin', 'posted this while you were watching')
|
2019-02-28 17:56:25 +01:00
|
|
|
await t.expect(getNthStatus(1).innerText).contains('posted this while you were watching', { timeout })
|
2018-03-19 18:09:05 +01:00
|
|
|
})
|