mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 02:48:51 +08:00
Replace test with simpler test
Also lets not auto convert old notes title format.
This commit is contained in:
@ -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', () {
|
||||
|
@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user