From 30f9f86ad366c9c57e0877680826f96c202fcbd4 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Wed, 29 Jul 2020 15:58:43 +0200 Subject: [PATCH] Fix all the broken tests because of title change --- test/checklist_test.dart | 11 ++++++----- test/note_test.dart | 17 +++++++++-------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/test/checklist_test.dart b/test/checklist_test.dart index ac65e6ed..c5c2ef85 100644 --- a/test/checklist_test.dart +++ b/test/checklist_test.dart @@ -21,10 +21,10 @@ void main() { test('Should parse simple checklists', () async { var content = """--- -title: Foo +bar: Foo --- -# Title 1 +Title 1 How are you doing? @@ -75,10 +75,10 @@ Booga Wooga await checklist.note.save(); var expectedContent = """--- -title: Foo +bar: Foo --- -# Title 1 +Title 1 How are you doing? @@ -271,7 +271,8 @@ Booga Wooga checklist.removeAt(0); note = checklist.note; - expect(note.body, "#Title\n"); + expect(note.body, ""); + expect(note.title, "Title"); }); }); } diff --git a/test/note_test.dart b/test/note_test.dart index fa0e3c6d..dcaba5cb 100644 --- a/test/note_test.dart +++ b/test/note_test.dart @@ -20,7 +20,7 @@ void main() { test('Should respect modified key as modified', () async { var content = """--- -title: Foo +bar: Foo modified: 2017-02-15T22:41:19+01:00 --- @@ -38,7 +38,7 @@ Hello"""; await note.save(); var expectedContent = """--- -title: Foo +bar: Foo modified: 2019-12-02T04:00:00+00:00 --- @@ -50,7 +50,7 @@ Hello"""; test('Should respect modified key as mod', () async { var content = """--- -title: Foo +bar: Foo mod: 2017-02-15T22:41:19+01:00 --- @@ -68,7 +68,7 @@ Hello"""; await note.save(); var expectedContent = """--- -title: Foo +bar: Foo mod: 2019-12-02T04:00:00+00:00 --- @@ -80,7 +80,7 @@ Hello"""; test('Should read and write tags', () async { var content = """--- -title: Foo +bar: Foo tags: [A, B] --- @@ -104,7 +104,7 @@ Hello"""; await note.save(); var expectedContent = """--- -title: Foo +bar: Foo tags: [A, C, D] --- @@ -116,7 +116,7 @@ Hello"""; test('Should parse links', () async { var content = """--- -title: Foo +bar: Foo --- [Hi](./foo.md) @@ -163,7 +163,7 @@ title: Foo test('Should detect file format', () async { var content = """--- -title: Foo +bar: Foo --- Gee @@ -190,6 +190,7 @@ Gee expect(txtNote.fileFormat, NoteFileFormat.Txt); expect(txtNote.canHaveMetadata, false); expect(txtNote.title.isEmpty, true); + expect(txtNote.body, content); }); test('New Notes have a file extension', () async {