MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 2m20s
- The floating bullet actions only react to hover on devices with a real pointer; a tap on a phone made the invisible buttons clickable. - A bullet that is only a note link (plus hashtags) can no longer be extracted: button and /extract are hidden, the server answers 400. - Extract notice on phones sits above the bottom navigation, text on top (two lines max) with the actions below. - Release v0.26.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
1.6 KiB
TypeScript
30 lines
1.6 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
||
import { buildBlockLink, isNoteLinkOnly, parseWikiLink, wikiLinkText } from '../wikiLink';
|
||
|
||
describe('wiki links', () => {
|
||
it('parses plain, labelled, section and bullet links', () => {
|
||
expect(parseWikiLink('Homelab')).toEqual({ title: 'Homelab', blockId: undefined, label: undefined });
|
||
expect(parseWikiLink('Homelab|hier')).toEqual({ title: 'Homelab', blockId: undefined, label: 'hier' });
|
||
expect(parseWikiLink('Homelab#Abschnitt')).toEqual({ title: 'Homelab', blockId: undefined, label: undefined });
|
||
expect(parseWikiLink('Homelab#^blk_a_1|Homelab › Backup')).toEqual({
|
||
title: 'Homelab', blockId: 'blk_a_1', label: 'Homelab › Backup',
|
||
});
|
||
});
|
||
|
||
it('builds a bullet link that parses back', () => {
|
||
const link = buildBlockLink('Homelab [neu]', 'blk_x', 'Backups liefen bisher nur manuell – das soll sich ändern #backup');
|
||
expect(link).toBe('[[Homelab neu#^blk_x|Homelab neu › Backups liefen bisher nur manuell – das…]]');
|
||
const parsed = parseWikiLink(link.slice(2, -2));
|
||
expect(parsed.blockId).toBe('blk_x');
|
||
expect(wikiLinkText(parsed)).toBe('Homelab neu › Backups liefen bisher nur manuell – das…');
|
||
});
|
||
|
||
it('recognises a bullet that is only a link to a note', () => {
|
||
expect(isNoteLinkOnly('[[Konzept: Garten]]')).toBe(true);
|
||
expect(isNoteLinkOnly('[[Konzept: Garten]] #draußen #idee')).toBe(true);
|
||
expect(isNoteLinkOnly('Siehe [[Konzept: Garten]]')).toBe(false);
|
||
expect(isNoteLinkOnly('[[Konzept: Garten]] und mehr')).toBe(false);
|
||
expect(isNoteLinkOnly('Garten')).toBe(false);
|
||
});
|
||
});
|