mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
34 lines
896 B
TypeScript
34 lines
896 B
TypeScript
import dataProvider from "../../src/index";
|
|
import client from "../gqlClient";
|
|
import "./index.mock";
|
|
|
|
describe("deleteOne", () => {
|
|
it("correct response with meta", async () => {
|
|
const { data } = await dataProvider(client).deleteOne({
|
|
resource: "posts",
|
|
id: "43",
|
|
meta: {
|
|
fields: [
|
|
{
|
|
operation: "post",
|
|
fields: ["id", "title"],
|
|
variables: {},
|
|
},
|
|
],
|
|
},
|
|
});
|
|
|
|
expect(data.id).toEqual("43");
|
|
expect(data.title).toEqual("foo");
|
|
});
|
|
|
|
it("correct response without meta", async () => {
|
|
const { data } = await dataProvider(client).deleteOne({
|
|
resource: "posts",
|
|
id: "48",
|
|
});
|
|
|
|
expect(data.id).toEqual("48");
|
|
});
|
|
});
|