mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-27 13:39:44 -08:00
06fa6f1fb3
* 🔧 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
31 lines
622 B
TypeScript
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);
|
|
});
|
|
});
|