mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 10:15:17 -04:00
fix(frontend): refactor api error handling
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
e93144eb40
commit
57bfca7b15
44 changed files with 387 additions and 465 deletions
|
@ -13,17 +13,6 @@ describe('ApiResponse', () => {
|
|||
expect(responseObj.getResponse()).toEqual(mockResponse)
|
||||
})
|
||||
|
||||
it('asBlob', async () => {
|
||||
const mockBlob = Mock.of<Blob>()
|
||||
const mockResponse = Mock.of<Response>({
|
||||
blob(): Promise<Blob> {
|
||||
return Promise.resolve(mockBlob)
|
||||
}
|
||||
})
|
||||
const responseObj = new ApiResponse(mockResponse)
|
||||
await expect(responseObj.asBlob()).resolves.toEqual(mockBlob)
|
||||
})
|
||||
|
||||
describe('asParsedJsonObject with', () => {
|
||||
it('invalid header', async () => {
|
||||
const mockHeaders = new Headers()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue