mirror of
https://github.com/zadam/trilium.git
synced 2026-05-06 20:46:03 +02:00
test(server): fix test depending on note content
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import utils from "../services/utils.js";
|
||||
import BNote from "../becca/entities/bnote.js";
|
||||
import { NoteType } from "@triliumnext/commons";
|
||||
|
||||
import BAttribute from "../becca/entities/battribute.js";
|
||||
import BBranch from "../becca/entities/bbranch.js";
|
||||
import { NoteType } from "@triliumnext/commons";
|
||||
import BNote from "../becca/entities/bnote.js";
|
||||
import utils from "../services/utils.js";
|
||||
|
||||
type AttributeDefinitions = { [key in `#${string}`]: string; };
|
||||
type RelationDefinitions = { [key in `~${string}`]: string; };
|
||||
@@ -12,6 +13,7 @@ interface NoteDefinition extends AttributeDefinitions, RelationDefinitions {
|
||||
title?: string;
|
||||
content?: string;
|
||||
type?: NoteType;
|
||||
mime?: string;
|
||||
children?: NoteDefinition[];
|
||||
}
|
||||
|
||||
@@ -45,13 +47,13 @@ export function buildNote(noteDef: NoteDefinition) {
|
||||
noteId: noteDef.id ?? utils.randomString(12),
|
||||
title: noteDef.title ?? "New note",
|
||||
type: noteDef.type ?? "text",
|
||||
mime: "text/html",
|
||||
mime: noteDef.mime ?? "text/html",
|
||||
isProtected: false,
|
||||
blobId: ""
|
||||
});
|
||||
|
||||
// Handle content.
|
||||
if (noteDef.content) {
|
||||
if (noteDef.content !== undefined) {
|
||||
note.getContent = () => noteDef.content!;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user