From 991af6e1fbb44aa8c155698b2955b3b671c04f26 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Sat, 6 Jun 2020 13:52:23 +0200 Subject: [PATCH] Add a test to make sure new notes always have a file extension This bug has appeared way too many times --- test/note_test.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/note_test.dart b/test/note_test.dart index 53b326ec..b62d9ef9 100644 --- a/test/note_test.dart +++ b/test/note_test.dart @@ -170,5 +170,12 @@ Gee expect(txtNote.canHaveMetadata, false); expect(txtNote.title.isEmpty, true); }); + + test('New Notes have a file extension', () async { + var parentFolder = NotesFolderFS(null, tempDir.path); + var note = Note.newNote(parentFolder); + var path = note.filePath; + expect(path.endsWith('.md'), true); + }); }); }