diff --git a/tests/fixtures.js b/tests/fixtures.js index 68e9d16..7ac46d5 100644 --- a/tests/fixtures.js +++ b/tests/fixtures.js @@ -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}`}))) diff --git a/tests/spec/07-account-profile.js b/tests/spec/07-account-profile.js index 7323095..82d5f73 100644 --- a/tests/spec/07-account-profile.js +++ b/tests/spec/07-account-profile.js @@ -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') +})