1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-15 03:44:02 +01:00
Pinafore-Web-Client-Frontend/tests/spec/107-streaming-gap.js

33 lines
1.2 KiB
JavaScript
Raw Normal View History

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 => {
let timeout = 30000
2018-03-19 18:09:05 +01:00
await loginAsFoobar(t)
await t
2018-03-19 18:09:05 +01:00
.click(localTimelineNavButton)
.expect(getNthStatus(0).exists).ok({ timeout })
2018-03-19 18:09:05 +01:00
.hover(getNthStatus(0))
await postAs('admin', 'heyo')
await t.expect(getNthStatus(0).innerText).contains('heyo', { timeout })
2018-03-19 18:09:05 +01:00
.click(homeNavButton)
.hover(getNthStatus(0))
await postAs('admin', 'posted this while you were away!')
await t.expect(getNthStatus(0).innerText).contains('posted this while you were away!', { timeout })
2018-03-19 18:09:05 +01:00
.click(localTimelineNavButton)
.expect(getNthStatus(0).innerText).contains('posted this while you were away!', { timeout })
.expect(getNthStatus(1).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')
await t.expect(getNthStatus(0).innerText).contains('posted this while you were watching', { timeout })
2018-03-19 18:09:05 +01:00
})