n8n/packages/nodes-base/test/nodes/Stripe/helpers.test.ts
Iván Ovejero 06fa6f1fb3
ci: Expand ESLint to tests in BE packages (no-changelog) (#6147)
* 🔧 Adjust base ESLint config

* 🔧 Adjust `lint` and `lintfix` in `nodes-base`

* 🔧 Include `test` and `utils` in `nodes-base`

* 📘 Convert JS tests to TS

* 👕 Apply lintfixes
2023-05-02 10:37:19 +02:00

31 lines
622 B
TypeScript

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