Skip to content

Commit

Permalink
#1411: add / enhance test cases for multi-delete
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Jul 4, 2024
1 parent aa7ac12 commit ecbe8e9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/general.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,24 @@ describe('GENERAL', () => {
);
});
});

describe('Delete --metadata ~~~', () => {
it('Should delete the item', async () => {
const argvMetadata = [
'asset:testExisting_asset',
'automation:testExisting_automation',
'journey:testExisting_journey_Quicksend/1',
'journey:testExisting_journey_Multistep/1',
];
const typeKeyCombo = handler.metadataToTypeKey(argvMetadata);
// WHEN
const isDeleted = await handler.deleteByKey('testInstance/testBU', typeKeyCombo);
// THEN
assert.equal(process.exitCode, 0, 'deleteByKey should not have thrown an error');
assert.equal(isDeleted, true, 'deleteByKey should have returned true');
return;
});
});
});

describe('without --metadata ================', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0175b971-71a3-4d8e-98ac-48121f3fbf4f
13 changes: 13 additions & 0 deletions test/type.journey.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,19 @@ describe('type: journey', () => {
assert.equal(isDeleted, true, 'should have deleted the item');
return;
});

it('Should delete 2 items with version', async () => {
// WHEN
const isDeleted = await handler.deleteByKey('testInstance/testBU', 'journey', [
'testExisting_journey_Quicksend/1',
'testExisting_journey_Multistep/1',
]);
// THEN
assert.equal(process.exitCode, 0, 'delete should not have thrown an error');

assert.equal(isDeleted, true, 'should have deleted the item');
return;
});
});

describe('ReplaceContentBlockByX ================', () => {
Expand Down

0 comments on commit ecbe8e9

Please sign in to comment.