Allow editing of DayOne entries (#1001)

* add test to repro issue #955

* Allow editing of DayOne entries

* Add broken test for Dayone

Add test for editing Dayone entries (this test currently fails)

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>

* Fix editing logic for DayOneJournal

DayOneJournal previously reimplemented Journal._parse inside of
DayOneJournal.parse_editable_string, and in doing so caused issues
between itself and the class it was inheriting from. This commit fixes
the issue by moving the UUID to be in the body of the entry, rather than
above it. So, then Journal._parse still finds the correct boundaries
between entries, and DayOneJournal then parses the UUID afterward.

Co-authored-by: MinchinWeb <w_minchin@hotmail.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
Jonathan Wren 2020-07-18 12:54:52 -07:00 committed by GitHub
parent 4c2f2861db
commit a11aa24c7e
5 changed files with 85 additions and 82 deletions

View file

@ -75,3 +75,21 @@ Feature: Dayone specific implementation details.
and the json output should contain entries.0.creator.generation_date
and the json output should contain entries.0.creator.device_agent
and "entries.0.creator.software_agent" in the json output should contain "jrnl"
Scenario: Editing Dayone with mock editor
Given we use the config "dayone.yaml"
When we run "jrnl --edit"
Then we should get no error
Scenario: Editing Dayone entries
Given we use the config "dayone.yaml"
When we open the editor and append
"""
Here is the first line.
Here is the second line.
"""
When we run "jrnl -n 1"
Then we should get no error
and the output should contain "This entry is starred!"
and the output should contain "Here is the first line"
and the output should contain "Here is the second line"