-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ Add test for optional stages in GraphQL field to aggregation mapping
- Loading branch information
Showing
2 changed files
with
39 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,14 +109,18 @@ Scenario: Get a list of posts by category and for each one return the author nam | |
When method POST | ||
Then status 200 | ||
|
||
Scenario: Get users with all posts in backend category | ||
Scenario: Get users with all posts in backend category. Uses arg with default value and optional stage. | ||
* text query = | ||
""" | ||
{ | ||
userByEmail(email: "[email protected]"){ | ||
name | ||
postsByCategory(category: backend) { | ||
postsByCategoryAggr(category: backend) { | ||
body | ||
flag | ||
} | ||
postsByCategoryQuery(category: backend) { | ||
body | ||
} | ||
} | ||
|
@@ -128,16 +132,22 @@ Scenario: Get users with all posts in backend category | |
And request query | ||
When method POST | ||
Then status 200 | ||
And match $.data.userByEmail.postsByCategory.length() == 2 | ||
And match $.data.userByEmail.postsByCategoryAggr.length() == 2 | ||
And match $.data.userByEmail.postsByCategoryAggr[*].flag == [true,true] | ||
And match $.data.userByEmail.postsByCategoryQuery.length() == 2 | ||
|
||
Scenario: Get users with all posts in frontend category | ||
Scenario: Get users with all posts in frontend category. Uses arg with default value and optional stage. | ||
* text query = | ||
""" | ||
{ | ||
userByEmail(email: "[email protected]"){ | ||
name | ||
postsByCategory(category: frontend) { | ||
postsByCategoryAggr(category: frontend) { | ||
body | ||
flag | ||
} | ||
postsByCategoryQuery(category: frontend) { | ||
body | ||
} | ||
} | ||
|
@@ -149,16 +159,22 @@ Scenario: Get users with all posts in frontend category | |
And request query | ||
When method POST | ||
Then status 200 | ||
And match $.data.userByEmail.postsByCategory.length() == 1 | ||
And match $.data.userByEmail.postsByCategoryAggr.length() == 1 | ||
And match $.data.userByEmail.postsByCategoryAggr[*].flag == [true] | ||
And match $.data.userByEmail.postsByCategoryQuery.length() == 1 | ||
|
||
Scenario: Get users with all posts in the default category (backend). this uses arg with default value | ||
Scenario: Get users with all posts in the default category (backend). Uses arg with default value and optional stage. | ||
* text query = | ||
""" | ||
{ | ||
userByEmail(email: "[email protected]"){ | ||
name | ||
postsByCategory { | ||
postsByCategoryAggr { | ||
body | ||
flag | ||
} | ||
postsByCategoryQuery { | ||
body | ||
} | ||
} | ||
|
@@ -170,7 +186,9 @@ Scenario: Get users with all posts in the default category (backend). this uses | |
And request query | ||
When method POST | ||
Then status 200 | ||
And match $.data.userByEmail.postsByCategory.length() == 2 | ||
And match $.data.userByEmail.postsByCategoryAggr.length() == 2 | ||
And match $.data.userByEmail.postsByCategoryAggr[*].flag == [false, false] | ||
And match $.data.userByEmail.postsByCategoryQuery.length() == 2 | ||
|
||
Scenario: Map query field to aggregation to count the number of posts by category | ||
* text query = | ||
|