Replace test with simpler test

Also lets not auto convert old notes title format.
This commit is contained in:
Vishesh Handa
2020-08-19 11:40:50 +02:00
parent ada656c675
commit 2668d14510
2 changed files with 3 additions and 36 deletions

View File

@ -95,8 +95,9 @@ void main() {
expect(note.title, "Why not ☕?");
serializer.encode(note, doc);
expect(doc.body, "# Why not :coffee:?\n\nI :heart: you");
expect(doc.props.length, 0);
expect(note.body, "I ❤️ you");
expect(note.title, "Why not ☕?");
expect(doc.props.length, 1);
});
test('Test Note ExtraProps', () {

View File

@ -217,39 +217,5 @@ Gee
expect(txtNote.title.isEmpty, true);
expect(txtNote.body, content);
});
test('Yaml is not touched with yaml disabled', () async {
var content = """---
layout: post
title: Blogging
date: 2020-08-12T13:53:52+02:00
categories: can-learn-foo
permalink: /:categories
---
Blah blah""";
var notePath = p.join(tempDir.path, "note63345.md");
await File(notePath).writeAsString(content);
var parentFolder = NotesFolderFS(null, tempDir.path);
var note = Note(parentFolder, notePath);
await note.load();
note.body = "Howdy";
await note.save();
var actualContent = await File(notePath).readAsString();
var expectedContent = """---
layout: post
title: Blogging
date: 2020-08-12T13:53:52+02:00
categories: can-learn-foo
permalink: /:categories
---
Howdy""";
expect(actualContent, expectedContent);
});
});
}