Implement tag tests in JSON

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
This commit is contained in:
Micah Jerome Ellison 2021-04-10 14:58:10 -07:00 committed by Jonathan Wren
parent 3cc3e387c5
commit 48c9d9fa16
2 changed files with 25 additions and 13 deletions

View file

@ -6,11 +6,13 @@ Feature: Custom formats
When we run "jrnl --format json"
Then we should get no error
And the output should be valid JSON
And "entries" in the json output should have 3 elements
And "tags" in the json output should contain "@ipsum"
And "tags" in the json output should contain "@tagone"
And "tags" in the json output should contain "@tagthree"
And "tags" in the json output should contain "@tagtwo"
Given we parse the output as JSON
Then "entries" node in the parsed output should have 3 elements
And "tags" in the parsed output should be
@ipsum
@tagone
@tagtwo
@tagthree
And entry 1 should have an array "tags" with 3 elements
And entry 2 should have an array "tags" with 1 elements
And entry 3 should have an array "tags" with 2 elements