Update API routes in private API E2E tests

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-10-15 17:06:56 +02:00
parent 4805c9c5c5
commit 9e2b9caca9
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
6 changed files with 149 additions and 226 deletions

View file

@ -47,7 +47,7 @@ describe('Media', () => {
agent = request.agent(testSetup.app.getHttpServer());
await agent
.post('/auth/local/login')
.post('/api/private/auth/local/login')
.send({ username: 'hardcoded', password: 'test' })
.expect(201);
});
@ -55,7 +55,7 @@ describe('Media', () => {
describe('POST /media', () => {
it('works', async () => {
const uploadResponse = await agent
.post('/media')
.post('/api/private/media')
.attach('file', 'test/private-api/fixtures/test.png')
.set('HedgeDoc-Note', 'test_upload_media')
.expect('Content-Type', /json/)
@ -75,7 +75,7 @@ describe('Media', () => {
});
it('MIME type not supported', async () => {
await agent
.post('/media')
.post('/api/private/media')
.attach('file', 'test/private-api/fixtures/test.zip')
.set('HedgeDoc-Note', 'test_upload_media')
.expect(400);
@ -83,7 +83,7 @@ describe('Media', () => {
});
it('note does not exist', async () => {
await agent
.post('/media')
.post('/api/private/media')
.attach('file', 'test/private-api/fixtures/test.zip')
.set('HedgeDoc-Note', 'i_dont_exist')
.expect(400);
@ -94,7 +94,7 @@ describe('Media', () => {
mode: '444',
});
await agent
.post('/media')
.post('/api/private/media')
.attach('file', 'test/private-api/fixtures/test.png')
.set('HedgeDoc-Note', 'test_upload_media')
.expect('Content-Type', /json/)