This commit is contained in:
Nolan Lawson 2018-03-05 23:56:48 -08:00
parent c574606f0c
commit 4a49e9118e
8 changed files with 13 additions and 14 deletions

View file

@ -74,7 +74,7 @@ export const actions = times(30, i => ({
{
user: 'foobar',
post: {
text: "content warning",
text: 'content warning',
spoiler: 'CW'
}
},

View file

@ -1,8 +1,7 @@
import { favoriteStatus } from '../routes/_api/favorite'
import fetch from 'node-fetch'
global.fetch = fetch
import { users } from './users'
global.fetch = fetch
export async function favoriteStatusAsAdmin (statusId) {
return favoriteStatus('localhost:3000', users.admin.accessToken, statusId)

View file

@ -12,7 +12,7 @@ test('shows favorites', async t => {
.expect(getFavoritesCount()).eql(2)
.expect($('.icon-button[aria-label="Favorite"]').getAttribute('aria-pressed')).eql('true')
.click($('.status-favs-reblogs').nth(1))
.expect(getUrl()).match(/\/statuses\/[^\/]+\/favorites/)
.expect(getUrl()).match(/\/statuses\/[^/]+\/favorites/)
.expect($('.search-result-account-name').nth(0).innerText).eql('foobar')
.expect($('.search-result-account-username').nth(0).innerText).eql('@foobar')
.expect($('.search-result-account-name').nth(1).innerText).eql('admin')
@ -26,7 +26,7 @@ test('shows boosts', async t => {
.expect(getReblogsCount()).eql(1)
.expect($('.icon-button[aria-label="Boost"]').getAttribute('aria-pressed')).eql('false')
.click($('.status-favs-reblogs').nth(0))
.expect(getUrl()).match(/\/statuses\/[^\/]+\/reblogs/)
.expect(getUrl()).match(/\/statuses\/[^/]+\/reblogs/)
.expect($('.search-result-account-name').nth(0).innerText).eql('admin')
.expect($('.search-result-account-username').nth(0).innerText).eql('@admin')
})