mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-28 05:54:43 -04:00
test: fix expected error codes in multiple test
In the e2e tests the global filter must be added via the special provider 'APP_FILTER' and not with useGlobalFilters, because if not the filter breaks, because of the way supertest handles the http-connection. See: https://github.com/nestjs/nest/issues/1160#issuecomment-468698640 Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
796b8294cf
commit
6269c7f7bc
8 changed files with 15 additions and 9 deletions
|
@ -66,7 +66,7 @@ describe('Alias', () => {
|
|||
noteIdOrAlias: testAlias,
|
||||
newAlias: 'testAlias1',
|
||||
})
|
||||
.expect(400);
|
||||
.expect(409);
|
||||
});
|
||||
it('because of a forbidden alias', async () => {
|
||||
await request(testSetup.app.getHttpServer())
|
||||
|
@ -88,7 +88,7 @@ describe('Alias', () => {
|
|||
noteIdOrAlias: testAlias,
|
||||
newAlias: publicId,
|
||||
})
|
||||
.expect(400);
|
||||
.expect(409);
|
||||
});
|
||||
it('because the user is not an owner', async () => {
|
||||
await request(testSetup.app.getHttpServer())
|
||||
|
@ -217,7 +217,6 @@ describe('Alias', () => {
|
|||
.delete(`/api/v2/alias/${testAlias}`)
|
||||
.set('Authorization', `Bearer ${testSetup.authTokens[0].secret}`)
|
||||
.expect(400);
|
||||
|
||||
await request(testSetup.app.getHttpServer())
|
||||
.get(`/api/v2/notes/${secondAlias}`)
|
||||
.set('Authorization', `Bearer ${testSetup.authTokens[0].secret}`)
|
||||
|
|
|
@ -79,7 +79,7 @@ describe('Media', () => {
|
|||
.post('/api/v2/media')
|
||||
.attach('file', 'test/public-api/fixtures/test.zip')
|
||||
.set('HedgeDoc-Note', 'i_dont_exist')
|
||||
.expect(400);
|
||||
.expect(404);
|
||||
await expect(fs.access(uploadPath)).rejects.toBeDefined();
|
||||
});
|
||||
it('mediaBackend error', async () => {
|
||||
|
|
|
@ -117,7 +117,7 @@ describe('Notes', () => {
|
|||
.set('Content-Type', 'text/markdown')
|
||||
.send(content)
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(400);
|
||||
.expect(409);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue