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.
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
require('should');
|
|
|
|
const zapier = require('zapier-platform-core');
|
|
|
|
const testUtils = require('./test-utils');
|
|
const App = require('../index');
|
|
const appTester = zapier.createAppTester(App);
|
|
|
|
const TEST_RESOURCES = testUtils.TEST_RESOURCES;
|
|
|
|
describe('Hydrators', () => {
|
|
before(testUtils.globalBeforeSetup);
|
|
|
|
it('should get file contents', (done) => {
|
|
const bundle = {
|
|
authData: {
|
|
access_token: process.env.ACCESS_TOKEN,
|
|
},
|
|
inputData: {
|
|
id: TEST_RESOURCES.root.id,
|
|
},
|
|
};
|
|
|
|
appTester(App.hydrators.getFileContents, bundle)
|
|
.then((fileContents) => {
|
|
fileContents.length.should.above(0);
|
|
done();
|
|
})
|
|
.catch(done);
|
|
});
|
|
|
|
it('should get unicode file contents', (done) => {
|
|
// CODE TIP: Hydrating files often involves touching the raw bytes (and
|
|
// handling the file names), so it's a good idea to test different edge cases
|
|
done();
|
|
});
|
|
|
|
it('should not get file contents for big files', (done) => {
|
|
// An example edge case that would be worth testing
|
|
done();
|
|
});
|
|
|
|
it('should not get file contents for binary files', (done) => {
|
|
// An example edge case that would be worth testing
|
|
done();
|
|
});
|
|
});
|