biome format --write

This commit is contained in:
Henry Jameson 2026-01-06 16:22:52 +02:00
commit 9262e803ec
415 changed files with 54076 additions and 17419 deletions

View file

@ -17,8 +17,8 @@ export const injectMswToTest = (defaultHandlers) => {
worker.stop()
},
{
auto: true
}
auto: true,
},
],
})
}
@ -29,34 +29,44 @@ export const authApis = [
http.post(`${testServer}/api/v1/apps`, () => {
return HttpResponse.json({
client_id: 'test-id',
client_secret: 'test-secret'
client_secret: 'test-secret',
})
}),
http.get(`${testServer}/api/v1/apps/verify_credentials`, ({ request }) => {
const authHeader = request.headers.get('Authorization')
if (authHeader === 'Bearer test-app-token' ||
authHeader === 'Bearer also-good-app-token') {
if (
authHeader === 'Bearer test-app-token' ||
authHeader === 'Bearer also-good-app-token'
) {
return HttpResponse.json({})
} else {
// Pleroma 2.9.0 gives the following respoonse upon error
return HttpResponse.json({ error: { detail: 'Internal server error' } }, {
status: 400
})
return HttpResponse.json(
{ error: { detail: 'Internal server error' } },
{
status: 400,
},
)
}
}),
http.post(`${testServer}/oauth/token`, async ({ request }) => {
const data = await request.formData()
if (data.get('client_id') === 'test-id' &&
data.get('client_secret') === 'test-secret' &&
data.get('grant_type') === 'client_credentials' &&
data.has('redirect_uri')) {
if (
data.get('client_id') === 'test-id' &&
data.get('client_secret') === 'test-secret' &&
data.get('grant_type') === 'client_credentials' &&
data.has('redirect_uri')
) {
return HttpResponse.json({ access_token: 'test-app-token' })
} else {
// Pleroma 2.9.0 gives the following respoonse upon error
return HttpResponse.json({ error: 'Invalid credentials' }, {
status: 400
})
return HttpResponse.json(
{ error: 'Invalid credentials' },
{
status: 400,
},
)
}
})
}),
]