fix tests
This commit is contained in:
parent
ada7ae65ad
commit
30db636389
3 changed files with 7 additions and 3 deletions
|
|
@ -2,8 +2,6 @@ import { reduce } from 'lodash'
|
||||||
|
|
||||||
import { paramsString, promisedRequest } from './helpers.js'
|
import { paramsString, promisedRequest } from './helpers.js'
|
||||||
|
|
||||||
import { StatusCodeError } from 'src/services/errors/errors.js'
|
|
||||||
|
|
||||||
const REDIRECT_URI = `${window.location.origin}/oauth-callback`
|
const REDIRECT_URI = `${window.location.origin}/oauth-callback`
|
||||||
|
|
||||||
export const MASTODON_APP_VERIFY_URL = '/api/v1/apps/verify_credentials'
|
export const MASTODON_APP_VERIFY_URL = '/api/v1/apps/verify_credentials'
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ function humanizeErrors(errors) {
|
||||||
export function StatusCodeError(statusCode, body, options, response) {
|
export function StatusCodeError(statusCode, body, options, response) {
|
||||||
this.name = 'StatusCodeError'
|
this.name = 'StatusCodeError'
|
||||||
this.statusCode = statusCode
|
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.details = JSON && JSON.stringify ? JSON.stringify(body) : body
|
||||||
this.errorData = body.error
|
this.errorData = body.error
|
||||||
this.message = this.statusCode + ' - ' + this.statusText
|
this.message = this.statusCode + ' - ' + this.statusText
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,12 @@ describe('oauth store', () => {
|
||||||
it('should use create an app and record client id and secret', async ({
|
it('should use create an app and record client id and secret', async ({
|
||||||
worker,
|
worker,
|
||||||
}) => {
|
}) => {
|
||||||
|
worker.use(
|
||||||
|
http.post(MASTODON_APP_URL, () => {
|
||||||
|
return HttpResponse.text('Throttled', { status: 429 })
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
const store = useOAuthStore()
|
const store = useOAuthStore()
|
||||||
worker.use(...authApis())
|
worker.use(...authApis())
|
||||||
const app = await store.createApp()
|
const app = await store.createApp()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue