This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 787
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplified the MockedProvider (#1882)
* Simplified the MockedProvider * Fixed linter errors * Added changelog
- Loading branch information
1 parent
fd4d704
commit 884d81f
Showing
5 changed files
with
91 additions
and
103 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
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 |
---|---|---|
@@ -1,34 +1,34 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`allows for passing a custom client 1`] = ` | ||
exports[`allows for querying with the typename 1`] = ` | ||
Object { | ||
"__typename": "User", | ||
"id": "user_id", | ||
Symbol(id): "User:user_id", | ||
} | ||
`; | ||
|
||
exports[`errors if the variables in the mock and component do not match 1`] = ` | ||
exports[`errors if the query in the mock and component do not match 1`] = ` | ||
[Error: Network error: No more mocked responses for the query: query GetUser($username: String!) { | ||
user(username: $username) { | ||
id | ||
__typename | ||
} | ||
} | ||
, variables: {"username":"other_user"}] | ||
, variables: {"username":"mock_username"}] | ||
`; | ||
|
||
exports[`mocks the data and adds the typename to the query 1`] = ` | ||
Object { | ||
"__typename": "User", | ||
"id": "user_id", | ||
Symbol(id): "User:user_id", | ||
exports[`errors if the variables in the mock and component do not match 1`] = ` | ||
[Error: Network error: No more mocked responses for the query: query GetUser($username: String!) { | ||
user(username: $username) { | ||
id | ||
} | ||
} | ||
, variables: {"username":"other_user"}] | ||
`; | ||
|
||
exports[`mocks the data without adding the typename 1`] = ` | ||
exports[`mocks the data 1`] = ` | ||
Object { | ||
"id": "user_id", | ||
Symbol(id): "$ROOT_QUERY.user({\\"username\\":\\"mock_username\\"})", | ||
Symbol(id): "User:user_id", | ||
} | ||
`; |
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
Oops, something went wrong.