(files: Record<string, TFile> = {})
| 28 | } |
| 29 | |
| 30 | function createApp(files: Record<string, TFile> = {}): any { |
| 31 | return { |
| 32 | metadataCache: { |
| 33 | fileToLinktext: (targetFile: TFile) => targetFile.path.replace(/\.md$/i, ""), |
| 34 | getFirstLinkpathDest: (linkPath: string) => |
| 35 | files[linkPath] ?? files[`${linkPath}.md`] ?? null, |
| 36 | getCache: () => ({}), |
| 37 | }, |
| 38 | workspace: { |
| 39 | getLeaf: () => ({ openFile: jest.fn() }), |
| 40 | openLinkText: jest.fn(), |
| 41 | trigger: jest.fn(), |
| 42 | }, |
| 43 | fileManager: { |
| 44 | generateMarkdownLink: (targetFile: TFile) => `[${targetFile.basename}](${targetFile.path})`, |
| 45 | }, |
| 46 | }; |
| 47 | } |
| 48 | |
| 49 | describe("taskModalProjects", () => { |
| 50 | it("creates project items from selected files", () => { |
no outgoing calls
no test coverage detected