2021-02-01 16:55:49 -05:00
|
|
|
/*
|
2023-03-25 07:36:26 -04:00
|
|
|
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
2021-02-01 16:55:49 -05:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
2023-04-05 05:10:44 -04:00
|
|
|
import type { Note } from '../../src/api/notes/types'
|
|
|
|
|
2021-02-01 16:55:49 -05:00
|
|
|
export const testNoteId = 'test'
|
2023-10-13 11:02:41 -04:00
|
|
|
const mockMetadata = {
|
|
|
|
id: testNoteId,
|
|
|
|
aliases: [
|
|
|
|
{
|
|
|
|
name: 'mock-note',
|
|
|
|
primaryAlias: true,
|
|
|
|
noteId: testNoteId
|
|
|
|
}
|
|
|
|
],
|
|
|
|
primaryAddress: 'mock-note',
|
|
|
|
title: 'Mock Note',
|
|
|
|
description: 'Mocked note for testing',
|
|
|
|
tags: ['test', 'mock', 'cypress'],
|
|
|
|
updatedAt: '2021-04-24T09:27:51.000Z',
|
|
|
|
updateUsername: null,
|
|
|
|
viewCount: 0,
|
|
|
|
version: 2,
|
|
|
|
createdAt: '2021-04-24T09:27:51.000Z',
|
|
|
|
editedBy: [],
|
|
|
|
permissions: {
|
|
|
|
owner: 'mock',
|
|
|
|
sharedToUsers: [],
|
|
|
|
sharedToGroups: []
|
|
|
|
}
|
|
|
|
}
|
2021-02-01 16:55:49 -05:00
|
|
|
|
|
|
|
beforeEach(() => {
|
2022-09-16 05:03:29 -04:00
|
|
|
cy.intercept(`api/private/notes/${testNoteId}`, {
|
2021-11-19 12:04:04 -05:00
|
|
|
content: '',
|
2023-10-13 11:02:41 -04:00
|
|
|
metadata: mockMetadata,
|
2022-04-15 17:03:15 -04:00
|
|
|
editedByAtPosition: []
|
2023-04-05 05:10:44 -04:00
|
|
|
} as Note)
|
2023-10-13 11:02:41 -04:00
|
|
|
cy.intercept(`api/private/notes/${testNoteId}/metadata`, mockMetadata)
|
2021-02-01 16:55:49 -05:00
|
|
|
})
|