OpenPanel/packages/graphql/test/getOne/index.mock.ts
Stefan Pejcic 8595a9f4e5 back
2024-05-08 19:58:53 +02:00

43 lines
1.1 KiB
TypeScript

import nock from "nock";
nock("https://api.strapi.refine.dev:443", { encodedQueryParams: true })
.post("/graphql", {
query: "query ($id: ID!) { post (id: $id) { id, title, content, category { id } } }",
variables: { id: "45" },
})
.reply(
200,
{
data: {
post: {
id: "45",
title: "foo",
content: "bar",
category: { id: "2" },
},
},
},
[
"Server",
"nginx/1.17.10",
"Date",
"Thu, 16 Sep 2021 14:47:17 GMT",
"Content-Type",
"application/json",
"Content-Length",
"82",
"Connection",
"close",
"Vary",
"Origin",
"Strict-Transport-Security",
"max-age=31536000; includeSubDomains",
"X-Frame-Options",
"SAMEORIGIN",
"X-Powered-By",
"Strapi <strapi.io>",
"X-Response-Time",
"32ms",
],
);