File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
x-pack/legacy/plugins/reporting/server/routes/lib Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+ * or more contributor license agreements. Licensed under the Elastic License;
4+ * you may not use this file except in compliance with the Elastic License.
5+ */
6+
7+ import { Legacy } from 'kibana' ;
8+ import { makeRequestFacade } from './make_request_facade' ;
9+
10+ test ( 'makeRequestFacade' , ( ) => {
11+ const originalRequest = ( {
12+ getBasePath : ( ) => 'basebase' ,
13+ params : {
14+ param1 : 123 ,
15+ } ,
16+ payload : {
17+ payload1 : 123 ,
18+ } ,
19+ headers : {
20+ user : 123 ,
21+ } ,
22+ } as unknown ) as Legacy . Request ;
23+
24+ expect ( makeRequestFacade ( originalRequest ) ) . toMatchInlineSnapshot ( `
25+ Object {
26+ "getBasePath": [Function],
27+ "getSavedObjectsClient": undefined,
28+ "headers": Object {
29+ "user": 123,
30+ },
31+ "params": Object {
32+ "param1": 123,
33+ },
34+ "payload": Object {
35+ "payload1": 123,
36+ },
37+ "pre": undefined,
38+ "query": undefined,
39+ "route": undefined,
40+ }
41+ ` ) ;
42+ } ) ;
You can’t perform that action at this time.
0 commit comments