add another test
This commit is contained in:
parent
3afd095fe0
commit
cb4580875b
|
@ -1,7 +1,7 @@
|
|||
import { foobarRole } from '../roles'
|
||||
import { postAs } from '../serverActions'
|
||||
import {
|
||||
avatarInComposeBox, getNthDialogOptionsOption, getNthPinnedStatus, getNthStatus,
|
||||
avatarInComposeBox, getNthDialogOptionsOption, getNthPinnedStatus, getNthPinnedStatusFavoriteButton, getNthStatus,
|
||||
getNthStatusOptionsButton, getUrl, sleep
|
||||
} from '../utils'
|
||||
import { users } from '../users'
|
||||
|
@ -38,3 +38,14 @@ test('Can pin statuses', async t => {
|
|||
.expect(getNthPinnedStatus(0).innerText).contains('this is unlisted')
|
||||
.expect(getNthStatus(0).innerText).contains('I am going to pin this')
|
||||
})
|
||||
|
||||
test('Can favorite a pinned status', async t => {
|
||||
await t.useRole(foobarRole)
|
||||
.click(avatarInComposeBox)
|
||||
.expect(getNthPinnedStatus(0).getAttribute('aria-setsize')).eql('1')
|
||||
.expect(getNthPinnedStatusFavoriteButton(0).getAttribute('aria-pressed')).eql('false')
|
||||
.click(getNthPinnedStatusFavoriteButton(0))
|
||||
.expect(getNthPinnedStatusFavoriteButton(0).getAttribute('aria-pressed')).eql('true')
|
||||
.click(getNthPinnedStatusFavoriteButton(0))
|
||||
.expect(getNthPinnedStatusFavoriteButton(0).getAttribute('aria-pressed')).eql('false')
|
||||
})
|
||||
|
|
|
@ -229,6 +229,10 @@ export function getNthPinnedStatus (n) {
|
|||
return $(`.pinned-statuses article[aria-posinset="${n}"]`)
|
||||
}
|
||||
|
||||
export function getNthPinnedStatusFavoriteButton (n) {
|
||||
return getNthPinnedStatus(n).find('.status-toolbar button:nth-child(3)')
|
||||
}
|
||||
|
||||
export async function validateTimeline (t, timeline) {
|
||||
for (let i = 0; i < timeline.length; i++) {
|
||||
let status = timeline[i]
|
||||
|
|
Loading…
Reference in New Issue