mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	chore(test): simplify import of becca_mocking
This commit is contained in:
		| @@ -7,11 +7,11 @@ import type SearchResult from "../../src/services/search/search_result.js"; | ||||
| import type { NoteRow, NoteType } from "../../src/becca/entities/rows.js"; | ||||
| randtoken.generator({ source: "crypto" }); | ||||
|  | ||||
| function findNoteByTitle(searchResults: Array<SearchResult>, title: string): BNote | undefined { | ||||
| export function findNoteByTitle(searchResults: Array<SearchResult>, title: string): BNote | undefined { | ||||
|     return searchResults.map((sr) => becca.notes[sr.noteId]).find((note) => note.title === title); | ||||
| } | ||||
|  | ||||
| class NoteBuilder { | ||||
| export class NoteBuilder { | ||||
|     note: BNote; | ||||
|     constructor(note: BNote) { | ||||
|         this.note = note; | ||||
| @@ -55,11 +55,11 @@ class NoteBuilder { | ||||
|     } | ||||
| } | ||||
|  | ||||
| function id() { | ||||
| export function id() { | ||||
|     return randtoken.generate(10); | ||||
| } | ||||
|  | ||||
| function note(title: string, extraParams: Partial<NoteRow> = {}) { | ||||
| export function note(title: string, extraParams: Partial<NoteRow> = {}) { | ||||
|     const row = Object.assign( | ||||
|         { | ||||
|             noteId: id(), | ||||
| @@ -74,9 +74,3 @@ function note(title: string, extraParams: Partial<NoteRow> = {}) { | ||||
|  | ||||
|     return new NoteBuilder(note); | ||||
| } | ||||
|  | ||||
| export default { | ||||
|     NoteBuilder, | ||||
|     findNoteByTitle, | ||||
|     note | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user