mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
31 lines
852 B
JavaScript
31 lines
852 B
JavaScript
const should = require('should');
|
|
const sinon = require('sinon');
|
|
const utils = require('../../../../../core/server/api/v3/utils');
|
|
|
|
describe('Unit: v3/utils/index', function () {
|
|
afterEach(function () {
|
|
sinon.restore();
|
|
});
|
|
|
|
describe('isContentAPI', function () {
|
|
it('is true when apiType is "content"', function () {
|
|
const frame = {
|
|
apiType: 'content'
|
|
};
|
|
should(utils.isContentAPI(frame)).equal(true);
|
|
});
|
|
|
|
it('is false when apiType is admin', function () {
|
|
const frame = {
|
|
apiType: 'admin',
|
|
options: {
|
|
context: {
|
|
no: 'public'
|
|
}
|
|
}
|
|
};
|
|
should(utils.isContentAPI(frame)).equal(false);
|
|
});
|
|
});
|
|
});
|