mcdev 5.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/.coverage-comment-template.svelte +177 -161
  2. package/.eslintrc.json +1 -0
  3. package/.github/ISSUE_TEMPLATE/bug.yml +2 -0
  4. package/.github/dependabot.yml +8 -0
  5. package/.github/workflows/coverage-base-update.yml +6 -2
  6. package/.github/workflows/coverage-develop-branch.yml +7 -6
  7. package/.github/workflows/coverage-main-branch.yml +7 -6
  8. package/.github/workflows/coverage.yml +7 -2
  9. package/.husky/commit-msg +1 -1
  10. package/.husky/post-checkout +35 -3
  11. package/.husky/post-merge +21 -0
  12. package/.husky/pre-commit +1 -0
  13. package/docs/dist/documentation.md +222 -62
  14. package/lib/Deployer.js +3 -4
  15. package/lib/cli.js +36 -8
  16. package/lib/index.js +175 -3
  17. package/lib/metadataTypes/Asset.js +4 -2
  18. package/lib/metadataTypes/Automation.js +413 -195
  19. package/lib/metadataTypes/DataExtension.js +6 -8
  20. package/lib/metadataTypes/DataExtensionField.js +5 -5
  21. package/lib/metadataTypes/Journey.js +11 -10
  22. package/lib/metadataTypes/MetadataType.js +76 -22
  23. package/lib/metadataTypes/MobileKeyword.js +165 -20
  24. package/lib/metadataTypes/MobileMessage.js +20 -28
  25. package/lib/metadataTypes/Query.js +26 -0
  26. package/lib/metadataTypes/Role.js +2 -3
  27. package/lib/metadataTypes/TransactionalSMS.js +5 -5
  28. package/lib/metadataTypes/User.js +3 -17
  29. package/lib/metadataTypes/definitions/Asset.definition.js +1 -0
  30. package/lib/metadataTypes/definitions/Automation.definition.js +52 -6
  31. package/lib/metadataTypes/definitions/DataExtension.definition.js +1 -0
  32. package/lib/metadataTypes/definitions/DataExtract.definition.js +1 -0
  33. package/lib/metadataTypes/definitions/EmailSend.definition.js +1 -0
  34. package/lib/metadataTypes/definitions/Event.definition.js +1 -0
  35. package/lib/metadataTypes/definitions/Filter.definition.js +1 -0
  36. package/lib/metadataTypes/definitions/ImportFile.definition.js +1 -0
  37. package/lib/metadataTypes/definitions/MobileKeyword.definition.js +20 -7
  38. package/lib/metadataTypes/definitions/MobileMessage.definition.js +50 -8
  39. package/lib/metadataTypes/definitions/Query.definition.js +1 -0
  40. package/lib/metadataTypes/definitions/Role.definition.js +1 -0
  41. package/lib/metadataTypes/definitions/TriggeredSend.definition.js +1 -0
  42. package/lib/metadataTypes/definitions/User.definition.js +2 -0
  43. package/lib/util/auth.js +4 -1
  44. package/lib/util/cli.js +1 -1
  45. package/lib/util/devops.js +13 -11
  46. package/lib/util/file.js +5 -3
  47. package/lib/util/util.js +153 -129
  48. package/package.json +11 -11
  49. package/test/general.test.js +26 -0
  50. package/test/mockRoot/.mcdevrc.json +3 -1
  51. package/test/mockRoot/deploy/testInstance/testBU/automation/testExisting_automation.automation-meta.json +53 -0
  52. package/test/mockRoot/deploy/testInstance/testBU/automation/testNew_automation.automation-meta.json +46 -0
  53. package/test/mockRoot/deploy/testInstance/testBU/mobileKeyword/{testNew_keyword.mobileKeyword-meta.json → 4912312345678.TESTNEW_KEYWORD.mobileKeyword-meta.json} +1 -4
  54. package/test/mockRoot/deploy/testInstance/testBU/mobileKeyword/{testNew_keyword_blocked.mobileKeyword-meta.json → 4912312345678.TESTNEW_KEYWORD_BLOCKED.mobileKeyword-meta.json} +1 -4
  55. package/test/mockRoot/deploy/testInstance/testBU/query/{testExistingQuery.query-meta.json → testExisting_query.query-meta.json} +2 -2
  56. package/test/mockRoot/deploy/testInstance/testBU/query/{testNewQuery.query-meta.json → testNew_query.query-meta.json} +2 -2
  57. package/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testExisting_tsms.transactionalSMS-meta.json +1 -1
  58. package/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testNew_tsms.transactionalSMS-meta.json +1 -1
  59. package/test/resourceFactory.js +64 -21
  60. package/test/resources/1111111/user/retrieve-expected.md +19 -0
  61. package/test/resources/9999999/automation/build-expected.json +58 -0
  62. package/test/resources/9999999/automation/create-expected.json +46 -0
  63. package/test/resources/9999999/automation/create-testNew_automation-expected.md +28 -0
  64. package/test/resources/9999999/automation/delete-response.xml +40 -0
  65. package/test/resources/9999999/automation/retrieve-expected.json +58 -0
  66. package/test/resources/9999999/automation/retrieve-testExisting_automation-expected.md +30 -0
  67. package/test/resources/9999999/automation/template-expected.json +58 -0
  68. package/test/resources/9999999/automation/update-expected.json +46 -0
  69. package/test/resources/9999999/automation/update-testExisting_automation-expected.md +28 -0
  70. package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-1f7f8788c560/get-response.json +85 -0
  71. package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-1f7f8788c560/patch-response.json +85 -0
  72. package/test/resources/9999999/automation/v1/automations/a8afb0e2-b00a-4c88-ad2e-1f7f8788c560/get-response.json +85 -0
  73. package/test/resources/9999999/automation/v1/automations/post-response.json +85 -0
  74. package/test/resources/9999999/automation/v1/dataextracts/56c5370a-f988-4f36-b0ee-0f876573f6d7/get-response.json +38 -0
  75. package/test/resources/9999999/automation/v1/dataextracts/get-response.json +20 -0
  76. package/test/resources/9999999/automation/v1/filetransfers/72c328ac-f5b0-4e37-91d3-a775666f15a6/get-response.json +18 -0
  77. package/test/resources/9999999/automation/v1/filetransfers/get-response.json +15 -0
  78. package/test/resources/9999999/automation/v1/imports/get-response.json +38 -0
  79. package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/actions/start/post-response.txt +1 -0
  80. package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/get-response.json +2 -2
  81. package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/patch-response.json +2 -2
  82. package/test/resources/9999999/automation/v1/queries/get-response.json +4 -4
  83. package/test/resources/9999999/automation/v1/queries/post-response.json +2 -2
  84. package/test/resources/9999999/automation/v1/scripts/get-response.json +17 -0
  85. package/test/resources/9999999/dataExtension/retrieve-expected.md +18 -0
  86. package/test/resources/9999999/dataFolder/retrieve-ContentType=automations-response.xml +48 -0
  87. package/test/resources/9999999/dataFolder/retrieve-ContentType=queryactivity-response.xml +48 -0
  88. package/test/resources/9999999/dataFolder/retrieve-response.xml +22 -0
  89. package/test/resources/9999999/emailSendDefinition/retrieve-response.xml +85 -0
  90. package/test/resources/9999999/journey/build-expected.json +1 -1
  91. package/test/resources/9999999/journey/get-expected.json +1 -1
  92. package/test/resources/9999999/journey/put-expected.json +1 -1
  93. package/test/resources/9999999/journey/template-expected.json +1 -1
  94. package/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow/get-response.json +21 -0
  95. package/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow/post-response.json +0 -0
  96. package/test/resources/9999999/legacy/v1/beta/bulk/automations/automation/definition/get-response.json +30 -0
  97. package/test/resources/9999999/legacy/v1/beta/mobile/keyword/NXV4ZFMwTEFwRVczd3RaLUF5X3p5dzo4Njow/get-response.json +1 -1
  98. package/test/resources/9999999/legacy/v1/beta/mobile/keyword/get-response.json +1 -1
  99. package/test/resources/9999999/legacy/v1/beta/mobile/message/NTIzOjc4OjA/get-response.json +1 -1
  100. package/test/resources/9999999/legacy/v1/beta/mobile/message/get-response.json +1 -1
  101. package/test/resources/9999999/messaging/v1/sms/definitions/post-response.json +1 -1
  102. package/test/resources/9999999/messaging/v1/sms/definitions/testExisting_tsms/get-response.json +1 -1
  103. package/test/resources/9999999/messaging/v1/sms/definitions/testExisting_tsms/patch-response.json +1 -1
  104. package/test/resources/9999999/mobileKeyword/build-expected.json +1 -4
  105. package/test/resources/9999999/mobileKeyword/get-expected.json +1 -4
  106. package/test/resources/9999999/mobileKeyword/post-create-expected.json +1 -4
  107. package/test/resources/9999999/mobileKeyword/template-expected.json +1 -4
  108. package/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation-response.xml +30 -0
  109. package/test/resources/9999999/program/retrieve-CustomerKey=testNew_automation-response.xml +30 -0
  110. package/test/resources/9999999/program/retrieve-Name=testExisting_automation-response.xml +31 -0
  111. package/test/resources/9999999/program/retrieve-response.xml +32 -0
  112. package/test/resources/9999999/query/build-expected.json +2 -2
  113. package/test/resources/9999999/query/build-expected.sql +1 -1
  114. package/test/resources/9999999/query/get-expected.json +2 -2
  115. package/test/resources/9999999/query/get-expected.sql +1 -1
  116. package/test/resources/9999999/query/get2-expected.json +2 -2
  117. package/test/resources/9999999/query/patch-expected.json +2 -2
  118. package/test/resources/9999999/query/patch-expected.sql +1 -1
  119. package/test/resources/9999999/query/post-expected.json +2 -2
  120. package/test/resources/9999999/query/post-expected.sql +1 -1
  121. package/test/resources/9999999/query/template-expected.json +2 -2
  122. package/test/resources/9999999/query/template-expected.sql +1 -1
  123. package/test/resources/9999999/transactionalSMS/build-expected.json +1 -1
  124. package/test/resources/9999999/transactionalSMS/get-expected.json +1 -1
  125. package/test/resources/9999999/transactionalSMS/patch-expected.json +1 -1
  126. package/test/resources/9999999/transactionalSMS/post-expected.json +1 -1
  127. package/test/resources/9999999/transactionalSMS/template-expected.json +1 -1
  128. package/test/type.automation.test.js +259 -0
  129. package/test/type.dataExtension.test.js +16 -1
  130. package/test/type.mobileKeyword.test.js +57 -19
  131. package/test/type.query.test.js +39 -26
  132. package/test/type.user.test.js +44 -1
  133. package/test/utils.js +16 -5
  134. package/.coverage-comment-template.md +0 -20
  135. /package/test/mockRoot/deploy/testInstance/testBU/mobileKeyword/{testNew_keyword.mobileKeyword-meta.amp → 4912312345678.TESTNEW_KEYWORD.mobileKeyword-meta.amp} +0 -0
  136. /package/test/mockRoot/deploy/testInstance/testBU/mobileKeyword/{testNew_keyword_blocked.mobileKeyword-meta.amp → 4912312345678.TESTNEW_KEYWORD_BLOCKED.mobileKeyword-meta.amp} +0 -0
  137. /package/test/mockRoot/deploy/testInstance/testBU/query/{testExistingQuery.query-meta.sql → testExisting_query.query-meta.sql} +0 -0
  138. /package/test/mockRoot/deploy/testInstance/testBU/query/{testNewQuery.query-meta.sql → testNew_query.query-meta.sql} +0 -0
