/
fast-pass-left-nav.test.tsx
41 lines (38 loc) · 1.38 KB
/
fast-pass-left-nav.test.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { shallow } from 'enzyme';
import * as React from 'react';
import {
FastPassLeftNav,
FastPassLeftNavDeps,
FastPassLeftNavProps,
} from '../../../../../../DetailsView/components/left-nav/fast-pass-left-nav';
import { NavLinkHandler } from '../../../../../../DetailsView/components/left-nav/nav-link-handler';
describe(FastPassLeftNav.displayName, () => {
let onRightPanelContentSwitch: () => void;
let setNavComponentRef: (_) => void;
let navLinkHandlerStub: NavLinkHandler;
let deps: FastPassLeftNavDeps;
let props: FastPassLeftNavProps;
beforeEach(() => {
onRightPanelContentSwitch = () => {};
setNavComponentRef = _ => {};
navLinkHandlerStub = {
onFastPassTestClick: (e, link) => null,
} as NavLinkHandler;
deps = {
navLinkHandler: navLinkHandlerStub,
} as FastPassLeftNavDeps;
props = {
deps,
selectedKey: 'some string',
featureFlagStoreData: {},
onRightPanelContentSwitch,
setNavComponentRef,
};
});
it('renders visualization based left nav with appropriate params', () => {
const actual = shallow(<FastPassLeftNav {...props} />);
expect(actual.getElement()).toMatchSnapshot();
});
});