n8n/packages/nodes-base/test/nodes/Stripe/helpers.test.js
Iván Ovejero 4dac848758
ci: Enable Prettier for /nodes-base (#3315)
*  Extend `.prettierignore` patterns

* 🎨 Apply Prettier to `/src` and `/test`

* 🎨 Update `.prettierignore`

* ✏️ Group dirs with same nesting level

* ✏️ Alphabetize credentials
2022-06-20 14:51:01 -07:00

31 lines
622 B
JavaScript

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);
});
});