Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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`]
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down