diff --git a/.changeset/shy-onions-explode.md b/.changeset/shy-onions-explode.md new file mode 100644 index 000000000..48f085b39 --- /dev/null +++ b/.changeset/shy-onions-explode.md @@ -0,0 +1,5 @@ +--- +'@commercetools/sync-actions': minor +--- + +add changeActive to shipping methods base actions diff --git a/packages/sync-actions/src/shipping-methods-actions.js b/packages/sync-actions/src/shipping-methods-actions.js index 83aaabad2..cde936505 100644 --- a/packages/sync-actions/src/shipping-methods-actions.js +++ b/packages/sync-actions/src/shipping-methods-actions.js @@ -15,6 +15,7 @@ export const baseActionsList = [ { action: 'changeIsDefault', key: 'isDefault' }, { action: 'setPredicate', key: 'predicate' }, { action: 'changeTaxCategory', key: 'taxCategory' }, + { action: 'changeActive', key: 'active' }, ] export function actionsMapBase(diff, oldObj, newObj, config = {}) { diff --git a/packages/sync-actions/test/shipping-methods.spec.js b/packages/sync-actions/test/shipping-methods.spec.js index cb8a81b2c..b3805e96b 100644 --- a/packages/sync-actions/test/shipping-methods.spec.js +++ b/packages/sync-actions/test/shipping-methods.spec.js @@ -16,6 +16,7 @@ describe('Exports', () => { { action: 'changeIsDefault', key: 'isDefault' }, { action: 'setPredicate', key: 'predicate' }, { action: 'changeTaxCategory', key: 'taxCategory' }, + { action: 'changeActive', key: 'active' }, ]) }) }) @@ -58,6 +59,24 @@ describe('Actions', () => { expect(actual).toEqual(expected) }) + test('should build `changeActive` action', () => { + const before = { + active: false, + } + const now = { + active: true, + } + + const actual = shippingMethodsSync.buildActions(now, before) + const expected = [ + { + action: 'changeActive', + active: now.active, + }, + ] + expect(actual).toEqual(expected) + }) + test('should build `setLocalizedName` action', () => { const before = { localizedName: {