diff --git a/.eslintrc.json b/.eslintrc.json index 3636f6eb4..e95ead59b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,8 +1,7 @@ { "env": { "es6": true, - "node": true, - "mocha": true + "node": true }, "extends": [ "eslint:recommended", @@ -67,7 +66,6 @@ "unicorn/prefer-set-has": "off", "unicorn/prefer-spread": "off", "unicorn/prefer-string-replace-all": "error", - "unicorn/unicorn/no-lonely-if": "off", "arrow-body-style": ["error", "as-needed"], "curly": "error", "no-console": "error", @@ -104,7 +102,8 @@ "extends": ["plugin:mocha/recommended"], "plugins": ["mocha"], "rules": { - "mocha/no-mocha-arrows": "off" + "mocha/no-mocha-arrows": "off", + "mocha/no-pending-tests": "off" } } ] diff --git a/test/resourceFactory.js b/test/resourceFactory.js index e9176ab6a..a8100c963 100644 --- a/test/resourceFactory.js +++ b/test/resourceFactory.js @@ -60,14 +60,18 @@ exports.filterToPath = (filter) => { return ''; }; exports._filterToPath = (filter) => { - if (filter.Property && filter.SimpleOperator && filter.Value) { - return `${filter.Property}${filter.SimpleOperator.replace('equals', '=')}${filter.Value}`; + if (filter.Property && filter.SimpleOperator) { + return `${filter.Property}${filter.SimpleOperator.replace('equals', '=')}${ + filter.Value === undefined ? '' : filter.Value + }`; } else if (filter.LeftOperand && filter.LogicalOperator && filter.RightOperand) { return ( this._filterToPath(filter.LeftOperand) + filter.LogicalOperator + this._filterToPath(filter.RightOperand) ); + } else { + throw new Error('unknown filter type'); } }; /** diff --git a/test/resources/1111111/accountUser/retrieve-ActiveFlag=falseANDCustomerKey=testExisting_userANDEmaillike@-response.xml b/test/resources/1111111/accountUser/retrieve-ActiveFlag=falseANDCustomerKey=testExisting_userANDEmaillike@-response.xml new file mode 100644 index 000000000..af1dec2e2 --- /dev/null +++ b/test/resources/1111111/accountUser/retrieve-ActiveFlag=falseANDCustomerKey=testExisting_userANDEmaillike@-response.xml @@ -0,0 +1,27 @@ + + + + RetrieveResponse + urn:uuid:1babdae0-9282-4bba-b69f-2f1843deaf11 + urn:uuid:39d1c021-b3df-49f9-a8f7-bb444172d2d3 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-03-11T13:53:00Z + 2023-03-11T13:58:00Z + + + + + + OK + 5347bf1d-e801-486a-b4a9-c2d46a8909b6 + + + + \ No newline at end of file diff --git a/test/resources/1111111/accountUser/retrieve-ActiveFlag=falseANDEmaillike@-response.xml b/test/resources/1111111/accountUser/retrieve-ActiveFlag=falseANDEmaillike@-response.xml new file mode 100644 index 000000000..22ee9fd1e --- /dev/null +++ b/test/resources/1111111/accountUser/retrieve-ActiveFlag=falseANDEmaillike@-response.xml @@ -0,0 +1,156 @@ + + + + RetrieveResponse + urn:uuid:1babdae0-9282-4bba-b69f-2f1843deaf11 + urn:uuid:39d1c021-b3df-49f9-a8f7-bb444172d2d3 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-03-11T13:53:00Z + 2023-03-11T13:58:00Z + + + + + + OK + 5347bf1d-e801-486a-b4a9-c2d46a8909b6 + + + 1111111 + 123456 + + + 2019-09-06T01:59:07.097 + 2022-06-21T01:43:02.64 + 700301951 + + testExisting_user_inactive + 700301951 + user_test-inactive@accenture.asgr + user test-inactive + user_test-inactive@accenture.com + false + false + + + 2 + + + + + 0 + + + + 3 + + + + + 0 + + 0 + 2023-02-23T10:14:11.443 + false + user_test-inactive@accenture.com + false + 1111111 + + + 1111111 + + None + + + + + + en-GB + + + + 5 + + (GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna * + + + + + 1111111 + -1000 + -1000 + 1111111 + + + 2016-07-22T17:52:36.93 + 2016-07-22T17:52:36.93 + f1cfb80f-3550-e611-96fe-38eaa7142c61 + SYS_DEF_ADMIN + Administrator + Administrator + false + true + + + + 1111111 + -1000 + -1000 + 1111111 + + + 2016-07-22T17:52:36.93 + 2016-07-22T17:52:36.93 + f4cfb80f-3550-e611-96fe-38eaa7142c61 + SYS_DEF_CONTENT + Content Creator + Content Creator + false + true + + + + 1111111 + -1000 + -1000 + 1111111 + + + 2019-09-06T07:59:07.8 + 2019-09-06T07:59:07.8 + bd251431-7cd0-e911-a2d3-1402ec936979 + Individual role for 700301951 + Individual role for 700301951 + Individual role for 700301951 + true + false + + + + 0 + 0 + 0 + 0 + + + 2012-02-21T02:09:19.983 + 2013-12-23T16:48:50.533 + 63a50610-315c-e111-beee-8e001800001f + SYS_DEF_IMHADMIN + Marketing Cloud Administrator + Assign Marketing Cloud roles to users and manage Mobile, Social and Sites Channels, Hub Apps and Marketing Cloud Tools + false + true + + + + + + \ No newline at end of file diff --git a/test/resources/1111111/accountUser/retrieve-response.xml b/test/resources/1111111/accountUser/retrieve-ActiveFlag=trueANDCustomerKey=testExisting_userANDEmaillike@-response.xml similarity index 100% rename from test/resources/1111111/accountUser/retrieve-response.xml rename to test/resources/1111111/accountUser/retrieve-ActiveFlag=trueANDCustomerKey=testExisting_userANDEmaillike@-response.xml diff --git a/test/resources/1111111/accountUser/retrieve-ActiveFlag=trueANDEmailisNullORNamelikeapp userANDMustChangePassword=false-response.xml b/test/resources/1111111/accountUser/retrieve-ActiveFlag=trueANDEmailisNullORNamelikeapp userANDMustChangePassword=false-response.xml new file mode 100644 index 000000000..5ac4001a5 --- /dev/null +++ b/test/resources/1111111/accountUser/retrieve-ActiveFlag=trueANDEmailisNullORNamelikeapp userANDMustChangePassword=false-response.xml @@ -0,0 +1,87 @@ + + + + RetrieveResponse + urn:uuid:1babdae0-9282-4bba-b69f-2f1843deaf11 + urn:uuid:39d1c021-b3df-49f9-a8f7-bb444172d2d3 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-03-11T13:53:00Z + 2023-03-11T13:58:00Z + + + + + + OK + 5347bf1d-e801-486a-b4a9-c2d46a8909b6 + + + 1111111 + 0 + + + 2016-07-22T11:52:37.42 + 2023-05-27T07:05:55.113 + 7471228 + + 45372cbb-06e0-438e-88d8-008981f7a18b + 7471228 + 20f2d94a-9a7d-4580-9fb6-c36a1ce32fb9 + igopredictiveemail app user + + false + true + 0 + + true + + false + 1111111 + + + + en-GB + + + + 5 + + (GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna + + + + 1111111 + + None + + + + + + 1111111 + 0 + 0 + 1111111 + + + 2016-07-22T17:52:37.88 + 2016-07-22T17:52:37.88 + 44d0b80f-3550-e611-96fe-38eaa7142c61 + Individual role for 7471228 + Individual role for 7471228 + Individual role for 7471228 + true + false + + + + + + \ No newline at end of file diff --git a/test/resources/1111111/accountUser/retrieve-ActiveFlag=trueANDEmaillike@-response.xml b/test/resources/1111111/accountUser/retrieve-ActiveFlag=trueANDEmaillike@-response.xml new file mode 100644 index 000000000..e16046c89 --- /dev/null +++ b/test/resources/1111111/accountUser/retrieve-ActiveFlag=trueANDEmaillike@-response.xml @@ -0,0 +1,156 @@ + + + + RetrieveResponse + urn:uuid:1babdae0-9282-4bba-b69f-2f1843deaf11 + urn:uuid:39d1c021-b3df-49f9-a8f7-bb444172d2d3 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-03-11T13:53:00Z + 2023-03-11T13:58:00Z + + + + + + OK + 5347bf1d-e801-486a-b4a9-c2d46a8909b6 + + + 1111111 + 123456 + + + 2019-09-06T01:59:07.097 + 2022-06-21T01:43:02.64 + 700301950 + + testExisting_user + 700301950 + user_test@accenture.asgr + user test + user_test@accenture.com + false + true + + + 2 + + + + + 0 + + + + 3 + + + + + 0 + + 0 + 2023-02-23T10:14:11.443 + false + user_test@accenture.com + false + 1111111 + + + 1111111 + + None + + + + + + en-GB + + + + 5 + + (GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna * + + + + + 1111111 + -1000 + -1000 + 1111111 + + + 2016-07-22T17:52:36.93 + 2016-07-22T17:52:36.93 + f1cfb80f-3550-e611-96fe-38eaa7142c61 + SYS_DEF_ADMIN + Administrator + Administrator + false + true + + + + 1111111 + -1000 + -1000 + 1111111 + + + 2016-07-22T17:52:36.93 + 2016-07-22T17:52:36.93 + f4cfb80f-3550-e611-96fe-38eaa7142c61 + SYS_DEF_CONTENT + Content Creator + Content Creator + false + true + + + + 1111111 + -1000 + -1000 + 1111111 + + + 2019-09-06T07:59:07.8 + 2019-09-06T07:59:07.8 + bd251431-7cd0-e911-a2d3-1402ec936979 + Individual role for 700301950 + Individual role for 700301950 + Individual role for 700301950 + true + false + + + + 0 + 0 + 0 + 0 + + + 2012-02-21T02:09:19.983 + 2013-12-23T16:48:50.533 + 63a50610-315c-e111-beee-8e001800001f + SYS_DEF_IMHADMIN + Marketing Cloud Administrator + Assign Marketing Cloud roles to users and manage Mobile, Social and Sites Channels, Hub Apps and Marketing Cloud Tools + false + true + + + + + + \ No newline at end of file diff --git a/test/resources/1111111/accountUser/retrieve-CustomerKey=testExisting_userANDActiveFlag=trueANDEmailisNullORNamelikeapp userANDMustChangePassword=false-response.xml b/test/resources/1111111/accountUser/retrieve-CustomerKey=testExisting_userANDActiveFlag=trueANDEmailisNullORNamelikeapp userANDMustChangePassword=false-response.xml new file mode 100644 index 000000000..af1dec2e2 --- /dev/null +++ b/test/resources/1111111/accountUser/retrieve-CustomerKey=testExisting_userANDActiveFlag=trueANDEmailisNullORNamelikeapp userANDMustChangePassword=false-response.xml @@ -0,0 +1,27 @@ + + + + RetrieveResponse + urn:uuid:1babdae0-9282-4bba-b69f-2f1843deaf11 + urn:uuid:39d1c021-b3df-49f9-a8f7-bb444172d2d3 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-03-11T13:53:00Z + 2023-03-11T13:58:00Z + + + + + + OK + 5347bf1d-e801-486a-b4a9-c2d46a8909b6 + + + + \ No newline at end of file diff --git a/test/resources/1111111/accountUserAccount/retrieve-AccountUser.AccountUserID=700301950-response.xml b/test/resources/1111111/accountUserAccount/retrieve-AccountUser.AccountUserID=700301950-response.xml new file mode 100644 index 000000000..29e5e4173 --- /dev/null +++ b/test/resources/1111111/accountUserAccount/retrieve-AccountUser.AccountUserID=700301950-response.xml @@ -0,0 +1,60 @@ + + + + RetrieveResponse + urn:uuid:b9fbc10c-2775-48d0-b9bb-fddf1ed90616 + urn:uuid:11d44cfe-e1d7-4fc2-b6ad-a2c806573859 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-03-11T13:52:52Z + 2023-03-11T13:57:52Z + + + + + + OK + f4057c93-40e3-47d6-a953-06839e221d40 + + + + + + + 700301950 + 0 + + + + 1111111 + + None + + + + + + + + + + 700301950 + 0 + + + + 9999999 + + None + + + + + + \ No newline at end of file diff --git a/test/resources/1111111/accountUserAccount/retrieve-response.xml b/test/resources/1111111/accountUserAccount/retrieve-AccountUser.AccountUserIDIN700301950,700301951,7471228-response.xml similarity index 100% rename from test/resources/1111111/accountUserAccount/retrieve-response.xml rename to test/resources/1111111/accountUserAccount/retrieve-AccountUser.AccountUserIDIN700301950,700301951,7471228-response.xml diff --git a/test/resources/1111111/businessUnit/retrieve-response.xml b/test/resources/1111111/businessUnit/retrieve-ID=1111111-response.xml similarity index 100% rename from test/resources/1111111/businessUnit/retrieve-response.xml rename to test/resources/1111111/businessUnit/retrieve-ID=1111111-response.xml diff --git a/test/resources/1111111/list/retrieve-response.xml b/test/resources/1111111/list/retrieve-CustomerKey=All SubscribersORListName=All Subscribers-response.xml similarity index 100% rename from test/resources/1111111/list/retrieve-response.xml rename to test/resources/1111111/list/retrieve-CustomerKey=All SubscribersORListName=All Subscribers-response.xml diff --git a/test/resources/1111111/role/retrieve-response.xml b/test/resources/1111111/role/retrieve-IsPrivate=false-response.xml similarity index 100% rename from test/resources/1111111/role/retrieve-response.xml rename to test/resources/1111111/role/retrieve-IsPrivate=false-response.xml diff --git a/test/resources/1111111/user/retrieve-expected.md b/test/resources/1111111/user/retrieve-expected.md index 50eb1b2ec..acc1becbd 100644 --- a/test/resources/1111111/user/retrieve-expected.md +++ b/test/resources/1111111/user/retrieve-expected.md @@ -7,13 +7,15 @@ | user test | 96 days | ✓ | - | - | - | _ParentBU_ (1111111) | _ParentBU_ (1111111),
testBU (9999999) | Administrator,
Content Creator,
Marketing Cloud Administrator | user_test@accenture.asgr | 700301950 | testExisting_user | user_test@accenture.com | user_test@accenture.com | GMT+01:00 | en-GB | 2022-06-21 01:43:02.64 | 123456 | 2019-09-06 01:59:07.097 | -## Inactivated Users (0) +## Inactivated Users (1) | Name | Last successful Login | Active | Access Locked out | API User | Must change PW | Default BU | BU Access | Roles | Login | ID | Key | E-Mail | Notification E-Mail | Timezone | SFMC Locale | Modified Date | Modified By | Created Date | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | +| user test-inactive | 96 days | - | - | - | - | _ParentBU_ (1111111) | _ParentBU_ (1111111) | Administrator,
Content Creator,
Marketing Cloud Administrator | user_test-inactive@accenture.asgr | 700301951 | testExisting_user_inactive | user_test-inactive@accenture.com | user_test-inactive@accenture.com | GMT+01:00 | en-GB | 2022-06-21 01:43:02.64 | 123456 | 2019-09-06 01:59:07.097 | -## Installed Packages (0) +## Installed Packages (1) | Name | Last successful Login | Active | Access Locked out | API User | Must change PW | Default BU | BU Access | Roles | Login | ID | Key | E-Mail | Notification E-Mail | Timezone | SFMC Locale | Modified Date | Modified By | Created Date | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | +| igopredictiveemail app user | never | ✓ | - | ✓ | - | _ParentBU_ (1111111) | _ParentBU_ (1111111) | | 20f2d94a-9a7d-4580-9fb6-c36a1ce32fb9 | 7471228 | 45372cbb-06e0-438e-88d8-008981f7a18b | | | GMT+01:00 | en-GB | 2023-05-27 07:05:55.113 | n/a | 2016-07-22 11:52:37.42 | diff --git a/test/resources/9999999/dataExtension/retrieve-Name=testExisting_dataExtension-response.xml b/test/resources/9999999/dataExtension/retrieve-Name=testExisting_dataExtension-response.xml new file mode 100644 index 000000000..e7cf0d2ef --- /dev/null +++ b/test/resources/9999999/dataExtension/retrieve-Name=testExisting_dataExtension-response.xml @@ -0,0 +1,52 @@ + + + + RetrieveResponse + urn:uuid:c198cc12-c34c-4d1d-90b0-5b785a342efc + urn:uuid:a0506b59-1847-4405-8231-6a15e26bbcc9 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2022-04-21T19:21:50Z + 2022-04-21T19:26:50Z + + + + + + OK + d175de6e-c8e4-4f5d-9c1d-ad64426ff4b7 + + + 2022-04-21T06:56:27.927 + 2022-04-21T06:56:27.927 + 21711373-72c1-ec11-b83b-48df37d1deb7 + testExisting_dataExtension + testExisting_dataExtension + bla bla + true + true + + + + ContactKey + + + _SubscriberKey + + 6 + 5 + true + false + false + + 2 + + + + \ No newline at end of file diff --git a/test/resources/9999999/dataExtensionField/retrieve-DataExtension.CustomerKey=testExisting_dataExtension-response.xml b/test/resources/9999999/dataExtensionField/retrieve-DataExtension.CustomerKey=testExisting_dataExtension-response.xml new file mode 100644 index 000000000..3ffc1b3eb --- /dev/null +++ b/test/resources/9999999/dataExtensionField/retrieve-DataExtension.CustomerKey=testExisting_dataExtension-response.xml @@ -0,0 +1,98 @@ + + + + RetrieveResponse + urn:uuid:6d2f81c8-80ab-44d5-8664-206753e7ac8d + urn:uuid:a7354389-079e-4844-93b5-af6b7bf1d535 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2022-04-21T19:21:52Z + 2022-04-21T19:26:52Z + + + + + + OK + cfe51e71-6a2b-4cb4-aecd-3777076d63bc + + + 8018397d-880d-4f88-940e-3b4eca098a0c + [testExisting_dataExtension].[ContactKey] + ContactKey + 0 + + 50 + true + 3 + true + Text + + + + testExisting_dataExtension + + + + + bea0e308-5d45-4181-a673-da9972a7c674 + [testExisting_dataExtension].[LastName] + LastName + 0 + + 50 + false + 1 + false + Text + + + + testExisting_dataExtension + + + + + 2557b461-a699-4744-950d-e80a19afc2dc + [testExisting_dataExtension].[EmailAddress] + EmailAddress + 0 + + 254 + true + 2 + false + EmailAddress + + + + testExisting_dataExtension + + + + + 42760528-a8c5-44dd-8c1d-ff34e5daee54 + [testExisting_dataExtension].[FirstName] + FirstName + 0 + + 50 + false + 0 + false + Text + + + + testExisting_dataExtension + + + + + \ No newline at end of file diff --git a/test/resources/9999999/dataExtensionField/retrieve-DataExtension.CustomerKey=testNew_dataExtensionORDataExtension.CustomerKey=testExisting_dataExtension-response.xml b/test/resources/9999999/dataExtensionField/retrieve-DataExtension.CustomerKey=testNew_dataExtensionORDataExtension.CustomerKey=testExisting_dataExtension-response.xml new file mode 100644 index 000000000..8018e9949 --- /dev/null +++ b/test/resources/9999999/dataExtensionField/retrieve-DataExtension.CustomerKey=testNew_dataExtensionORDataExtension.CustomerKey=testExisting_dataExtension-response.xml @@ -0,0 +1,99 @@ + + + + + RetrieveResponse + urn:uuid:6d2f81c8-80ab-44d5-8664-206753e7ac8d + urn:uuid:a7354389-079e-4844-93b5-af6b7bf1d535 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2022-04-21T19:21:52Z + 2022-04-21T19:26:52Z + + + + + + OK + cfe51e71-6a2b-4cb4-aecd-3777076d63bc + + + 8018397d-880d-4f88-940e-3b4eca098a0c + [testExisting_dataExtension].[ContactKey] + ContactKey + 0 + + 50 + true + 3 + true + Text + + + + testExisting_dataExtension + + + + + bea0e308-5d45-4181-a673-da9972a7c674 + [testExisting_dataExtension].[LastName] + LastName + 0 + + 50 + false + 1 + false + Text + + + + testExisting_dataExtension + + + + + 2557b461-a699-4744-950d-e80a19afc2dc + [testExisting_dataExtension].[EmailAddress] + EmailAddress + 0 + + 254 + true + 2 + false + EmailAddress + + + + testExisting_dataExtension + + + + + 42760528-a8c5-44dd-8c1d-ff34e5daee54 + [testExisting_dataExtension].[FirstName] + FirstName + 0 + + 50 + false + 0 + false + Text + + + + testExisting_dataExtension + + + + + \ No newline at end of file diff --git a/test/resources/9999999/emailSendDefinition/retrieve-response.xml b/test/resources/9999999/emailSendDefinition/retrieve-IsPlatformObject=falseANDDescriptionnotEqualsSFSendDefinition-response.xml similarity index 100% rename from test/resources/9999999/emailSendDefinition/retrieve-response.xml rename to test/resources/9999999/emailSendDefinition/retrieve-IsPlatformObject=falseANDDescriptionnotEqualsSFSendDefinition-response.xml diff --git a/test/resources/9999999/triggeredSendDefinition/retrieve-response.xml b/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml similarity index 100% rename from test/resources/9999999/triggeredSendDefinition/retrieve-response.xml rename to test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml diff --git a/test/type.user.test.js b/test/type.user.test.js index 810164a60..18fc252ba 100644 --- a/test/type.user.test.js +++ b/test/type.user.test.js @@ -26,8 +26,8 @@ describe('type: user', () => { const result = cache.getCache(); assert.equal( result.user ? Object.keys(result.user).length : 0, - 1, - 'only one user expected' + 3, + 'only three users expected' ); assert.deepEqual( await testUtils.getActualJson('testExisting_user', 'user', '_ParentBU_'), @@ -42,7 +42,7 @@ describe('type: user', () => { { encoding: 'utf8' } ); const regexFindDaysSinceLogin = - /\| (\d*) (seconds|minutes|days|weeks|months|years){1} \|/gm; + /\| (\d*) (seconds|minutes|days|weeks|months|years){1} \|/g; // fetch expected time since last login const expectedDaysSinceLogin = expectedFile.match(regexFindDaysSinceLogin); // load actual file and replace days since last login with expected value @@ -50,7 +50,7 @@ describe('type: user', () => { await File.readFile(`./docs/user/testInstance.users.md`, { encoding: 'utf8', }) - ).replaceAll(regexFindDaysSinceLogin, expectedDaysSinceLogin); + ).replaceAll(regexFindDaysSinceLogin, [expectedDaysSinceLogin[0]]); expect(actualFile).to.equal(expectedFile); assert.equal( @@ -83,7 +83,12 @@ describe('type: user', () => { }); it('Should create & upsert a user', async () => { // WHEN - const expectedCache = ['testExisting_user', 'testNew_user']; + const expectedCache = [ + 'testExisting_user', + 'testExisting_user_inactive', + '45372cbb-06e0-438e-88d8-008981f7a18b', + 'testNew_user', + ]; await handler.deploy('testInstance/_ParentBU_', ['user'], expectedCache); // THEN assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); @@ -92,8 +97,8 @@ describe('type: user', () => { const result = cache.getCache(); assert.equal( result.user ? Object.keys(result.user).length : 0, - 2, - 'two users expected' + 4, + 'four users expected' ); // confirm if result.user only includes values from expectedCache assert.deepEqual( @@ -126,14 +131,22 @@ describe('type: user', () => { }); it('Should not deploy user with Marketing Cloud role', async () => { // WHEN - const expectedCache = ['testExisting_user']; + const expectedCache = [ + 'testExisting_user', + 'testExisting_user_inactive', + '45372cbb-06e0-438e-88d8-008981f7a18b', + ]; await handler.deploy('testInstance/_ParentBU_', ['user'], ['testBlocked_user']); // THEN assert.equal(process.exitCode, 1, 'Deployment should have thrown an error'); // get results from cache const result = cache.getCache(); - assert.equal(result.user ? Object.keys(result.user).length : 0, 1, '1 user expected'); + assert.equal( + result.user ? Object.keys(result.user).length : 0, + 3, + 'three users expected' + ); // confirm if result.user only includes values from expectedCache assert.deepEqual( Object.keys(result.user),