mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-07 16:56:13 +02:00
Add prompt for --change-time
This commit is contained in:
parent
3f7dd19d90
commit
0f791cf69a
3 changed files with 79 additions and 37 deletions
|
@ -4,7 +4,8 @@ Feature: Change entry times in journal
|
|||
And we use the password "test" if prompted
|
||||
When we run "jrnl -1"
|
||||
Then the output should contain "2020-09-24 09:14 The third entry finally"
|
||||
When we run "jrnl -1 --change-time '2022-04-23 10:30'"
|
||||
When we run "jrnl -1 --change-time '2022-04-23 10:30'" and enter
|
||||
Y
|
||||
When we run "jrnl -99 --short"
|
||||
Then the output should be
|
||||
2020-08-29 11:11 Entry the first.
|
||||
|
@ -18,6 +19,28 @@ Feature: Change entry times in journal
|
|||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
||||
Scenario Outline: Change flag changes prompted entries
|
||||
Given we use the config "<config_file>"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl -1"
|
||||
Then the output should contain "2020-09-24 09:14 The third entry finally"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30'" and enter
|
||||
Y
|
||||
N
|
||||
Y
|
||||
When we run "jrnl -99 --short"
|
||||
Then the output should be
|
||||
2020-08-31 14:32 A second entry in what I hope to be a long series.
|
||||
2022-04-23 10:30 Entry the first.
|
||||
2022-04-23 10:30 The third entry finally after weeks without writing.
|
||||
|
||||
Examples: Configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
| basic_encrypted.yaml |
|
||||
| basic_folder.yaml |
|
||||
# | basic_dayone.yaml | @todo
|
||||
|
||||
|
||||
Scenario Outline: Change time flag with nonsense input changes nothing
|
||||
Given we use the config "<config_file>"
|
||||
|
@ -38,7 +61,8 @@ Feature: Change entry times in journal
|
|||
|
||||
Scenario Outline: Change time flag with tag only changes tagged entries
|
||||
Given we use the config "<config_file>"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' @ipsum"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' @ipsum" and enter
|
||||
Y
|
||||
When we run "jrnl -99 --short"
|
||||
Then the output should be
|
||||
2020-08-31 14:32 A second entry in what I hope to be a long series.
|
||||
|
@ -54,7 +78,9 @@ Feature: Change entry times in journal
|
|||
|
||||
Scenario Outline: Change time flag with multiple tags changes all entries matching any of the tags
|
||||
Given we use the config "<config_file>"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' @ipsum @tagthree"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' @ipsum @tagthree" and enter
|
||||
Y
|
||||
Y
|
||||
When we run "jrnl -99 --short"
|
||||
Then the output should be
|
||||
2020-08-31 14:32 A second entry in what I hope to be a long series.
|
||||
|
@ -70,7 +96,8 @@ Feature: Change entry times in journal
|
|||
|
||||
Scenario Outline: Change time flag with -and changes boolean AND of tagged entries
|
||||
Given we use the config "<config_file>"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' -and @tagone @tagtwo"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' -and @tagone @tagtwo" and enter
|
||||
Y
|
||||
When we run "jrnl -99 --short"
|
||||
Then the output should be
|
||||
2020-08-31 14:32 A second entry in what I hope to be a long series.
|
||||
|
@ -86,7 +113,8 @@ Feature: Change entry times in journal
|
|||
|
||||
Scenario Outline: Change time flag with -not does not change entries from given tag
|
||||
Given we use the config "<config_file>"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' @tagone -not @ipsum"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' @tagone -not @ipsum" and enter
|
||||
Y
|
||||
When we run "jrnl -99 --short"
|
||||
Then the output should be
|
||||
2020-08-29 11:11 Entry the first.
|
||||
|
@ -102,7 +130,8 @@ Feature: Change entry times in journal
|
|||
|
||||
Scenario Outline: Change time flag with -from search operator only changes entries since that date
|
||||
Given we use the config "<config_file>"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' -from 2020-09-01"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' -from 2020-09-01" and enter
|
||||
Y
|
||||
When we run "jrnl -99 --short"
|
||||
Then the output should be
|
||||
2020-08-29 11:11 Entry the first.
|
||||
|
@ -118,7 +147,9 @@ Feature: Change entry times in journal
|
|||
|
||||
Scenario Outline: Change time flag with -to only changes entries up to specified date
|
||||
Given we use the config "<config_file>"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' -to 2020-08-31"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' -to 2020-08-31" and enter
|
||||
Y
|
||||
Y
|
||||
When we run "jrnl -99 --short"
|
||||
Then the output should be
|
||||
2020-09-24 09:14 The third entry finally after weeks without writing.
|
||||
|
@ -134,7 +165,8 @@ Feature: Change entry times in journal
|
|||
|
||||
Scenario Outline: Change time flag with -starred only changes starred entries
|
||||
Given we use the config "<config_file>"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' -starred"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' -starred" and enter
|
||||
Y
|
||||
When we run "jrnl -99 --short"
|
||||
Then the output should be
|
||||
2020-08-29 11:11 Entry the first.
|
||||
|
@ -150,7 +182,8 @@ Feature: Change entry times in journal
|
|||
|
||||
Scenario Outline: Change time flag with -contains only changes entries containing expression
|
||||
Given we use the config "<config_file>"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' -contains dignissim"
|
||||
When we run "jrnl --change-time '2022-04-23 10:30' -contains dignissim" and enter
|
||||
Y
|
||||
When we run "jrnl -99 --short"
|
||||
Then the output should be
|
||||
2020-08-31 14:32 A second entry in what I hope to be a long series.
|
||||
|
@ -167,8 +200,10 @@ Feature: Change entry times in journal
|
|||
Scenario Outline: Change time flag with no enties specified changes nothing
|
||||
Given we use the config "<config_file>"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl --change-time"
|
||||
Then the output should contain "No entries to modify"
|
||||
When we run "jrnl --change-time" and enter
|
||||
N
|
||||
N
|
||||
N
|
||||
When we run "jrnl -99 --short"
|
||||
Then the output should be
|
||||
2020-08-29 11:11 Entry the first.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue