|
| 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 | + { label: "emptyCustomer with return null", |
| 12 | + query: '{emptyCustomer(id:1){name city }}', |
| 13 | + expected: {emptyCustomer: null}, |
| 14 | + }, |
| 15 | + { label: "customer(1)", |
| 16 | + query: '{customer(id:1){name city }}', |
| 17 | + expected: {customer: {name:'John Doe',city:'Miami'}}, |
| 18 | + }, |
| 19 | + { label: "customer(2) with pass default state value", |
| 20 | + query: '{customer(id:2){name city state }}', |
| 21 | + expected: {customer: {name:'John Doe',city:'Miami',state:"Florida"}}, |
| 22 | + }, |
| 23 | + { label: "return pi const value 3.14159", |
| 24 | + query: '{pi}', |
| 25 | + expected: {pi:3.14159}, |
| 26 | + }, |
| 27 | + { label: "return direction static value", |
| 28 | + query: '{direction}', |
| 29 | + expected: {direction:'EAST'}, |
| 30 | + }, |
| 31 | + { label: "return customer(3) with @override ", |
| 32 | + query: '{override_value(id:3){name}}', |
| 33 | + expected: {override_value:{name:"mark"}}, |
| 34 | + } |
| 35 | + ] |
| 36 | + return deployAndRun(__dirname, tests, stepzen.admin); |
| 37 | + }); |
| 38 | + |
0 commit comments