Skip to content

Commit

Permalink
chore: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
c3b5aw committed Mar 17, 2023
1 parent db6ad86 commit 330a3a8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion examples/apollo/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ describe('startup', () => {
}`,
});
expect(query.errors).toBeDefined();
expect(query.errors?.map((e) => e.message)).toContain('Syntax Error: Query Cost limit of 100 exceeded, found 138.');
expect(query.errors?.map((e) => e.message)).toContain(
'Syntax Error: Query Cost limit of 100 exceeded, found 5023.',
);
});

it('should block field suggestion', async () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/yoga/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('startup', () => {
const body = JSON.parse(response.text);
expect(body.data?.books).toBeUndefined();
expect(body.errors).toBeDefined();
expect(body.errors?.map((e) => e.message)).toContain('Syntax Error: Query Cost limit of 100 exceeded, found 138.');
expect(body.errors?.map((e) => e.message)).toContain('Syntax Error: Query Cost limit of 100 exceeded, found 5023.');
});

it('should disable field suggestion', async () => {
Expand Down
4 changes: 3 additions & 1 deletion packages/plugins/cost-limit/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ describe('global', () => {
`);
assertSingleExecutionValue(result);
expect(result.errors).toBeDefined();
expect(result.errors?.map((error) => error.message)).toContain('Cannot spread fragment "A" within itself via "B".');
expect(result.errors?.map((error) => error.message)).toContain(
'Syntax Error: Query Cost limit of 50 exceeded, found 16050.',
);
});
});
4 changes: 3 additions & 1 deletion packages/plugins/max-depth/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ describe('global', () => {
`);
assertSingleExecutionValue(result);
expect(result.errors).toBeDefined();
expect(result.errors?.map((error) => error.message)).toContain('Cannot spread fragment "A" within itself via "B".');
expect(result.errors?.map((error) => error.message)).toContain(
'Syntax Error: Query depth limit of 3 exceeded, found 4.',
);
});
});

0 comments on commit 330a3a8

Please sign in to comment.