diff --git a/packages/salesforcedx-vscode-core/src/util/metadataDictionary.ts b/packages/salesforcedx-vscode-core/src/util/metadataDictionary.ts index 0093abfb7b..dd97676e02 100644 --- a/packages/salesforcedx-vscode-core/src/util/metadataDictionary.ts +++ b/packages/salesforcedx-vscode-core/src/util/metadataDictionary.ts @@ -89,6 +89,13 @@ const DEFINITIONS: { [key: string]: MetadataInfo } = { directory: 'experiencePropertyTypeBundles', pathStrategy: PathStrategyFactory.createDefaultStrategy(), extensions: [`${sep}schema.json`] + }, + contenttypebundle: { + type: 'ContentTypeBundle', + suffix: 'json', + directory: 'contentTypes', + pathStrategy: PathStrategyFactory.createDefaultStrategy(), + extensions: [`${sep}schema.json`] } }; diff --git a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/util/postconditionCheckers.test.ts b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/util/postconditionCheckers.test.ts index 249f828e4b..cb53d07a98 100644 --- a/packages/salesforcedx-vscode-core/test/vscode-integration/commands/util/postconditionCheckers.test.ts +++ b/packages/salesforcedx-vscode-core/test/vscode-integration/commands/util/postconditionCheckers.test.ts @@ -245,6 +245,35 @@ describe('Postcondition Checkers', () => { expect(promptStub.firstCall).to.null; }); + it('Should prompt overwrite for ContentTypeBundle components that exist', async () => { + existsStub.returns(false); + const data = { + fileName: 'Test1', + outputdir: 'package/tests', + type: 'ContentTypeBundle', + suffix: 'json' + }; + pathExists(true, data, '/schema.json'); + + await checker.check({ type: 'CONTINUE', data }); + + expect(promptStub.firstCall.args[0]).to.eql([data]); + }); + + it('Should prompt overwrite for ContentTypeBundle components that does not exist', async () => { + existsStub.returns(false); + const data = { + fileName: 'Test1', + outputdir: 'package/tests', + type: 'ContentTypeBundle', + suffix: 'json' + }; + + await checker.check({ type: 'CONTINUE', data }); + + expect(promptStub.firstCall).to.null; + }); + it('Should determine a component exists if at least one of its file extensions do', async () => { const dictionaryStub = env.stub(MetadataDictionary, 'getInfo'); dictionaryStub.returns({