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
60
vendor/zapier-platform/example-apps/rest-hooks/test/triggers.js
vendored
Normal file
60
vendor/zapier-platform/example-apps/rest-hooks/test/triggers.js
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/* globals describe, it */
|
||||
|
||||
require('should');
|
||||
|
||||
const zapier = require('zapier-platform-core');
|
||||
|
||||
const App = require('../index');
|
||||
const appTester = zapier.createAppTester(App);
|
||||
|
||||
describe('triggers', () => {
|
||||
describe('new recipe trigger', () => {
|
||||
it('should load recipe from fake hook', (done) => {
|
||||
const bundle = {
|
||||
inputData: {
|
||||
style: 'mediterranean',
|
||||
},
|
||||
cleanedRequest: {
|
||||
id: 1,
|
||||
name: 'name 1',
|
||||
directions: 'directions 1',
|
||||
},
|
||||
};
|
||||
|
||||
appTester(App.triggers.recipe.operation.perform, bundle)
|
||||
.then((results) => {
|
||||
results.length.should.eql(1);
|
||||
|
||||
const firstRecipe = results[0];
|
||||
firstRecipe.name.should.eql('name 1');
|
||||
firstRecipe.directions.should.eql('directions 1');
|
||||
|
||||
done();
|
||||
})
|
||||
.catch(done);
|
||||
});
|
||||
|
||||
it('should load recipe from list', (done) => {
|
||||
const bundle = {
|
||||
inputData: {
|
||||
style: 'mediterranean',
|
||||
},
|
||||
meta: {
|
||||
frontend: true,
|
||||
},
|
||||
};
|
||||
|
||||
appTester(App.triggers.recipe.operation.performList, bundle)
|
||||
.then((results) => {
|
||||
results.length.should.be.greaterThan(1);
|
||||
|
||||
const firstRecipe = results[0];
|
||||
firstRecipe.name.should.eql('name 1');
|
||||
firstRecipe.directions.should.eql('directions 1');
|
||||
|
||||
done();
|
||||
})
|
||||
.catch(done);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue