kentico-cloud-delivery
Version:
Official Kentico Cloud Delivery SDK
28 lines • 1.15 kB
JavaScript
import { ContentItem, ContentItemSystemAttributes } from '../../../lib';
import { Context, setup } from '../../setup';
describe('Non generic item tests', function () {
var context = new Context();
// remove type resolvers for testing
context.typeResolvers = [];
setup(context);
var movieCodename = 'warrior';
var response;
beforeAll(function (done) {
context.deliveryClient.item(movieCodename)
.getObservable()
.subscribe(function (r) {
response = r;
done();
});
});
it("ContentItem should be returned if ", function () {
expect(response.item).toEqual(jasmine.any(ContentItem));
});
it("ContentItem should contain typed properties even though they are not defined as properties in class", function () {
expect(response.item['title'].text.toLowerCase()).toEqual('warrior');
});
it("System attributes property should be set", function () {
expect(response.item.system).toEqual(jasmine.any(ContentItemSystemAttributes));
});
});
//# sourceMappingURL=non-generic-item.spec.js.map