Skip to content

Commit abf1fb0

Browse files
committed
add unit test
1 parent aaa8c22 commit abf1fb0

File tree

1 file changed

+24
-0
lines changed
  • x-pack/plugins/security_solution/public/network/components/embeddables

1 file changed

+24
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
import { State } from '../../../common/store';
7+
8+
import { getDefaultSourcererSelector } from './selector';
9+
10+
jest.mock('../../../common/store/sourcerer', () => ({
11+
sourcererSelectors: {
12+
kibanaIndexPatternsSelector: jest.fn().mockReturnValue(jest.fn()),
13+
scopesSelector: jest.fn().mockReturnValue(jest.fn().mockReturnValue({ default: '' })),
14+
},
15+
}));
16+
17+
describe('getDefaultSourcererSelector', () => {
18+
test('Returns correct format', () => {
19+
const mockMapStateToProps = getDefaultSourcererSelector();
20+
const result = mockMapStateToProps({} as State);
21+
expect(result).toHaveProperty('kibanaIndexPatterns');
22+
expect(result).toHaveProperty('sourcererScope');
23+
});
24+
});

0 commit comments

Comments
 (0)