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

View file

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