mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
122 lines
3.6 KiB
TypeScript
122 lines
3.6 KiB
TypeScript
import nock from "nock";
|
|
|
|
nock("https://api.strapi.refine.dev:443", { encodedQueryParams: true })
|
|
.post("/graphql", {
|
|
query: "mutation ($input: deletePostInput) {\n deletePost (input: $input) {\n post { id, title }\n }\n }",
|
|
variables: { input: { where: { id: "37" } } },
|
|
})
|
|
.reply(
|
|
200,
|
|
{ data: { deletePost: { post: { id: "37", title: "Hello" } } } },
|
|
[
|
|
"Server",
|
|
"nginx/1.17.10",
|
|
"Date",
|
|
"Fri, 17 Sep 2021 09:07:05 GMT",
|
|
"Content-Type",
|
|
"application/json",
|
|
"Content-Length",
|
|
"61",
|
|
"Connection",
|
|
"close",
|
|
"Vary",
|
|
"Origin",
|
|
"Strict-Transport-Security",
|
|
"max-age=31536000; includeSubDomains",
|
|
"X-Frame-Options",
|
|
"SAMEORIGIN",
|
|
"X-Powered-By",
|
|
"Strapi <strapi.io>",
|
|
"X-Response-Time",
|
|
"144ms",
|
|
],
|
|
);
|
|
|
|
nock("https://api.strapi.refine.dev:443", { encodedQueryParams: true })
|
|
.post("/graphql", {
|
|
query: "mutation ($input: deletePostInput) {\n deletePost (input: $input) {\n post { id, title }\n }\n }",
|
|
variables: { input: { where: { id: "38" } } },
|
|
})
|
|
.reply(
|
|
200,
|
|
{ data: { deletePost: { post: { id: "38", title: "Loem" } } } },
|
|
[
|
|
"Server",
|
|
"nginx/1.17.10",
|
|
"Date",
|
|
"Fri, 17 Sep 2021 09:07:05 GMT",
|
|
"Content-Type",
|
|
"application/json",
|
|
"Content-Length",
|
|
"60",
|
|
"Connection",
|
|
"close",
|
|
"Vary",
|
|
"Origin",
|
|
"Strict-Transport-Security",
|
|
"max-age=31536000; includeSubDomains",
|
|
"X-Frame-Options",
|
|
"SAMEORIGIN",
|
|
"X-Powered-By",
|
|
"Strapi <strapi.io>",
|
|
"X-Response-Time",
|
|
"129ms",
|
|
],
|
|
);
|
|
|
|
nock("https://api.strapi.refine.dev:443", { encodedQueryParams: true })
|
|
.post("/graphql", {
|
|
query: "mutation ($input: deletePostInput) {\n deletePost (input: $input) {\n post { id }\n }\n }",
|
|
variables: { input: { where: { id: "34" } } },
|
|
})
|
|
.reply(200, { data: { deletePost: { post: { id: "34" } } } }, [
|
|
"Server",
|
|
"nginx/1.17.10",
|
|
"Date",
|
|
"Fri, 17 Sep 2021 09:08:27 GMT",
|
|
"Content-Type",
|
|
"application/json",
|
|
"Content-Length",
|
|
"45",
|
|
"Connection",
|
|
"close",
|
|
"Vary",
|
|
"Origin",
|
|
"Strict-Transport-Security",
|
|
"max-age=31536000; includeSubDomains",
|
|
"X-Frame-Options",
|
|
"SAMEORIGIN",
|
|
"X-Powered-By",
|
|
"Strapi <strapi.io>",
|
|
"X-Response-Time",
|
|
"137ms",
|
|
]);
|
|
|
|
nock("https://api.strapi.refine.dev:443", { encodedQueryParams: true })
|
|
.post("/graphql", {
|
|
query: "mutation ($input: deletePostInput) {\n deletePost (input: $input) {\n post { id }\n }\n }",
|
|
variables: { input: { where: { id: "35" } } },
|
|
})
|
|
.reply(200, { data: { deletePost: { post: { id: "35" } } } }, [
|
|
"Server",
|
|
"nginx/1.17.10",
|
|
"Date",
|
|
"Fri, 17 Sep 2021 09:08:27 GMT",
|
|
"Content-Type",
|
|
"application/json",
|
|
"Content-Length",
|
|
"45",
|
|
"Connection",
|
|
"close",
|
|
"Vary",
|
|
"Origin",
|
|
"Strict-Transport-Security",
|
|
"max-age=31536000; includeSubDomains",
|
|
"X-Frame-Options",
|
|
"SAMEORIGIN",
|
|
"X-Powered-By",
|
|
"Strapi <strapi.io>",
|
|
"X-Response-Time",
|
|
"129ms",
|
|
]);
|