@@ -0,0 +1,259 @@
1
+ const chai = require('chai');
2
+ const chaiFiles = require('chai-files');
3
+
4
+ chai.use(chaiFiles);
5
+
6
+ const assert = chai.assert;
7
+ const expect = chai.expect;
8
+ const file = chaiFiles.file;
9
+ const cache = require('../lib/util/cache');
10
+ const testUtils = require('./utils');
11
+ const handler = require('../lib/index');
12
+
13
+ describe('type: automation', () => {
14
+ beforeEach(() => {
15
+ testUtils.mockSetup();
16
+ });
17
+ afterEach(() => {
18
+ testUtils.mockReset();
19
+ });
20
+ describe('Retrieve ================', () => {
21
+ it('Should retrieve a automation', async () => {
22
+ // WHEN
23
+ await handler.retrieve('testInstance/testBU', ['automation']);
24
+ // THEN
25
+ assert.equal(process.exitCode, false, 'retrieve should not have thrown an error');
26
+ // get results from cache
27
+ const result = cache.getCache();
28
+ assert.equal(
29
+ result.automation ? Object.keys(result.automation).length : 0,
30
+ 1,
31
+ 'only one automation expected'
32
+ );
33
+ assert.deepEqual(
34
+ await testUtils.getActualJson('testExisting_automation', 'automation'),
35
+ await testUtils.getExpectedJson('9999999', 'automation', 'retrieve'),
36
+
37
+ 'returned metadata was not equal expected'
38
+ );
39
+ // check if MD file was created and equals expectations
40
+ expect(file(testUtils.getActualDoc('testExisting_automation', 'automation'))).to.equal(
41
+ file(
42
+ testUtils.getExpectedFile(
43
+ '9999999',
44
+ 'automation',
45
+ 'retrieve-testExisting_automation',
46
+ 'md'
47
+ )
48
+ )
49
+ );
50
+
51
+ assert.equal(
52
+ testUtils.getAPIHistoryLength(),
53
+ 14,
54
+ 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
55
+ );
56
+ return;
57
+ });
58
+ });
59
+ describe('Deploy ================', () => {
60
+ beforeEach(() => {
61
+ testUtils.mockSetup(true);
62
+ });
63
+ it('Should create & update a automation', async () => {
64
+ // WHEN
65
+ await handler.deploy('testInstance/testBU', ['automation']);
66
+ // THEN
67
+ assert.equal(process.exitCode, false, 'deploy should not have thrown an error');
68
+
69
+ // get results from cache
70
+ const result = cache.getCache();
71
+ assert.equal(
72
+ result.automation ? Object.keys(result.automation).length : 0,
73
+ 2,
74
+ 'two automations expected'
75
+ );
76
+ // insert
77
+ assert.deepEqual(
78
+ await testUtils.getActualJson('testNew_automation', 'automation'),
79
+ await testUtils.getExpectedJson('9999999', 'automation', 'create'),
80
+ 'returned metadata was not equal expected for create'
81
+ );
82
+ // update
83
+ assert.deepEqual(
84
+ await testUtils.getActualJson('testExisting_automation', 'automation'),
85
+ await testUtils.getExpectedJson('9999999', 'automation', 'update'),
86
+ 'returned metadata was not equal expected for update'
87
+ );
88
+ // check if MD file was created and equals expectations
89
+ expect(file(testUtils.getActualDoc('testExisting_automation', 'automation'))).to.equal(
90
+ file(
91
+ testUtils.getExpectedFile(
92
+ '9999999',
93
+ 'automation',
94
+ 'update-testExisting_automation',
95
+ 'md'
96
+ )
97
+ )
98
+ );
99
+
100
+ // check if MD file was created and equals expectations
101
+ expect(file(testUtils.getActualDoc('testNew_automation', 'automation'))).to.equal(
102
+ file(
103
+ testUtils.getExpectedFile(
104
+ '9999999',
105
+ 'automation',
106
+ 'create-testNew_automation',
107
+ 'md'
108
+ )
109
+ )
110
+ );
111
+
112
+ assert.equal(
113
+ testUtils.getAPIHistoryLength(),
114
+ 15,
115
+ 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
116
+ );
117
+ return;
118
+ });
119
+ it('Should change the key during update via --changeKeyValue');
120
+ });
121
+ describe('Templating ================', () => {
122
+ it('Should create a automation template via retrieveAsTemplate and build it', async () => {
123
+ // GIVEN there is a template
124
+ const result = await handler.retrieveAsTemplate(
125
+ 'testInstance/testBU',
126
+ 'automation',
127
+ ['testExisting_automation'],
128
+ 'testSourceMarket'
129
+ );
130
+ assert.equal(
131
+ process.exitCode,
132
+ false,
133
+ 'retrieveAsTemplate should not have thrown an error'
134
+ );
135
+
136
+ // WHEN
137
+ assert.equal(
138
+ result.automation ? Object.keys(result.automation).length : 0,
139
+ 1,
140
+ 'only one automation expected'
141
+ );
142
+ assert.deepEqual(
143
+ await testUtils.getActualTemplateJson('testExisting_automation', 'automation'),
144
+ await testUtils.getExpectedJson('9999999', 'automation', 'template'),
145
+ 'returned template was not equal expected'
146
+ );
147
+ // THEN
148
+ await handler.buildDefinition(
149
+ 'testInstance/testBU',
150
+ 'automation',
151
+ 'testExisting_automation',
152
+ 'testTargetMarket'
153
+ );
154
+ assert.equal(
155
+ process.exitCode,
156
+ false,
157
+ 'buildDefinition should not have thrown an error'
158
+ );
159
+ assert.deepEqual(
160
+ await testUtils.getActualDeployJson('testTemplated_automation', 'automation'),
161
+ await testUtils.getExpectedJson('9999999', 'automation', 'build'),
162
+ 'returned deployment file was not equal expected'
163
+ );
164
+ assert.equal(
165
+ testUtils.getAPIHistoryLength(),
166
+ 14,
167
+ 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
168
+ );
169
+ return;
170
+ });
171
+ it('Should create a automation template via buildTemplate and build it', async () => {
172
+ // download first before we test buildTemplate
173
+ await handler.retrieve('testInstance/testBU', ['automation']);
174
+ // GIVEN there is a template
175
+ const result = await handler.buildTemplate(
176
+ 'testInstance/testBU',
177
+ 'automation',
178
+ ['testExisting_automation'],
179
+ 'testSourceMarket'
180
+ );
181
+ assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error');
182
+ // WHEN
183
+ assert.equal(
184
+ result.automation ? Object.keys(result.automation).length : 0,
185
+ 1,
186
+ 'only one automation expected'
187
+ );
188
+ assert.deepEqual(
189
+ await testUtils.getActualTemplateJson('testExisting_automation', 'automation'),
190
+ await testUtils.getExpectedJson('9999999', 'automation', 'template'),
191
+ 'returned template was not equal expected'
192
+ );
193
+ // THEN
194
+ await handler.buildDefinition(
195
+ 'testInstance/testBU',
196
+ 'automation',
197
+ 'testExisting_automation',
198
+ 'testTargetMarket'
199
+ );
200
+ assert.equal(
201
+ process.exitCode,
202
+ false,
203
+ 'buildDefinition should not have thrown an error'
204
+ );
205
+
206
+ assert.deepEqual(
207
+ await testUtils.getActualDeployJson('testTemplated_automation', 'automation'),
208
+ await testUtils.getExpectedJson('9999999', 'automation', 'build'),
209
+ 'returned deployment file was not equal expected'
210
+ );
211
+ assert.equal(
212
+ testUtils.getAPIHistoryLength(),
213
+ 14,
214
+ 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
215
+ );
216
+ return;
217
+ });
218
+ });
219
+ describe('Delete ================', () => {
220
+ it('Should delete the item', async () => {
221
+ // WHEN
222
+ const result = await handler.deleteByKey('testInstance/testBU', 'automation', [
223
+ 'testExisting_automation',
224
+ ]);
225
+ // THEN
226
+ assert.equal(process.exitCode, false, 'delete should not have thrown an error');
227
+
228
+ assert.equal(result, true, 'should have deleted the item');
229
+ return;
230
+ });
231
+ });
232
+ describe('CI/CD ================', () => {
233
+ it('Should return a list of files based on their type and key', async () => {
234
+ // WHEN
235
+ const fileList = await handler.getFilesToCommit('testInstance/testBU', 'automation', [
236
+ 'testExisting_automation',
237
+ ]);
238
+ // THEN
239
+ assert.equal(
240
+ process.exitCode,
241
+ false,
242
+ 'getFilesToCommit should not have thrown an error'
243
+ );
244
+ assert.equal(fileList.length, 2, 'expected only 2 file paths');
245
+
246
+ assert.equal(
247
+ fileList[0].split('\\').join('/'),
248
+ 'retrieve/testInstance/testBU/automation/testExisting_automation.automation-meta.json',
249
+ 'wrong JSON path'
250
+ );
251
+ assert.equal(
252
+ fileList[1].split('\\').join('/'),
253
+ 'retrieve/testInstance/testBU/automation/testExisting_automation.automation-doc.md',
254
+ 'wrong MD path'
255
+ );
256
+ return;
257
+ });
258
+ });
259
+ });
@@ -1,4 +1,11 @@
1
- const assert = require('chai').assert;
1
+ const chai = require('chai');
2
+ const chaiFiles = require('chai-files');
3
+
4
+ chai.use(chaiFiles);
5
+
6
+ const assert = chai.assert;
7
+ const expect = chai.expect;
8
+ const file = chaiFiles.file;
2
9
  const cache = require('../lib/util/cache');
