2018-04-27 07:05:55 +02:00
|
|
|
import {
|
|
|
|
followersButton,
|
|
|
|
followsButton, getNthSearchResult,
|
2018-06-09 06:54:21 +02:00
|
|
|
getNthStatusSelector, getUrl, goBack
|
2018-04-27 07:05:55 +02:00
|
|
|
} from '../utils'
|
2018-05-26 22:51:41 +02:00
|
|
|
import { loginAsFoobar } from '../roles'
|
2018-06-09 06:54:21 +02:00
|
|
|
import { Selector as $ } from 'testcafe'
|
2018-04-27 07:05:55 +02:00
|
|
|
|
|
|
|
fixture`021-followers-follows.js`
|
|
|
|
.page`http://localhost:4002`
|
|
|
|
|
|
|
|
test('shows followers and follows', async t => {
|
2018-05-26 22:51:41 +02:00
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
2019-02-28 17:56:25 +01:00
|
|
|
.click($(`${getNthStatusSelector(1)} .status-author-name`))
|
2018-04-27 07:05:55 +02:00
|
|
|
.expect(getUrl()).match(/\/accounts\/3$/)
|
|
|
|
.expect(followsButton.getAttribute('aria-label')).eql('Follows 2')
|
|
|
|
.click(followsButton)
|
|
|
|
.expect(getUrl()).contains('/accounts/3/follows')
|
|
|
|
.expect(getNthSearchResult(1).innerText).contains('@foobar')
|
|
|
|
.expect(getNthSearchResult(2).innerText).contains('@admin')
|
|
|
|
await goBack()
|
|
|
|
await t.expect(getUrl()).match(/\/accounts\/3$/)
|
|
|
|
.expect(followersButton.getAttribute('aria-label')).eql('Followed by 1')
|
|
|
|
.click(followersButton)
|
|
|
|
.expect(getUrl()).contains('/accounts/3/followers')
|
|
|
|
.expect(getNthSearchResult(1).innerText).contains('@admin')
|
|
|
|
})
|