pinafore/tests/spec/107-streaming-gap.js
Nolan Lawson 63003c3763
fix: fix aria-posinset should be 1-based (#1055)
* fix: fix aria-posinset should be 1-based

fixes #1053

* second attempt to fix tests

* try to fix test

*  fixup

* lint fix

* fix more tests

* simplify test math
2019-02-28 08:56:25 -08:00

33 lines
1.2 KiB
JavaScript

import { loginAsFoobar } from '../roles'
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
await loginAsFoobar(t)
await t
.click(localTimelineNavButton)
.expect(getNthStatus(1).exists).ok({ timeout })
.hover(getNthStatus(1))
await postAs('admin', 'heyo')
await t.expect(getNthStatus(1).innerText).contains('heyo', { timeout })
.click(homeNavButton)
.hover(getNthStatus(1))
await postAs('admin', 'posted this while you were away!')
await t.expect(getNthStatus(1).innerText).contains('posted this while you were away!', { timeout })
.click(localTimelineNavButton)
.expect(getNthStatus(1).innerText).contains('posted this while you were away!', { timeout })
.expect(getNthStatus(2).innerText).contains('heyo', { timeout })
await sleep(5000)
await postAs('admin', 'posted this while you were watching')
await t.expect(getNthStatus(1).innerText).contains('posted this while you were watching', { timeout })
})