mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 08:04:45 -04:00
chore(test): Change test to work with publicId
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
b7e52f8166
commit
0f58757858
5 changed files with 74 additions and 38 deletions
|
@ -111,10 +111,26 @@ describe('Me', () => {
|
|||
expect(responseBefore.body).toHaveLength(0);
|
||||
|
||||
const testImage = await fs.readFile('test/public-api/fixtures/test.png');
|
||||
const url0 = await mediaService.saveFile(testImage, 'hardcoded', note1.id);
|
||||
const url1 = await mediaService.saveFile(testImage, 'hardcoded', note1.id);
|
||||
const url2 = await mediaService.saveFile(testImage, 'hardcoded', note2.id);
|
||||
const url3 = await mediaService.saveFile(testImage, 'hardcoded', note2.id);
|
||||
const url0 = await mediaService.saveFile(
|
||||
testImage,
|
||||
'hardcoded',
|
||||
note1.publicId,
|
||||
);
|
||||
const url1 = await mediaService.saveFile(
|
||||
testImage,
|
||||
'hardcoded',
|
||||
note1.publicId,
|
||||
);
|
||||
const url2 = await mediaService.saveFile(
|
||||
testImage,
|
||||
'hardcoded',
|
||||
note2.alias ?? '',
|
||||
);
|
||||
const url3 = await mediaService.saveFile(
|
||||
testImage,
|
||||
'hardcoded',
|
||||
note2.alias ?? '',
|
||||
);
|
||||
|
||||
const response = await request(httpServer)
|
||||
.get('/me/media/')
|
||||
|
@ -147,7 +163,11 @@ describe('Me', () => {
|
|||
|
||||
it('DELETE /me', async () => {
|
||||
const testImage = await fs.readFile('test/public-api/fixtures/test.png');
|
||||
const url0 = await mediaService.saveFile(testImage, 'hardcoded', note1.id);
|
||||
const url0 = await mediaService.saveFile(
|
||||
testImage,
|
||||
'hardcoded',
|
||||
note1.publicId,
|
||||
);
|
||||
const dbUser = await userService.getUserByUsername('hardcoded');
|
||||
expect(dbUser).toBeInstanceOf(User);
|
||||
const mediaUploads = await mediaService.listUploadsByUser(dbUser);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue