Skip to content

Commit

Permalink
test: tweak tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Strobotti committed May 30, 2023
1 parent 86db30f commit 3d10a7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/__tests__/JsonApiFetch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ describe('JsonApiFetch', () => {

const jsonApiFetch: JsonApiFetch<Article> = useJsonApiFetch(fetch, '/does/not/matter', deserializer);

jsonApiFetch.find({}, []).then((response: JsonApiResponse<Article>) => {
jsonApiFetch.find({}, ['author', 'comments']).then((response: JsonApiResponse<Article>) => {
expect(response).toMatchSnapshot();
});
});
Expand All @@ -460,7 +460,7 @@ describe('JsonApiFetch', () => {

const jsonApiFetch: JsonApiFetch<Folder> = useJsonApiFetch(fetch, '/does/not/matter', deserializer);

jsonApiFetch.find({}, []).then((response: JsonApiResponse<Folder>) => {
jsonApiFetch.find({}, ['children']).then((response: JsonApiResponse<Folder>) => {
expect(response).toMatchSnapshot();
});
});
Expand All @@ -471,7 +471,7 @@ describe('JsonApiFetch', () => {

const jsonApiFetch: JsonApiFetch<Folder> = useJsonApiFetch(fetch, '/does/not/matter', deserializer);

jsonApiFetch.find({}, []).then((response: JsonApiResponse<Folder>) => {
jsonApiFetch.find({}, ['children']).then((response: JsonApiResponse<Folder>) => {
expect(response).toMatchSnapshot();
});
});
Expand All @@ -482,7 +482,7 @@ describe('JsonApiFetch', () => {

const jsonApiFetch: JsonApiFetch<Folder> = useJsonApiFetch(fetch, '/does/not/matter', deserializer);

jsonApiFetch.find({}, []).then((response: JsonApiResponse<Folder>) => {
jsonApiFetch.findOne('1', []).then((response: JsonApiResponse<Folder>) => {
expect(response).toMatchSnapshot();
});
});
Expand Down
12 changes: 5 additions & 7 deletions src/__tests__/__snapshots__/JsonApiFetch.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@ exports[`JsonApiFetch deserializes the second file system example (single entity

exports[`JsonApiFetch deserializes the third file system example (single entity with relationships.children.links) into an object graph 1`] = `
{
"data": [
{
"children": [],
"id": 1,
"name": "root",
},
],
"data": {
"children": [],
"id": 1,
"name": "root",
},
}
`;

Expand Down

0 comments on commit 3d10a7c

Please sign in to comment.