3
10
  const testUtils = require('./utils');
4
11
  const handler = require('../lib/index');
@@ -29,6 +36,13 @@ describe('type: dataExtension', () => {
29
36
 
30
37
  'returned metadata was not equal expected'
31
38
  );
39
+ // check if MD file was created and equals expectations
40
+ expect(
41
+ file(testUtils.getActualDoc('testExisting_dataExtension', 'dataExtension'))
42
+ ).to.equal(
43
+ file(testUtils.getExpectedFile('9999999', 'dataExtension', 'retrieve', 'md'))
44
+ );
45
+
32
46
  assert.equal(
33
47
  testUtils.getAPIHistoryLength(),
34
48
  5,
@@ -74,6 +88,7 @@ describe('type: dataExtension', () => {
74
88
  return;
75
89
  });
76
90
  it('Should change the key during update via --changeKeyValue');
91
+ it('Should rename fields');
77
92
  });
78
93
  describe('Templating ================', () => {
79
94
  it('Should create a dataExtension template via retrieveAsTemplate and build it', async () => {
@@ -30,12 +30,21 @@ describe('type: mobileKeyword', () => {
30
30
  'only 1 mobileKeywords expected'
31
31
  );
32
32
  assert.deepEqual(
33
- await testUtils.getActualJson('testExisting_keyword', 'mobileKeyword'),
33
+ await testUtils.getActualJson(
34
+ '4912312345678.TESTEXISTING_KEYWORD',
35
+ 'mobileKeyword'
36
+ ),
34
37
  await testUtils.getExpectedJson('9999999', 'mobileKeyword', 'get'),
35
38
  'saved JSON was not equal expected'
36
39
  );
37
40
  expect(
38
- file(testUtils.getActualFile('testExisting_keyword', 'mobileKeyword', 'amp'))
41
+ file(
42
+ testUtils.getActualFile(
43
+ '4912312345678.TESTEXISTING_KEYWORD',
44
+ 'mobileKeyword',
45
+ 'amp'
46
+ )
47
+ )
39
48
  ).to.equal(file(testUtils.getExpectedFile('9999999', 'mobileKeyword', 'get', 'amp')));
40
49
  assert.equal(
41
50
  testUtils.getAPIHistoryLength(),
@@ -51,7 +60,11 @@ describe('type: mobileKeyword', () => {
51
60
  });
52
61
  it('Should create (but not update) a mobileKeyword', async () => {
53
62
  // WHEN
54
- await handler.deploy('testInstance/testBU', ['mobileKeyword'], ['testNew_keyword']);
63
+ await handler.deploy(
64
+ 'testInstance/testBU',
65
+ ['mobileKeyword'],
66
+ ['4912312345678.TESTNEW_KEYWORD']
67
+ );
55
68
  // THEN
56
69
  assert.equal(process.exitCode, false, 'deploy should not have thrown an error');
57
70
  // get results from cache
@@ -63,12 +76,14 @@ describe('type: mobileKeyword', () => {
63
76
  );
64
77
  // confirm created item
65
78
  assert.deepEqual(
66
- await testUtils.getActualJson('testNew_keyword', 'mobileKeyword'),
79
+ await testUtils.getActualJson('4912312345678.TESTNEW_KEYWORD', 'mobileKeyword'),
67
80
  await testUtils.getExpectedJson('9999999', 'mobileKeyword', 'post-create'),
68
81
  'returned JSON was not equal expected for insert mobileKeyword'
69
82
  );
70
83
  expect(
71
- file(testUtils.getActualFile('testNew_keyword', 'mobileKeyword', 'amp'))
84
+ file(
85
+ testUtils.getActualFile('4912312345678.TESTNEW_KEYWORD', 'mobileKeyword', 'amp')
86
+ )
72
87
  ).to.equal(
73
88
  file(testUtils.getExpectedFile('9999999', 'mobileKeyword', 'post-create', 'amp'))
74
89
  );
@@ -92,7 +107,7 @@ describe('type: mobileKeyword', () => {
92
107
  await handler.deploy(
93
108
  'testInstance/testBU',
94
109
  ['mobileKeyword'],
95
- ['testNew_keyword_blocked']
110
+ ['4912312345678.TESTNEW_KEYWORD_BLOCKED']
96
111
  );
97
112
  // THEN
98
113
  assert.equal(process.exitCode, true, 'deploy should have thrown an error');
@@ -113,7 +128,7 @@ describe('type: mobileKeyword', () => {
113
128
  const result = await handler.retrieveAsTemplate(
114
129
  'testInstance/testBU',
115
130
  'mobileKeyword',
116
- ['testExisting_keyword'],
131
+ ['4912312345678.TESTEXISTING_KEYWORD'],
117
132
  'testSourceMarket'
118
133
  );
119
134
  // WHEN
@@ -128,13 +143,20 @@ describe('type: mobileKeyword', () => {
128
143
  'only one item expected'
129
144
  );
130
145
  assert.deepEqual(
131
- await testUtils.getActualTemplateJson('testExisting_keyword', 'mobileKeyword'),
146
+ await testUtils.getActualTemplateJson(
147
+ '4912312345678.TESTEXISTING_KEYWORD',
148
+ 'mobileKeyword'
149
+ ),
132
150
  await testUtils.getExpectedJson('9999999', 'mobileKeyword', 'template'),
133
151
  'returned template JSON was not equal expected'
134
152
  );
135
153
  expect(
136
154
  file(
137
- testUtils.getActualTemplateFile('testExisting_keyword', 'mobileKeyword', 'amp')
155
+ testUtils.getActualTemplateFile(
156
+ '4912312345678.TESTEXISTING_KEYWORD',
157
+ 'mobileKeyword',
158
+ 'amp'
159
+ )
138
160
  )
139
161
  ).to.equal(
140
162
  file(testUtils.getExpectedFile('9999999', 'mobileKeyword', 'template', 'amp'))
@@ -153,7 +175,7 @@ describe('type: mobileKeyword', () => {
153
175
  const result = await handler.buildTemplate(
154
176
  'testInstance/testBU',
155
177
  'mobileKeyword',
156
- ['testExisting_keyword'],
178
+ ['4912312345678.TESTEXISTING_KEYWORD'],
157
179
  'testSourceMarket'
158
180
  );
159
181
  assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error');
@@ -164,13 +186,20 @@ describe('type: mobileKeyword', () => {
164
186
  'only one mobileKeyword expected'
165
187
  );
166
188
  assert.deepEqual(
167
- await testUtils.getActualTemplateJson('testExisting_keyword', 'mobileKeyword'),
189
+ await testUtils.getActualTemplateJson(
190
+ '4912312345678.TESTEXISTING_KEYWORD',
191
+ 'mobileKeyword'
192
+ ),
168
193
  await testUtils.getExpectedJson('9999999', 'mobileKeyword', 'template'),
169
194
  'returned template JSON was not equal expected'
170
195
  );
171
196
  expect(
172
197
  file(
173
- testUtils.getActualTemplateFile('testExisting_keyword', 'mobileKeyword', 'amp')
198
+ testUtils.getActualTemplateFile(
199
+ '4912312345678.TESTEXISTING_KEYWORD',
200
+ 'mobileKeyword',
201
+ 'amp'
202
+ )
174
203
  )
175
204
  ).to.equal(
176
205
  file(testUtils.getExpectedFile('9999999', 'mobileKeyword', 'template', 'amp'))
@@ -180,7 +209,7 @@ describe('type: mobileKeyword', () => {
180
209
  await handler.buildDefinition(
181
210
  'testInstance/testBU',
182
211
  'mobileKeyword',
183
- 'testExisting_keyword',
212
+ '4912312345678.TESTEXISTING_KEYWORD',
184
213
  'testTargetMarket'
185
214
  );
186
215
  assert.equal(
@@ -189,12 +218,21 @@ describe('type: mobileKeyword', () => {
189
218
  'buildDefinition should not have thrown an error'
190
219
  );
191
220
  assert.deepEqual(
192
- await testUtils.getActualDeployJson('testTemplated_keyword', 'mobileKeyword'),
221
+ await testUtils.getActualDeployJson(
222
+ '4912312345678.TESTTEMPLATED_KEYWORD',
223
+ 'mobileKeyword'
224
+ ),
193
225
  await testUtils.getExpectedJson('9999999', 'mobileKeyword', 'build'),
194
226
  'returned deployment JSON was not equal expected'
195
227
  );
196
228
  expect(
197
- file(testUtils.getActualDeployFile('testTemplated_keyword', 'mobileKeyword', 'amp'))
229
+ file(
230
+ testUtils.getActualDeployFile(
231
+ '4912312345678.TESTTEMPLATED_KEYWORD',
232
+ 'mobileKeyword',
233
+ 'amp'
234
+ )
235
+ )
198
236
  ).to.equal(file(testUtils.getExpectedFile('9999999', 'mobileKeyword', 'build', 'amp')));
199
237
 
200
238
  assert.equal(
@@ -209,7 +247,7 @@ describe('type: mobileKeyword', () => {
209
247
  it('Should delete the item', async () => {
210
248
  // WHEN
211
249
  const result = await handler.deleteByKey('testInstance/testBU', 'mobileKeyword', [
212
- 'testExisting_keyword',
250
+ '4912312345678.TESTEXISTING_KEYWORD',
213
251
  ]);
214
252
  // THEN
215
253
  assert.equal(process.exitCode, false, 'delete should not have thrown an error');
@@ -224,7 +262,7 @@ describe('type: mobileKeyword', () => {
224
262
  const fileList = await handler.getFilesToCommit(
225
263
  'testInstance/testBU',
226
264
  'mobileKeyword',
227
- ['testExisting_keyword']
265
+ ['4912312345678.TESTEXISTING_KEYWORD']
228
266
  );
229
267
  // THEN
230
268
  assert.equal(
@@ -236,12 +274,12 @@ describe('type: mobileKeyword', () => {
236
274
 
237
275
  assert.equal(
238
276
  fileList[0].split('\\').join('/'),
239
- 'retrieve/testInstance/testBU/mobileKeyword/testExisting_keyword.mobileKeyword-meta.json',
277
+ 'retrieve/testInstance/testBU/mobileKeyword/4912312345678.TESTEXISTING_KEYWORD.mobileKeyword-meta.json',
240
278
  'wrong JSON path'
241
279
  );
242
280
  assert.equal(
243
281
  fileList[1].split('\\').join('/'),
244
- 'retrieve/testInstance/testBU/mobileKeyword/testExisting_keyword.mobileKeyword-meta.amp',
282
+ 'retrieve/testInstance/testBU/mobileKeyword/4912312345678.TESTEXISTING_KEYWORD.mobileKeyword-meta.amp',
245
283
  'wrong AMP path'
246
284
  );
247
285
  return;