Update API routes in public API E2E tests

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-10-15 16:53:10 +02:00
parent 1cc797f13d
commit 4805c9c5c5
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
4 changed files with 64 additions and 64 deletions

View file

@ -45,7 +45,7 @@ describe('Media', () => {
describe('POST /media', () => {
it('works', async () => {
const uploadResponse = await request(testSetup.app.getHttpServer())
.post('/media')
.post('/api/v2/media')
.attach('file', 'test/public-api/fixtures/test.png')
.set('HedgeDoc-Note', 'test_upload_media')
.expect('Content-Type', /json/)
@ -67,7 +67,7 @@ describe('Media', () => {
});
it('MIME type not supported', async () => {
await request(testSetup.app.getHttpServer())
.post('/media')
.post('/api/v2/media')
.attach('file', 'test/public-api/fixtures/test.zip')
.set('HedgeDoc-Note', 'test_upload_media')
.expect(400);
@ -75,7 +75,7 @@ describe('Media', () => {
});
it('note does not exist', async () => {
await request(testSetup.app.getHttpServer())
.post('/media')
.post('/api/v2/media')
.attach('file', 'test/public-api/fixtures/test.zip')
.set('HedgeDoc-Note', 'i_dont_exist')
.expect(400);
@ -86,7 +86,7 @@ describe('Media', () => {
mode: '444',
});
await request(testSetup.app.getHttpServer())
.post('/media')
.post('/api/v2/media')
.attach('file', 'test/public-api/fixtures/test.png')
.set('HedgeDoc-Note', 'test_upload_media')
.expect('Content-Type', /json/)
@ -107,7 +107,7 @@ describe('Media', () => {
);
const filename = url.split('/').pop() || '';
await request(testSetup.app.getHttpServer())
.delete('/media/' + filename)
.delete('/api/v2/media/' + filename)
.expect(204);
});