kentico-cloud-delivery
Version:
Official Kentico Cloud Delivery SDK
20 lines • 1.1 kB
JavaScript
exports.__esModule = true;
var setup_1 = require("../../setup");
describe('Query custom parameter', function () {
var context = new setup_1.Context();
setup_1.setup(context);
it("Url should contain the custom parameter with value #1", function () {
var url = context.deliveryClient.items().withParameter('customParam', 'customVal').getUrl();
expect(url).toContain("customParam=customVal");
});
it("Url should contain the custom parameter with value #2", function () {
var url = context.deliveryClient.element('el', 'cd').withParameter('customParam', 'customVal').getUrl();
expect(url).toContain("customParam=customVal");
});
it("Custom param with invalid name should throw Error", function () {
expect(function () { return context.deliveryClient.items().withParameter(undefined, 'customVal'); }).toThrowError();
expect(function () { return context.deliveryClient.items().withParameter(null, 'customVal'); }).toThrowError();
});
});
//# sourceMappingURL=query-custom-parameter.spec.js.map
;