From 2668d14510907fdaee1e042381c7ef0fbca03641 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Wed, 19 Aug 2020 11:40:50 +0200 Subject: [PATCH] Replace test with simpler test Also lets not auto convert old notes title format. --- test/note_serializer_test.dart | 5 +++-- test/note_test.dart | 34 ---------------------------------- 2 files changed, 3 insertions(+), 36 deletions(-) diff --git a/test/note_serializer_test.dart b/test/note_serializer_test.dart index 3ba3671c..6036842b 100644 --- a/test/note_serializer_test.dart +++ b/test/note_serializer_test.dart @@ -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', () { diff --git a/test/note_test.dart b/test/note_test.dart index f83684a7..16e71c1d 100644 --- a/test/note_test.dart +++ b/test/note_test.dart @@ -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); - }); }); }