Skip to content

Commit 5577180

Browse files
committed
corrected (again) weight function expected test results
1 parent 2806be3 commit 5577180

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/analysis/weightFunction.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ describe('Weight Function correctly parses Argument Nodes if', () => {
5252
xtest('and the argument is passed in as a variable', () => {
5353
const query = `query variableQuery ($items: Int){ reviews(episode: NEWHOPE, first: $items) { stars, episode } }`;
5454
const queryAST: DocumentNode = parse(query);
55-
expect(getQueryTypeComplexity(queryAST, { items: 7, first: 4 }, typeWeights)).toBe(9);
56-
expect(getQueryTypeComplexity(queryAST, { first: 4, items: 7 }, typeWeights)).toBe(9);
55+
expect(getQueryTypeComplexity(queryAST, { items: 7, first: 4 }, typeWeights)).toBe(8);
56+
expect(getQueryTypeComplexity(queryAST, { first: 4, items: 7 }, typeWeights)).toBe(8);
5757
});
5858
});
5959

@@ -74,7 +74,7 @@ describe('Weight Function correctly parses Argument Nodes if', () => {
7474
xtest('and the argument is passed in as a variable', () => {
7575
const query = `query variableQuery ($items: Int){ heroes(episode: NEWHOPE, first: $items) { stars, episode } }`;
7676
const queryAST: DocumentNode = parse(query);
77-
expect(getQueryTypeComplexity(queryAST, { items: 7 }, typeWeights)).toBe(9);
77+
expect(getQueryTypeComplexity(queryAST, { items: 7 }, typeWeights)).toBe(8);
7878
});
7979
});
8080

@@ -84,13 +84,13 @@ describe('Weight Function correctly parses Argument Nodes if', () => {
8484
});
8585
const query = `query { heroes(episode: NEWHOPE, first: 3) { stars, episode } }`;
8686
const queryAST: DocumentNode = parse(query);
87-
expect(getQueryTypeComplexity(queryAST, {}, customTypeWeights)).toBe(5);
87+
expect(getQueryTypeComplexity(queryAST, {}, customTypeWeights)).toBe(10);
8888
});
8989

9090
test('variable names matching limiting keywords do not interfere with scalar argument values', () => {
9191
const query = `query variableQuery ($items: Int){ heroes(episode: NEWHOPE, first: 3) { stars, episode } }`;
9292
const queryAST: DocumentNode = parse(query);
93-
expect(getQueryTypeComplexity(queryAST, { first: 7 }, typeWeights)).toBe(5);
93+
expect(getQueryTypeComplexity(queryAST, { first: 7 }, typeWeights)).toBe(4);
9494
});
9595

9696
xtest('an invalid arg type is provided', () => {

0 commit comments

Comments
 (0)