Ghost/test/unit/api/canary/utils/index_spec.js
Hannah Wolfe 7f1d3ebc07
Move tests from core to root (#11700)
- 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>
2020-03-30 16:26:47 +01:00

31 lines
860 B
JavaScript

const should = require('should');
const sinon = require('sinon');
const utils = require('../../../../../core/server/api/canary/utils');
describe('Unit: canary/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);
});
});
});