Files
GitJournal/test/processors/wiki_links_auto_add_test.dart
Vishesh Handa 25f516c15c Add the scaffolding for automatically adding Wiki Links
The idea is that on save a Note, terms which have already been used
before as Wiki Links should automatically be converted into Wiki Links.
2020-09-02 17:02:13 +02:00

22 lines
711 B
Dart

import 'package:test/test.dart';
import 'package:gitjournal/core/processors/wiki_links_auto_add.dart';
void main() {
test('Should process body', () {
var body =
"GitJournal is the best? And it works quite well with Foam, Foam and Obsidian.";
var p = WikiLinksAutoAddProcessor(null);
var newBody = p.processBody(body, ['GitJournal', 'Foam', 'Obsidian']);
var expectedBody =
"[[GitJournal]] is the best? And it works quite well with [[Foam]], [[Foam]] and [[Obsidian]].";
expect(newBody, expectedBody);
});
// Add a test to see if processing a Note works
// FIXME: Make sure the wiki link terms do not have special characters
// FIXME: WHat about piped links?
}