kentico-cloud-delivery
Version:
Official Kentico Cloud Delivery SDK
24 lines • 915 B
JavaScript
import { Context, setup } from '../../setup';
describe('Custom query headers', function () {
var context = new Context();
setup(context);
it("Item query initialization with invalid codename should throw Error", function () {
expect(function () { return context.deliveryClient.item(null); }).toThrowError();
});
it("Header should be present in result", function () {
var headers = context.deliveryClient
.items()
.queryConfig({
customHeaders: [
{
header: 'xHeader',
value: 'yValue'
}
]
})
.getHeaders();
var itemHeader = headers.find(function (m) { return m.header === 'xHeader' && m.value === 'yValue'; });
expect(itemHeader).toBeDefined();
});
});
//# sourceMappingURL=custom-headers.spec.js.map