2114 timebox make sure the zapier integrations supports custom objects (#3091)

* Fix build command

* Add hidden trigger to fetch object names

* Remove useless actions

* Rename createObject to createRecord
This commit is contained in:
martmull
2023-12-20 18:41:30 +01:00
committed by GitHub
parent 984fc76b94
commit b1841d0e2f
18 changed files with 273 additions and 292 deletions

View File

@ -0,0 +1,8 @@
import { capitalize } from "../../utils/capitalize";
describe('capitalize', ()=> {
test('should capitalize properly', ()=> {
expect(capitalize('word')).toEqual('Word')
expect(capitalize('word word')).toEqual('Word word')
})
})

View File

@ -0,0 +1,42 @@
import { computeInputFields } from "../../utils/computeInputFields";
describe('computeInputFields', ()=> {
test('should create Person input fields properly', ()=> {
const personInfos = {
type: "object",
properties: {
email: {
type: "string"
},
xLink: {
type: "object",
properties: {
url: {
type: "string"
},
label: {
type: "string"
}
}
},
avatarUrl: {
type: "string"
},
favorites: {
type: "array",
items: {
$ref: "#/components/schemas/Favorite"
}
},
},
example: {},
required: ['avatarUrl']
}
expect(computeInputFields(personInfos)).toEqual([
{ key: "email", label: "Email", required: false, type: "string" },
{ key: "xLink__url", label: "X Link: Url", required: false, type: "string" },
{ key: "xLink__label", label: "X Link: Label", required: false, type: "string" },
{ key: "avatarUrl", label: "Avatar Url", required: true, type: "string" },
])
})
})

View File

@ -0,0 +1,7 @@
import { labelling } from "../../utils/labelling";
describe('labelling', ()=> {
test('should label properly', ()=> {
expect(labelling('createdAt')).toEqual('Created At')
})
})