Skip to content

Commit

Permalink
update test snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Jan 16, 2020
1 parent ddf8fac commit b4dcefb
Showing 1 changed file with 48 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,56 @@
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;
describe('makeRequestFacade', () => {
test('creates a default object', () => {
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,
expect(makeRequestFacade(originalRequest)).toMatchInlineSnapshot(`
Object {
"getBasePath": [Function],
"getRawRequest": [Function],
"getSavedObjectsClient": undefined,
"headers": Object {
"user": 123,
},
"params": Object {
"param1": 123,
},
"payload": Object {
"payload1": 123,
},
"pre": undefined,
"query": undefined,
"route": undefined,
}
`);
});

test('getRawRequest', () => {
const originalRequest = ({
getBasePath: () => 'basebase',
params: {
param1: 123,
},
"params": Object {
"param1": 123,
payload: {
payload1: 123,
},
"payload": Object {
"payload1": 123,
headers: {
user: 123,
},
"pre": undefined,
"query": undefined,
"route": undefined,
}
`);
} as unknown) as Legacy.Request;

expect(makeRequestFacade(originalRequest).getRawRequest()).toBe(originalRequest);
});
});

0 comments on commit b4dcefb

Please sign in to comment.