feat: add publish configuration option to collections (#3467)

This commit is contained in:
Erez Rokah
2020-03-23 12:01:37 +02:00
committed by GitHub
parent 2f86d6fc36
commit df33bc64a9
11 changed files with 331 additions and 226 deletions

View File

@ -152,5 +152,17 @@ describe('config', () => {
);
}).not.toThrowError();
});
it('should throw if collection publish is not a boolean', () => {
expect(() => {
validateConfig(merge(validConfig, { collections: [{ publish: 'false' }] }));
}).toThrowError("'collections[0].publish' should be boolean");
});
it('should not throw if collection publish is a boolean', () => {
expect(() => {
validateConfig(merge(validConfig, { collections: [{ publish: false }] }));
}).not.toThrowError();
});
});
});

View File

@ -117,6 +117,7 @@ const getConfigSchema = () => ({
preview_path: { type: 'string' },
preview_path_date_field: { type: 'string' },
create: { type: 'boolean' },
publish: { type: 'boolean' },
editor: {
type: 'object',
properties: {