mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	test(server): add adjustable type to becca mocking
This commit is contained in:
		| @@ -2,6 +2,7 @@ import utils from "../services/utils.js"; | |||||||
| import BNote from "../becca/entities/bnote.js"; | import BNote from "../becca/entities/bnote.js"; | ||||||
| import BAttribute from "../becca/entities/battribute.js"; | import BAttribute from "../becca/entities/battribute.js"; | ||||||
| import BBranch from "../becca/entities/bbranch.js"; | import BBranch from "../becca/entities/bbranch.js"; | ||||||
|  | import { NoteType } from "@triliumnext/commons"; | ||||||
|  |  | ||||||
| type AttributeDefinitions = { [key in `#${string}`]: string; }; | type AttributeDefinitions = { [key in `#${string}`]: string; }; | ||||||
| type RelationDefinitions = { [key in `~${string}`]: string; }; | type RelationDefinitions = { [key in `~${string}`]: string; }; | ||||||
| @@ -10,6 +11,7 @@ interface NoteDefinition extends AttributeDefinitions, RelationDefinitions { | |||||||
|     id?: string | undefined; |     id?: string | undefined; | ||||||
|     title?: string; |     title?: string; | ||||||
|     content?: string; |     content?: string; | ||||||
|  |     type?: NoteType; | ||||||
|     children?: NoteDefinition[]; |     children?: NoteDefinition[]; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -42,7 +44,7 @@ export function buildNote(noteDef: NoteDefinition) { | |||||||
|     const note = new BNote({ |     const note = new BNote({ | ||||||
|         noteId: noteDef.id ?? utils.randomString(12), |         noteId: noteDef.id ?? utils.randomString(12), | ||||||
|         title: noteDef.title ?? "New note", |         title: noteDef.title ?? "New note", | ||||||
|         type: "text", |         type: noteDef.type ?? "text", | ||||||
|         mime: "text/html", |         mime: "text/html", | ||||||
|         isProtected: false, |         isProtected: false, | ||||||
|         blobId: "" |         blobId: "" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user