From e46b5a171f5e819007c5836ef42378296de73451 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 12 Mar 2022 13:14:26 -0800 Subject: [PATCH] Fix tests for daylight savings (#1423) * fix test failing because tomorrow is daylight savings * add test for newly discovered daylight savings issue (and skip for now) * whitespace change * update title of test * fix copypasta --- tests/bdd/features/datetime.feature | 26 ++++++++++++++++++++++++++ tests/bdd/features/search.feature | 1 + 2 files changed, 27 insertions(+) diff --git a/tests/bdd/features/datetime.feature b/tests/bdd/features/datetime.feature index 167dcf33..7676f1b2 100644 --- a/tests/bdd/features/datetime.feature +++ b/tests/bdd/features/datetime.feature @@ -83,6 +83,7 @@ Feature: Reading and writing to journal with custom date formats Then the output should not contain "Life is good" And the output should not contain "But I'm better." + Scenario Outline: Create entry using day of the week as entry date one. Given we use the config "simple.yaml" And now is "2019-03-12 01:30:32 PM" @@ -172,3 +173,28 @@ Feature: Reading and writing to journal with custom date formats Then we should get no error And the output should be 2013-10-27 03:27 Some text. + + + @skip #1422 + Scenario Outline: Using "tomorrow" near daylight savings works in Dayone journals + Given we use the config "dayone.yaml" + And now is "" + When we run "jrnl yesterday: This thing happened yesterday" + Then the output should contain "Entry added" + When we run "jrnl today at 11:59pm: Adding an entry right now." + Then the output should contain "Entry added" + When we run "jrnl tomorrow: A future entry." + Then the output should contain "Entry added" + When we run "jrnl -from yesterday -to today" + Then the output should contain "This thing happened yesterday" + And the output should contain "Adding an entry right now." + And the output should not contain "A future entry." + + Examples: Dates + | date | + | 2022-02-10 01:00:00 PM | + | 2021-03-13 01:00:00 PM | + | 2021-11-06 01:00:00 PM | + | 2022-03-12 01:00:00 PM | + | 2022-11-05 01:00:00 PM | + diff --git a/tests/bdd/features/search.feature b/tests/bdd/features/search.feature index d52273f6..44e8dc6d 100644 --- a/tests/bdd/features/search.feature +++ b/tests/bdd/features/search.feature @@ -36,6 +36,7 @@ Feature: Searching in a journal Scenario Outline: Displaying entries using -from and -to day should display correct entries Given we use the config "" + 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" When we run "jrnl today at 11:59pm: Adding an entry right now."