PromucFlow_constructor/app/client/src/transformers/RestActionTransformers.test.ts

50 lines
878 B
TypeScript
Raw Normal View History

2019-12-23 12:12:58 +00:00
import { transformRestAction } from "transformers/RestActionTransformer";
import { RestAction } from "api/ActionAPI";
const input: RestAction = {
pageId: "",
pluginId: "",
2019-12-23 12:12:58 +00:00
id: "testId",
datasource: {
id: "testDataSource",
},
name: "testName",
pluginType: "API",
actionConfiguration: {
path: "users?page=1",
queryParameters: [
{
key: "page",
value: "1",
},
],
},
jsonPathKeys: [],
};
const output = {
pageId: "",
pluginId: "",
2019-12-23 12:12:58 +00:00
id: "testId",
datasource: {
id: "testDataSource",
},
name: "testName",
pluginType: "API",
actionConfiguration: {
path: "users",
queryParameters: [
{
key: "page",
value: "1",
},
],
},
jsonPathKeys: [],
};
it("Transform the input", () => {
const result = transformRestAction(input);
expect(result).toEqual(output);
});