Milestone 0: import zappier billing, Verae middleware, and Zapier research
Compose-ready workspace: packages/zappier (rate card, portal, Stripe), packages/verae-zapier-middleware (timestamp + NATS), packages/verae-zapier (CLI app), vendor/zapier-platform, and research/zapier vendor corpus. Gate 0 structure checks pass. Product code and research are not yet wired.
This commit is contained in:
commit
b4150c8250
1364 changed files with 6814366 additions and 0 deletions
73
vendor/zapier-platform/packages/schema/test/functional-constraints/labelWhenVisible.js
vendored
Normal file
73
vendor/zapier-platform/packages/schema/test/functional-constraints/labelWhenVisible.js
vendored
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
const should = require('should');
|
||||
const schema = require('../../schema');
|
||||
|
||||
describe('labelWhenVisible', () => {
|
||||
it('should not error when label is gone and action is hidden', () => {
|
||||
const definition = {
|
||||
version: '1.0.0',
|
||||
platformVersion: '1.0.0',
|
||||
creates: {
|
||||
foo: {
|
||||
key: 'foo',
|
||||
noun: 'Foo',
|
||||
display: {
|
||||
hidden: true,
|
||||
},
|
||||
operation: {
|
||||
perform: '$func$2$f$',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const results = schema.validateAppDefinition(definition);
|
||||
results.errors.should.have.length(0);
|
||||
});
|
||||
|
||||
it('should error when label is missing and action is visible ', () => {
|
||||
const definition = {
|
||||
version: '1.0.0',
|
||||
platformVersion: '1.0.0',
|
||||
creates: {
|
||||
foo: {
|
||||
key: 'foo',
|
||||
noun: 'Foo',
|
||||
display: {
|
||||
hidden: false,
|
||||
},
|
||||
operation: {
|
||||
perform: '$func$2$f$',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const results = schema.validateAppDefinition(definition);
|
||||
results.errors.should.have.length(1);
|
||||
const err = results.errors[0];
|
||||
should(err.codeLinks[0].includes('BasicDisplaySchema')).be.true();
|
||||
err.property.should.eql('instance.creates.foo.display');
|
||||
});
|
||||
|
||||
it('should error when label is alone when create is visible ', () => {
|
||||
const definition = {
|
||||
version: '1.0.0',
|
||||
platformVersion: '1.0.0',
|
||||
creates: {
|
||||
foo: {
|
||||
key: 'foo',
|
||||
noun: 'Foo',
|
||||
display: {
|
||||
label: 'nea',
|
||||
},
|
||||
operation: {
|
||||
perform: '$func$2$f$',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const results = schema.validateAppDefinition(definition);
|
||||
results.errors.should.have.length(1);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue