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
46
vendor/zapier-platform/example-apps/callback/test/creates.test.js
vendored
Normal file
46
vendor/zapier-platform/example-apps/callback/test/creates.test.js
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/* globals describe, expect, test */
|
||||
|
||||
const zapier = require('zapier-platform-core');
|
||||
|
||||
const App = require('../index');
|
||||
const appTester = zapier.createAppTester(App);
|
||||
zapier.tools.env.inject();
|
||||
|
||||
describe('creates', () => {
|
||||
test('perform function returns intermediate data', async () => {
|
||||
const bundle = { inputData: { question: 'Will this work?' } };
|
||||
const result = await appTester(
|
||||
App.creates.prediction.operation.perform,
|
||||
bundle,
|
||||
);
|
||||
expect(result).toMatchObject({
|
||||
status: '...thinking...',
|
||||
callbackUrl: 'https://auth-json-server.zapier-staging.com/echo',
|
||||
extra: 'data',
|
||||
});
|
||||
});
|
||||
|
||||
test('performResume function returns "final" data', async () => {
|
||||
const bundle = {
|
||||
outputData: {
|
||||
callbackUrl: 'https://auth-json-server.zapier-staging.com/echo',
|
||||
status: '...thinking...',
|
||||
extra: 'data',
|
||||
},
|
||||
cleanedRequest: {
|
||||
status: 'success',
|
||||
result: 'Ask again later.',
|
||||
},
|
||||
};
|
||||
|
||||
const result = await appTester(
|
||||
App.creates.prediction.operation.performResume,
|
||||
bundle,
|
||||
);
|
||||
expect(result).toMatchObject({
|
||||
status: 'success',
|
||||
result: 'Ask again later.',
|
||||
callbackUrl: 'https://auth-json-server.zapier-staging.com/echo',
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue