From 05e7d96e4c52c873ac238363d943c682530631f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 22 Mar 2023 11:31:55 +0100 Subject: [PATCH] #139: fix tests for renamed c__xxx fields --- lib/metadataTypes/definitions/User.definition.js | 2 +- .../_ParentBU_/user/testExisting_user.user-meta.json | 6 +++--- .../_ParentBU_/user/testNew_user.user-meta.json | 6 +++--- test/resources/1111111/user/build-expected.json | 6 +++--- test/resources/1111111/user/create-expected.json | 6 +++--- test/resources/1111111/user/retrieve-expected.json | 6 +++--- test/resources/1111111/user/template-expected.json | 6 +++--- test/resources/1111111/user/update-expected.json | 6 +++--- test/user.test.js | 6 +++--- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/metadataTypes/definitions/User.definition.js b/lib/metadataTypes/definitions/User.definition.js index 076010a06..f142b1149 100644 --- a/lib/metadataTypes/definitions/User.definition.js +++ b/lib/metadataTypes/definitions/User.definition.js @@ -11,7 +11,7 @@ module.exports = { typeDescription: 'Marketing Cloud users', typeName: 'User', typeRetrieveByDefault: false, - stringifyFieldsBeforeTemplate: ['DefaultBusinessUnit', 'AssociatedBusinessUnits__c'], + stringifyFieldsBeforeTemplate: ['DefaultBusinessUnit', 'c__AssociatedBusinessUnits'], fields: { AccountUserID: { isCreateable: false, diff --git a/test/mockRoot/deploy/testInstance/_ParentBU_/user/testExisting_user.user-meta.json b/test/mockRoot/deploy/testInstance/_ParentBU_/user/testExisting_user.user-meta.json index af8d00d97..ed9adbbb5 100644 --- a/test/mockRoot/deploy/testInstance/_ParentBU_/user/testExisting_user.user-meta.json +++ b/test/mockRoot/deploy/testInstance/_ParentBU_/user/testExisting_user.user-meta.json @@ -20,9 +20,9 @@ "NotificationEmailAddress": "user_test@accenture.com", "IsLocked": false, "DefaultBusinessUnit": 9999999, - "type__c": "User", - "AssociatedBusinessUnits__c": [9999999], - "RoleNamesGlobal__c": [ + "c__type": "User", + "c__AssociatedBusinessUnits": [9999999], + "c__RoleNamesGlobal": [ "Administrator", "Distributed Sending User", "Individual role for 700301950", diff --git a/test/mockRoot/deploy/testInstance/_ParentBU_/user/testNew_user.user-meta.json b/test/mockRoot/deploy/testInstance/_ParentBU_/user/testNew_user.user-meta.json index f65217aea..9235cabfe 100644 --- a/test/mockRoot/deploy/testInstance/_ParentBU_/user/testNew_user.user-meta.json +++ b/test/mockRoot/deploy/testInstance/_ParentBU_/user/testNew_user.user-meta.json @@ -20,9 +20,9 @@ "NotificationEmailAddress": "testNew_user@accenture.com", "IsLocked": false, "DefaultBusinessUnit": 1111111, - "type__c": "User", - "AssociatedBusinessUnits__c": [1111111, 9999999], - "RoleNamesGlobal__c": [ + "c__type": "User", + "c__AssociatedBusinessUnits": [1111111, 9999999], + "c__RoleNamesGlobal": [ "Administrator", "Distributed Sending User", "Marketing Cloud Administrator" diff --git a/test/resources/1111111/user/build-expected.json b/test/resources/1111111/user/build-expected.json index b341f90fe..2fd3e232c 100644 --- a/test/resources/1111111/user/build-expected.json +++ b/test/resources/1111111/user/build-expected.json @@ -9,7 +9,7 @@ "NotificationEmailAddress": "user_testTarget@accenture.com", "IsLocked": false, "DefaultBusinessUnit": "1111111", - "type__c": "User", - "AssociatedBusinessUnits__c": ["1111111", "1111111"], - "RoleNamesGlobal__c": ["Administrator", "Content Creator", "Marketing Cloud Administrator"] + "c__type": "User", + "c__AssociatedBusinessUnits": ["1111111", "1111111"], + "c__RoleNamesGlobal": ["Administrator", "Content Creator", "Marketing Cloud Administrator"] } diff --git a/test/resources/1111111/user/create-expected.json b/test/resources/1111111/user/create-expected.json index e826075d8..55b958881 100644 --- a/test/resources/1111111/user/create-expected.json +++ b/test/resources/1111111/user/create-expected.json @@ -9,9 +9,9 @@ "NotificationEmailAddress": "testNew_user@accenture.com", "IsLocked": false, "DefaultBusinessUnit": 1111111, - "type__c": "User", - "AssociatedBusinessUnits__c": [1111111, 9999999], - "RoleNamesGlobal__c": [ + "c__type": "User", + "c__AssociatedBusinessUnits": [1111111, 9999999], + "c__RoleNamesGlobal": [ "Administrator", "Distributed Sending User", "Marketing Cloud Administrator" diff --git a/test/resources/1111111/user/retrieve-expected.json b/test/resources/1111111/user/retrieve-expected.json index 3b87d0f8a..2e95ff343 100644 --- a/test/resources/1111111/user/retrieve-expected.json +++ b/test/resources/1111111/user/retrieve-expected.json @@ -12,7 +12,7 @@ "NotificationEmailAddress": "user_test@accenture.com", "IsLocked": false, "DefaultBusinessUnit": 1111111, - "type__c": "User", - "AssociatedBusinessUnits__c": [1111111, 9999999], - "RoleNamesGlobal__c": ["Administrator", "Content Creator", "Marketing Cloud Administrator"] + "c__type": "User", + "c__AssociatedBusinessUnits": [1111111, 9999999], + "c__RoleNamesGlobal": ["Administrator", "Content Creator", "Marketing Cloud Administrator"] } diff --git a/test/resources/1111111/user/template-expected.json b/test/resources/1111111/user/template-expected.json index 42fd89921..5e39be1f7 100644 --- a/test/resources/1111111/user/template-expected.json +++ b/test/resources/1111111/user/template-expected.json @@ -9,7 +9,7 @@ "NotificationEmailAddress": "user{{{suffix}}}@accenture.com", "IsLocked": false, "DefaultBusinessUnit": "1111111", - "type__c": "User", - "AssociatedBusinessUnits__c": ["1111111", "{{{mid}}}"], - "RoleNamesGlobal__c": ["Administrator", "Content Creator", "Marketing Cloud Administrator"] + "c__type": "User", + "c__AssociatedBusinessUnits": ["1111111", "{{{mid}}}"], + "c__RoleNamesGlobal": ["Administrator", "Content Creator", "Marketing Cloud Administrator"] } diff --git a/test/resources/1111111/user/update-expected.json b/test/resources/1111111/user/update-expected.json index c8f84b6a6..f40d76eba 100644 --- a/test/resources/1111111/user/update-expected.json +++ b/test/resources/1111111/user/update-expected.json @@ -9,9 +9,9 @@ "NotificationEmailAddress": "user_test@accenture.com", "IsLocked": false, "DefaultBusinessUnit": 9999999, - "type__c": "User", - "AssociatedBusinessUnits__c": [9999999], - "RoleNamesGlobal__c": [ + "c__type": "User", + "c__AssociatedBusinessUnits": [9999999], + "c__RoleNamesGlobal": [ "Administrator", "Distributed Sending User", "Marketing Cloud Administrator" diff --git a/test/user.test.js b/test/user.test.js index 9c319ae7c..1fb35f63f 100644 --- a/test/user.test.js +++ b/test/user.test.js @@ -30,7 +30,7 @@ describe('user', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 4, + 6, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -66,7 +66,7 @@ describe('user', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 7, + 9, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -110,7 +110,7 @@ describe('user', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 4, + 6, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return;