mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-17 18:14:05 -08:00
31 lines
614 B
JavaScript
31 lines
614 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)
|
|
});
|
|
});
|