Suppress "Entry added" message if using default journal (#1561)

* Suppress "Entry added to default journal" message if using default journal
* Replace "Entry added" BDD test steps with "we should get no error" now that the message is suppressed
* Add positive and negative tests for "Entry added" message behavior
This commit is contained in:
Micah Jerome Ellison 2022-08-27 12:33:44 -07:00 committed by GitHub
parent bb6491bd06
commit f65f07dbcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 57 additions and 35 deletions

View file

@ -6,7 +6,7 @@ Feature: Searching in a journal
Scenario Outline: Displaying entries using -on today should display entries created today
Given we use the config "<config_file>"
When we run "jrnl today: Adding an entry right now."
Then the output should contain "Entry added"
Then we should get no error
When we run "jrnl -on today"
Then the output should contain "Adding an entry right now."
But the output should not contain "Everything is alright"
@ -21,11 +21,11 @@ Feature: Searching in a journal
Scenario Outline: Displaying entries using -from day should display correct entries
Given we use the config "<config_file>"
When we run "jrnl yesterday: This thing happened yesterday"
Then the output should contain "Entry added"
Then we should get no error
When we run "jrnl today at 11:59pm: Adding an entry right now."
Then the output should contain "Entry added"
Then we should get no error
When we run "jrnl tomorrow: A future entry."
Then the output should contain "Entry added"
Then we should get no error
When we run "jrnl -from today"
Then the output should contain "2 entries found"
And the output should contain "Adding an entry right now."
@ -42,11 +42,11 @@ Feature: Searching in a journal
Given we use the config "<config_file>"
And now is "2022-03-10 02:32:00 PM"
When we run "jrnl yesterday: This thing happened yesterday"
Then the output should contain "Entry added"
Then we should get no error
When we run "jrnl today at 11:59pm: Adding an entry right now."
Then the output should contain "Entry added"
Then we should get no error
When we run "jrnl tomorrow: A future entry."
Then the output should contain "Entry added"
Then we should get no error
When we run "jrnl -from yesterday -to today"
Then the output should contain "2 entries found"
And the output should contain "This thing happened yesterday"
@ -140,9 +140,9 @@ Feature: Searching in a journal
Scenario: Out of order entries to a Folder journal should be listed in date order
Given we use the config "empty_folder.yaml"
When we run "jrnl 3/7/2014 4:37pm: Second entry of journal."
Then the output should contain "Entry added"
Then we should get no error
When we run "jrnl 23 July 2013: Testing folder journal."
Then the output should contain "Entry added"
Then we should get no error
When we run "jrnl -2"
Then the output should be
2013-07-23 09:00 Testing folder journal.