Files
GitJournal/test/processors/image_extractor_test.dart
Vishesh Handa 6e289a6b6e Note: Add an API to get the images from a note
This will be used in the future to display the images in the grid/card
view.
2020-09-03 12:26:45 +02:00

21 lines
437 B
Dart

import 'package:test/test.dart';
import 'package:gitjournal/core/processors/image_extractor.dart';
void main() {
test('Should parse simple tags', () {
var body = """#hello Hi
![alt](../final.img)
![alt2](../final2.img)
""";
var p = ImageExtractor();
var images = p.extract(body);
expect(images, {
NoteImage(alt: 'alt', url: '../final.img'),
NoteImage(alt: 'alt2', url: '../final2.img'),
});
});
}