Skip to content

Commit d9d24c5

Browse files
committed
test added for fixed date_query not working for post list command
1 parent 76114c9 commit d9d24c5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

features/post.feature

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,18 @@ Feature: Manage WordPress posts
365365
| Publish post | publish-post | publish |
366366
| Sample Page | sample-page | publish |
367367

368+
When I run `wp post create --post_title='old post' --post_date='2023-01-24T09:52:00.000Z'`
369+
And I run `wp post create --post_title='new post' --post_date='2025-01-24T09:52:00.000Z'`
370+
And I run `wp post list --field=post_title --date_query='{"before":{"year":"2024"}}'`
371+
Then STDOUT should contain:
372+
"""
373+
old post
374+
"""
375+
And STDOUT should not contain:
376+
"""
377+
new post
378+
"""
379+
368380
Scenario: Update categories on a post
369381
When I run `wp term create category "Test Category" --porcelain`
370382
Then save STDOUT as {TERM_ID}

0 commit comments

Comments
 (0)