From c702c510ecdbed28a3e23cefcbaa53c03e019ca6 Mon Sep 17 00:00:00 2001 From: Kacper Kula Date: Mon, 31 Mar 2025 14:32:31 +0100 Subject: [PATCH] chore: removing old tests --- src/utils/ui.test.ts | 57 -------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 src/utils/ui.test.ts diff --git a/src/utils/ui.test.ts b/src/utils/ui.test.ts deleted file mode 100644 index d5b4078..0000000 --- a/src/utils/ui.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { renderLink } from "./ui/link" - -const makeApp = () => ({ metadataCache: { getFirstLinkpathDest: jest.fn(p => ({ path: p })) } }) - -describe('UI', () => { - it('should properly render links', () => { - const app = makeApp() - const createEl = jest.fn() - renderLink(app as any, createEl)(['a/b/c.md']) - expect(createEl).toHaveBeenCalledWith('a', { - cls: 'internal-link', - href: 'a/b/c.md', - text: 'c' - }) - }) - - it('should properly render link with name provided', () => { - const app = makeApp() - const createEl = jest.fn() - renderLink(app as any, createEl)(['a/b/c.md', 'Name']) - expect(createEl).toHaveBeenCalledWith('a', { - cls: 'internal-link', - href: 'a/b/c.md', - text: 'Name' - }) - }) - - it('should properly render link with external url', () => { - const app = makeApp() - const createEl = jest.fn() - renderLink(app as any, createEl)(['https://wikipedia.org', 'Wikipedia']) - expect(createEl).toHaveBeenCalledWith('a', { - cls: '', - href: 'https://wikipedia.org', - text: 'Wikipedia' - }) - }) - - it('should properly render link using wikilink tag', () => { - const app = makeApp() - const createEl = jest.fn() - renderLink(app as any, createEl)(['[[a/b/c.md|Alias]]']) - expect(createEl).toHaveBeenCalledWith('a', { - cls: 'internal-link', - href: 'a/b/c.md', - text: 'Alias' - }) - }) - - it('should properly return empty string when link is empty', () => { - const app = makeApp() - const createEl = jest.fn() - const res = renderLink(app as any, createEl)([undefined as any]) - expect(createEl).not.toHaveBeenCalled() - expect(res).toEqual('') - }) -}) \ No newline at end of file