kentico-cloud-delivery
Version:
Official Kentico Cloud Delivery SDK
20 lines • 1.01 kB
JavaScript
import { Context, setup } from '../../setup';
describe('Item URL', function () {
var context = new Context();
setup(context);
it("item query should thrown error when item's codename is not set", function () {
expect(function () { return context.deliveryClient.item(null); }).toThrowError();
});
it("item query should thrown error when item's codename is empty", function () {
expect(function () { return context.deliveryClient.item(''); }).toThrowError();
});
it("item url with 'kyle' codename should end with '/items/kyle", function () {
var url = new URL(context.deliveryClient.item('kyle').getUrl());
expect(url.toString()).toContain("/items/kyle");
});
it("item url with 'arnold' codename should end with '/items/arnold'", function () {
var url = new URL(context.deliveryClient.item('arnold').getUrl());
expect(url.toString()).toContain("/items/arnold");
});
});
//# sourceMappingURL=item-url.spec.js.map