fix: correct test note in cypress environment

Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-04-05 11:10:44 +02:00
parent c0d4d233da
commit 6786e6d6d3
2 changed files with 15 additions and 7 deletions

View file

@ -3,6 +3,8 @@
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import type { Note } from '../../src/api/notes/types'
export const testNoteId = 'test'
beforeEach(() => {
@ -10,16 +12,22 @@ beforeEach(() => {
content: '',
metadata: {
id: testNoteId,
alias: ['mock-note'],
primaryAlias: 'mock-note',
aliases: [
{
name: 'mock-note',
primaryAlias: true,
noteId: testNoteId
}
],
primaryAddress: 'mock-note',
title: 'Mock Note',
description: 'Mocked note for testing',
tags: ['test', 'mock', 'cypress'],
updateTime: '2021-04-24T09:27:51.000Z',
updateUser: null,
updatedAt: '2021-04-24T09:27:51.000Z',
updateUsername: null,
viewCount: 0,
version: 2,
createTime: '2021-04-24T09:27:51.000Z',
createdAt: '2021-04-24T09:27:51.000Z',
editedBy: [],
permissions: {
owner: 'mock',
@ -28,5 +36,5 @@ beforeEach(() => {
}
},
editedByAtPosition: []
})
} as Note)
})

View file

@ -47,7 +47,7 @@ const handler = (req: NextApiRequest, res: NextApiResponse): void => {
}
},
editedByAtPosition: []
})
} as Note)
}
export default handler