45630c185f
* feat: add option to disable infinite scroll fixes #391 and fixes #270. Also makes me less nervous about #1251 because now keyboard users can disable infinite load and easily access the "reload" button in the snackbar footer. * fix test
33 lines
997 B
JavaScript
33 lines
997 B
JavaScript
import {
|
|
settingsNavButton,
|
|
homeNavButton,
|
|
disableInfiniteScroll,
|
|
getFirstVisibleStatus,
|
|
getUrl,
|
|
showMoreButton, getNthStatusContent
|
|
} from '../utils'
|
|
import { loginAsFoobar } from '../roles'
|
|
import { Selector as $ } from 'testcafe'
|
|
import { postAs } from '../serverActions'
|
|
|
|
fixture`128-disable-infinite-load.js`
|
|
.page`http://localhost:4002`
|
|
|
|
test('Can disable loading items at top of timeline', async t => {
|
|
await loginAsFoobar(t)
|
|
await t.click(settingsNavButton)
|
|
.click($('a').withText('General'))
|
|
.click(disableInfiniteScroll)
|
|
.expect(disableInfiniteScroll.checked).ok()
|
|
.click(homeNavButton)
|
|
.expect(getUrl()).eql('http://localhost:4002/')
|
|
.expect(getFirstVisibleStatus().exists).ok()
|
|
await postAs('admin', 'hey hey hey this is new')
|
|
await t
|
|
.expect(showMoreButton.innerText).contains('Show 1 more', {
|
|
timeout: 20000
|
|
})
|
|
.click(showMoreButton)
|
|
.expect(getNthStatusContent(1).innerText).contains('hey hey hey this is new')
|
|
})
|