2018-04-15 06:18:48 +01:00
|
|
|
import {
|
|
|
|
accountProfileFollowButton,
|
|
|
|
accountProfileMoreOptionsButton, closeDialogButton,
|
|
|
|
getNthDialogOptionsOption
|
|
|
|
} from '../utils'
|
2018-05-26 21:51:41 +01:00
|
|
|
import { loginAsFoobar } from '../roles'
|
2018-04-15 06:18:48 +01:00
|
|
|
|
|
|
|
fixture`115-follow-unfollow.js`
|
|
|
|
.page`http://localhost:4002`
|
|
|
|
|
|
|
|
test('Can follow and unfollow an account from the profile page', async t => {
|
2018-05-26 21:51:41 +01:00
|
|
|
await loginAsFoobar(t)
|
|
|
|
await t
|
2018-04-15 06:18:48 +01:00
|
|
|
.navigateTo('/accounts/5')
|
|
|
|
.expect(accountProfileFollowButton.getAttribute('aria-label')).eql('Follow')
|
|
|
|
.click(accountProfileMoreOptionsButton)
|
|
|
|
.expect(getNthDialogOptionsOption(1).innerText).contains('Mention @baz')
|
|
|
|
.expect(getNthDialogOptionsOption(2).innerText).contains('Follow @baz')
|
|
|
|
.click(getNthDialogOptionsOption(2))
|
|
|
|
.expect(accountProfileFollowButton.getAttribute('aria-label')).eql('Unfollow')
|
|
|
|
.click(accountProfileMoreOptionsButton)
|
|
|
|
.expect(getNthDialogOptionsOption(2).innerText).contains('Unfollow @baz')
|
|
|
|
.click(getNthDialogOptionsOption(2))
|
|
|
|
.expect(accountProfileFollowButton.getAttribute('aria-label')).eql('Follow')
|
|
|
|
.click(accountProfileMoreOptionsButton)
|
|
|
|
.expect(getNthDialogOptionsOption(2).innerText).contains('Follow @baz')
|
|
|
|
.click(closeDialogButton)
|
|
|
|
.expect(accountProfileFollowButton.getAttribute('aria-label')).eql('Follow')
|
|
|
|
})
|