n8n/packages/nodes-base/test/nodes/Stripe/helpers.test.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
622 B
TypeScript
Raw Normal View History

const helpers = require('../../../nodes/Stripe/helpers');
describe('adjustMetadata', () => {
it('it should adjust multiple metadata values', async () => {
const additionalFieldsValues = {
metadata: {
metadataProperties: [
{
key: 'keyA',
value: 'valueA',
},
{
key: 'keyB',
value: 'valueB',
},
],
},
};
const adjustedMetadata = helpers.adjustMetadata(additionalFieldsValues);
const expectedAdjustedMetadata = {
metadata: {
keyA: 'valueA',
keyB: 'valueB',
},
};
expect(adjustedMetadata).toStrictEqual(expectedAdjustedMetadata);
});
});