fix tests

This commit is contained in:
Henry Jameson 2026-06-24 19:03:46 +03:00
commit 30db636389
3 changed files with 7 additions and 3 deletions

View file

@ -2,8 +2,6 @@ import { reduce } from 'lodash'
import { paramsString, promisedRequest } from './helpers.js'
import { StatusCodeError } from 'src/services/errors/errors.js'
const REDIRECT_URI = `${window.location.origin}/oauth-callback`
export const MASTODON_APP_VERIFY_URL = '/api/v1/apps/verify_credentials'

View file

@ -13,7 +13,7 @@ function humanizeErrors(errors) {
export function StatusCodeError(statusCode, body, options, response) {
this.name = 'StatusCodeError'
this.statusCode = statusCode
this.statusText = body.error.error || body.error
this.statusText = body.error || body
this.details = JSON && JSON.stringify ? JSON.stringify(body) : body
this.errorData = body.error
this.message = this.statusCode + ' - ' + this.statusText

View file

@ -69,6 +69,12 @@ describe('oauth store', () => {
it('should use create an app and record client id and secret', async ({
worker,
}) => {
worker.use(
http.post(MASTODON_APP_URL, () => {
return HttpResponse.text('Throttled', { status: 429 })
}),
)
const store = useOAuthStore()
worker.use(...authApis())
const app = await store.createApp()