add test for account profile statuses

modify-database
Nolan Lawson 2018-02-20 08:50:48 -08:00
rodzic 5c45212159
commit 09504794c6
2 zmienionych plików z 18 dodań i 1 usunięć

Wyświetl plik

@ -52,3 +52,8 @@ export const favorites = [
{content: 'notification of unlisted message'},
{content: 'pinned toot 1'}
]
export const quuxStatuses = [
{content: 'pinned toot 2'},
{content: 'pinned toot 1'}
].concat(times(25, i => ({content: `unlisted thread ${25 - i}`})))

Wyświetl plik

@ -1,6 +1,7 @@
import { Selector as $ } from 'testcafe'
import { getUrl } from '../utils'
import { getUrl, validateTimeline } from '../utils'
import { foobarRole } from '../roles'
import { quuxStatuses } from '../fixtures'
fixture`07-account-profile.js`
.page`http://localhost:4002`
@ -37,3 +38,14 @@ test('shows account profile 3', async t => {
.expect($('.account-profile .account-profile-followed-by').innerText).eql('')
.expect($('.account-profile .account-profile-follow').innerText).eql('')
})
test('shows account profile statuses', async t => {
await t.useRole(foobarRole)
.click($('.status-author-name').withText(('quux')))
.expect(getUrl()).contains('/accounts/3')
.expect($('.pinned-statuses .status-article').getAttribute('aria-setsize')).eql('2')
.expect($('.pinned-statuses .status-article').getAttribute('aria-posinset')).eql('0')
.expect($('.timeline .status-article').getAttribute('aria-posinset')).eql('0')
await validateTimeline(t, quuxStatuses)
await t.expect($('.timeline .status-article').getAttribute('aria-setsize')).eql('27')
})