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
44
vendor/zapier-platform/example-apps/digest-auth/test/authentication.test.js
vendored
Normal file
44
vendor/zapier-platform/example-apps/digest-auth/test/authentication.test.js
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/* globals describe, it, expect */
|
||||
|
||||
const zapier = require('zapier-platform-core');
|
||||
|
||||
const App = require('../index');
|
||||
const appTester = zapier.createAppTester(App);
|
||||
|
||||
describe('digest auth', () => {
|
||||
it('correctly authenticates', async () => {
|
||||
// Try changing the values of username or password to see how the test method behaves
|
||||
const bundle = {
|
||||
authData: {
|
||||
username: 'myuser',
|
||||
password: 'mypass',
|
||||
},
|
||||
};
|
||||
|
||||
const response = await appTester(App.authentication.test, bundle);
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
expect(response.data.authorized).toBe(true);
|
||||
expect(response.data.user).toBe('myuser');
|
||||
});
|
||||
|
||||
it('fails on bad auth', async () => {
|
||||
// Try changing the values of username or password to see how the test method behaves
|
||||
const bundle = {
|
||||
authData: {
|
||||
username: 'user',
|
||||
password: 'badpwd',
|
||||
},
|
||||
};
|
||||
|
||||
try {
|
||||
await appTester(App.authentication.test, bundle);
|
||||
} catch (err) {
|
||||
expect(err.message).toContain(
|
||||
'The username and/or password you supplied is incorrect',
|
||||
);
|
||||
return;
|
||||
}
|
||||
throw new Error('appTester should have thrown');
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue