chore(test): Change test to work with publicId

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-05-16 22:46:02 +02:00 committed by David Mehren
parent b7e52f8166
commit 0f58757858
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
5 changed files with 74 additions and 38 deletions

View file

@ -243,10 +243,26 @@ describe('Me', () => {
expect(response1.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.publicId,
);
const url3 = await mediaService.saveFile(
testImage,
'hardcoded',
note2.publicId,
);
const response = await request(httpServer)
.get('/me/media/')