Fix all the broken tests because of title change

This commit is contained in:
Vishesh Handa
2020-07-29 15:58:43 +02:00
parent 4a97d03bd8
commit 30f9f86ad3
2 changed files with 15 additions and 13 deletions

View File

@ -21,10 +21,10 @@ void main() {
test('Should parse simple checklists', () async { test('Should parse simple checklists', () async {
var content = """--- var content = """---
title: Foo bar: Foo
--- ---
# Title 1 Title 1
How are you doing? How are you doing?
@ -75,10 +75,10 @@ Booga Wooga
await checklist.note.save(); await checklist.note.save();
var expectedContent = """--- var expectedContent = """---
title: Foo bar: Foo
--- ---
# Title 1 Title 1
How are you doing? How are you doing?
@ -271,7 +271,8 @@ Booga Wooga
checklist.removeAt(0); checklist.removeAt(0);
note = checklist.note; note = checklist.note;
expect(note.body, "#Title\n"); expect(note.body, "");
expect(note.title, "Title");
}); });
}); });
} }

View File

@ -20,7 +20,7 @@ void main() {
test('Should respect modified key as modified', () async { test('Should respect modified key as modified', () async {
var content = """--- var content = """---
title: Foo bar: Foo
modified: 2017-02-15T22:41:19+01:00 modified: 2017-02-15T22:41:19+01:00
--- ---
@ -38,7 +38,7 @@ Hello""";
await note.save(); await note.save();
var expectedContent = """--- var expectedContent = """---
title: Foo bar: Foo
modified: 2019-12-02T04:00:00+00:00 modified: 2019-12-02T04:00:00+00:00
--- ---
@ -50,7 +50,7 @@ Hello""";
test('Should respect modified key as mod', () async { test('Should respect modified key as mod', () async {
var content = """--- var content = """---
title: Foo bar: Foo
mod: 2017-02-15T22:41:19+01:00 mod: 2017-02-15T22:41:19+01:00
--- ---
@ -68,7 +68,7 @@ Hello""";
await note.save(); await note.save();
var expectedContent = """--- var expectedContent = """---
title: Foo bar: Foo
mod: 2019-12-02T04:00:00+00:00 mod: 2019-12-02T04:00:00+00:00
--- ---
@ -80,7 +80,7 @@ Hello""";
test('Should read and write tags', () async { test('Should read and write tags', () async {
var content = """--- var content = """---
title: Foo bar: Foo
tags: [A, B] tags: [A, B]
--- ---
@ -104,7 +104,7 @@ Hello""";
await note.save(); await note.save();
var expectedContent = """--- var expectedContent = """---
title: Foo bar: Foo
tags: [A, C, D] tags: [A, C, D]
--- ---
@ -116,7 +116,7 @@ Hello""";
test('Should parse links', () async { test('Should parse links', () async {
var content = """--- var content = """---
title: Foo bar: Foo
--- ---
[Hi](./foo.md) [Hi](./foo.md)
@ -163,7 +163,7 @@ title: Foo
test('Should detect file format', () async { test('Should detect file format', () async {
var content = """--- var content = """---
title: Foo bar: Foo
--- ---
Gee Gee
@ -190,6 +190,7 @@ Gee
expect(txtNote.fileFormat, NoteFileFormat.Txt); expect(txtNote.fileFormat, NoteFileFormat.Txt);
expect(txtNote.canHaveMetadata, false); expect(txtNote.canHaveMetadata, false);
expect(txtNote.title.isEmpty, true); expect(txtNote.title.isEmpty, true);
expect(txtNote.body, content);
}); });
test('New Notes have a file extension', () async { test('New Notes have a file extension', () async {