test: fix test and use stronger passwords

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2022-09-25 02:05:30 +02:00 committed by David Mehren
parent 6a56ce5541
commit 3ba9f95f83
10 changed files with 68 additions and 38 deletions

View file

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
@ -20,6 +20,8 @@ describe('Media', () => {
let user: User;
beforeAll(async () => {
const username = 'hardcoded';
const password = 'AHardcodedStrongP@ssword123';
testSetup = await TestSetupBuilder.create().build();
uploadPath =
@ -39,13 +41,13 @@ describe('Media', () => {
null,
'test_upload_media',
);
user = await testSetup.userService.createUser('hardcoded', 'Testy');
await testSetup.identityService.createLocalIdentity(user, 'test');
user = await testSetup.userService.createUser(username, 'Testy');
await testSetup.identityService.createLocalIdentity(user, password);
agent = request.agent(testSetup.app.getHttpServer());
await agent
.post('/api/private/auth/local/login')
.send({ username: 'hardcoded', password: 'test' })
.send({ username: username, password: password })
.expect(201);
});