mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-09-11 05:22:55 +08:00

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.
22 lines
711 B
Dart
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?
|
|
}
|