mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
7f1d3ebc07
- move all test files from core/test to test/ - updated all imports and other references - all code inside of core/ is then application code - tests are correctly at the root level - consistent with other repos/projects Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
59 lines
1.8 KiB
JavaScript
59 lines
1.8 KiB
JavaScript
const should = require('should');
|
|
const serializers = require('../../../../../../../core/server/api/canary/utils/serializers');
|
|
|
|
describe('Unit: canary/utils/serializers/input/pages', function () {
|
|
describe('browse', function () {
|
|
it('default', function () {
|
|
const apiConfig = {};
|
|
const frame = {
|
|
options: {
|
|
context: {}
|
|
}
|
|
};
|
|
|
|
serializers.input.integrations.browse(apiConfig, frame);
|
|
frame.options.filter.should.eql('type:[custom,builtin]');
|
|
});
|
|
|
|
it('combines filters', function () {
|
|
const apiConfig = {};
|
|
const frame = {
|
|
options: {
|
|
filter: 'type:internal',
|
|
context: {}
|
|
}
|
|
};
|
|
|
|
serializers.input.integrations.browse(apiConfig, frame);
|
|
frame.options.filter.should.eql('(type:internal)+type:[custom,builtin]');
|
|
});
|
|
});
|
|
|
|
describe('read', function () {
|
|
it('default', function () {
|
|
const apiConfig = {};
|
|
const frame = {
|
|
options: {
|
|
context: {}
|
|
}
|
|
};
|
|
|
|
serializers.input.integrations.read(apiConfig, frame);
|
|
frame.options.filter.should.eql('type:[custom,builtin]');
|
|
});
|
|
|
|
it('combines filters', function () {
|
|
const apiConfig = {};
|
|
const frame = {
|
|
options: {
|
|
filter: 'type:internal',
|
|
context: {}
|
|
}
|
|
};
|
|
|
|
serializers.input.integrations.read(apiConfig, frame);
|
|
frame.options.filter.should.eql('(type:internal)+type:[custom,builtin]');
|
|
});
|
|
});
|
|
});
|