diff --git a/x-pack/legacy/plugins/reporting/server/routes/lib/make_request_facade.test.ts b/x-pack/legacy/plugins/reporting/server/routes/lib/make_request_facade.test.ts new file mode 100644 index 0000000000000..66257302a9dfa --- /dev/null +++ b/x-pack/legacy/plugins/reporting/server/routes/lib/make_request_facade.test.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { Legacy } from 'kibana'; +import { makeRequestFacade } from './make_request_facade'; + +test('makeRequestFacade', () => { + const originalRequest = ({ + getBasePath: () => 'basebase', + params: { + param1: 123, + }, + payload: { + payload1: 123, + }, + headers: { + user: 123, + }, + } as unknown) as Legacy.Request; + + expect(makeRequestFacade(originalRequest)).toMatchInlineSnapshot(` + Object { + "getBasePath": [Function], + "getSavedObjectsClient": undefined, + "headers": Object { + "user": 123, + }, + "params": Object { + "param1": 123, + }, + "payload": Object { + "payload1": 123, + }, + "pre": undefined, + "query": undefined, + "route": undefined, + } + `); +});