2018-05-26 22:51:41 +02:00
|
|
|
import { loginAsFoobar } from '../roles'
|
2018-03-10 19:54:16 +01:00
|
|
|
import {
|
2018-11-22 07:08:37 +01:00
|
|
|
getNthStatus, scrollToTop, showMoreButton, sleep
|
2018-03-10 19:54:16 +01:00
|
|
|
} from '../utils'
|
2018-03-16 18:06:02 +01:00
|
|
|
import { postAs } from '../serverActions'
|
2018-03-10 19:54:16 +01:00
|
|
|
|
|
|
|
fixture`104-streaming.js`
|
|
|
|
.page`http://localhost:4002`
|
|
|
|
|
|
|
|
test('new incoming statuses show up immediately', async t => {
|
2018-05-26 22:51:41 +02:00
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
2019-02-28 17:56:25 +01:00
|
|
|
.hover(getNthStatus(1))
|
2018-03-16 18:06:02 +01:00
|
|
|
await postAs('admin', 'hello my baby hello my honey')
|
2019-02-28 17:56:25 +01:00
|
|
|
await t.expect(getNthStatus(1).innerText).contains('hello my baby hello my honey')
|
2018-03-10 19:54:16 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
test('new incoming toots show a button if scrolled down', async t => {
|
2018-05-26 22:51:41 +02:00
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
2019-02-28 17:56:25 +01:00
|
|
|
.hover(getNthStatus(1))
|
|
|
|
.hover(getNthStatus(3))
|
|
|
|
.hover(getNthStatus(5))
|
2018-03-10 20:28:30 +01:00
|
|
|
await sleep(1000)
|
2018-03-16 18:06:02 +01:00
|
|
|
await postAs('admin', 'hello my ragtime gal')
|
|
|
|
await postAs('admin', 'send me a kiss by wire')
|
2018-03-10 19:54:16 +01:00
|
|
|
await sleep(4000)
|
2019-02-28 17:56:25 +01:00
|
|
|
await t.hover(getNthStatus(3))
|
|
|
|
.hover(getNthStatus(1))
|
2018-11-22 07:08:37 +01:00
|
|
|
await scrollToTop()
|
2018-03-10 19:54:16 +01:00
|
|
|
await sleep(1000)
|
|
|
|
await t
|
|
|
|
.expect(showMoreButton.innerText).contains('Show 2 more')
|
2018-03-16 18:06:02 +01:00
|
|
|
await postAs('admin', "baby my heart's on fire")
|
2018-03-10 19:54:16 +01:00
|
|
|
await sleep(4000)
|
|
|
|
await t.expect(showMoreButton.innerText).contains('Show 3 more')
|
|
|
|
.click(showMoreButton)
|
|
|
|
await t
|
2019-02-28 17:56:25 +01:00
|
|
|
.expect(getNthStatus(1).innerText).contains("baby my heart's on fire")
|
|
|
|
.expect(getNthStatus(2).innerText).contains('send me a kiss by wire')
|
|
|
|
.expect(getNthStatus(3).innerText).contains('hello my ragtime gal')
|
2018-03-10 19:54:16 +01:00
|
|
|
.navigateTo('/')
|
2019-02-28 17:56:25 +01:00
|
|
|
.expect(getNthStatus(1).innerText).contains("baby my heart's on fire")
|
|
|
|
.expect(getNthStatus(2).innerText).contains('send me a kiss by wire')
|
|
|
|
.expect(getNthStatus(3).innerText).contains('hello my ragtime gal')
|
2018-03-10 19:54:16 +01:00
|
|
|
})
|