Skip to content

Commit fa15bd9

Browse files
committed
test: add tests
1 parent 827e84e commit fa15bd9

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

protection/visibility/customer.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ type Customer @mock {
1717

1818
type Order @mock {
1919
date: Date! @mockfn(name: "PastDate", values: 5)
20-
cost: Float!
20+
cost: Int! @mockfn(name: "NumberRange", values: [1, 500])
2121
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
const {
2+
deployAndRun,
3+
stepzen,
4+
getTestDescription,
5+
} = require("../../../tests/gqltest.js");
6+
7+
testDescription = getTestDescription("snippets", __dirname);
8+
9+
describe(testDescription, function () {
10+
const tests = [
11+
{
12+
label: "customer",
13+
query:
14+
'{customer(email:"[email protected]") {id name email orders {cost}}}',
15+
expected: {
16+
customer: {
17+
id: "464979",
18+
name: "Lesch",
19+
20+
orders: [
21+
{
22+
cost: 100,
23+
},
24+
],
25+
},
26+
},
27+
},
28+
{
29+
label: "query-fields",
30+
query: "{__schema {queryType {fields {name}}}}",
31+
expected: {
32+
__schema: {
33+
queryType: {
34+
fields: [
35+
{
36+
name: "customer",
37+
},
38+
],
39+
},
40+
},
41+
},
42+
},
43+
];
44+
return deployAndRun(__dirname, tests, stepzen.admin);
45+
});

0 commit comments

Comments
 (0)