mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-07 00:36:13 +02:00
add some tests, black formatting
This commit is contained in:
parent
608f920d8f
commit
0c73448516
7 changed files with 68 additions and 34 deletions
17
features/data/journals/not_dayone2.json
Normal file
17
features/data/journals/not_dayone2.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"articles": [
|
||||
{
|
||||
"audio_files": [],
|
||||
"creation_date": "2020-01-10T12:22:12Z",
|
||||
"photo": [],
|
||||
"favourites": false,
|
||||
"tag": [],
|
||||
"body": "Entry Number One.",
|
||||
"time_zone": "Europe/London",
|
||||
"id": "EBB5A5F4057F461E8F176E18AB7E0493"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"version": "1.2"
|
||||
}
|
||||
}
|
|
@ -2,14 +2,26 @@ Feature: Day One 2.0 implementation details.
|
|||
|
||||
|
||||
Scenario: Loading a Day One 2.0 journal
|
||||
Given we use the config "dayone2.yaml"
|
||||
When we run "jrnl -n 2"
|
||||
Given we use the config "basic.yaml"
|
||||
When we run "jrnl --import dayone2 features/data/journals/dayone2.json"
|
||||
Then we should get no error
|
||||
and the output should be
|
||||
"""
|
||||
2020-01-10 12:21 Entry Number Two.
|
||||
| And a bit of text over here.
|
||||
and the output should contain "Journal exported to"
|
||||
|
||||
2020-01-10 12:22 Entry Number One.
|
||||
"""
|
||||
Scenario: Day One 2.0 schema validation fails
|
||||
Given we use the config "basic.yaml"
|
||||
When we run "jrnl --import dayone2 features/data/journals/not_dayone2.json"
|
||||
Then we should get no error
|
||||
and the output should contain "not the expected Day One 2 format."
|
||||
|
||||
Scenario: Verify conversion to jrnl
|
||||
Given we use the config "basic.yaml"
|
||||
When we run "jrnl --import dayone2 features/data/journals/dayone2.json"
|
||||
When we run "jrnl -ls"
|
||||
Then the output should be
|
||||
"""
|
||||
2013-06-09 15:39 My first entry.
|
||||
| Everything is alright
|
||||
|
||||
2013-06-10 15:40 Life is good.
|
||||
| But I'm better.
|
||||
"""
|
Loading…
Add table
Add a link
Reference in a new issue