44 * you may not use this file except in compliance with the Elastic License.
55 */
66
7- import { mount , shallow } from 'enzyme' ;
7+ import { mount } from 'enzyme' ;
88import * as React from 'react' ;
99
1010import { navTabs } from '../../../pages/home/home_navigations' ;
@@ -60,13 +60,13 @@ describe('Tab Navigation', () => {
6060 } ,
6161 } ;
6262 test ( 'it mounts with correct tab highlighted' , ( ) => {
63- const wrapper = shallow ( < TabNavigationComponent { ...mockProps } /> ) ;
64- const hostsTab = wrapper . find ( '[data-test-subj="navigation-hosts"]' ) ;
63+ const wrapper = mount ( < TabNavigationComponent { ...mockProps } /> ) ;
64+ const hostsTab = wrapper . find ( 'EuiTab [data-test-subj="navigation-hosts"]' ) ;
6565 expect ( hostsTab . prop ( 'isSelected' ) ) . toBeTruthy ( ) ;
6666 } ) ;
6767 test ( 'it changes active tab when nav changes by props' , ( ) => {
6868 const wrapper = mount ( < TabNavigationComponent { ...mockProps } /> ) ;
69- const networkTab = ( ) => wrapper . find ( '[data-test-subj="navigation-network"]' ) . first ( ) ;
69+ const networkTab = ( ) => wrapper . find ( 'EuiTab [data-test-subj="navigation-network"]' ) . first ( ) ;
7070 expect ( networkTab ( ) . prop ( 'isSelected' ) ) . toBeFalsy ( ) ;
7171 wrapper . setProps ( {
7272 pageName : 'network' ,
@@ -77,8 +77,8 @@ describe('Tab Navigation', () => {
7777 expect ( networkTab ( ) . prop ( 'isSelected' ) ) . toBeTruthy ( ) ;
7878 } ) ;
7979 test ( 'it carries the url state in the link' , ( ) => {
80- const wrapper = shallow ( < TabNavigationComponent { ...mockProps } /> ) ;
81- const firstTab = wrapper . find ( '[data-test-subj="navigation-network"]' ) ;
80+ const wrapper = mount ( < TabNavigationComponent { ...mockProps } /> ) ;
81+ const firstTab = wrapper . find ( 'EuiTab [data-test-subj="navigation-network"]' ) ;
8282 expect ( firstTab . props ( ) . href ) . toBe (
8383 "#/link-to/network?query=(language:kuery,query:'host.name:%22siem-es%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:1558048243696,fromStr:now-24h,kind:relative,to:1558134643697,toStr:now)),timeline:(linkTo:!(global),timerange:(from:1558048243696,fromStr:now-24h,kind:relative,to:1558134643697,toStr:now)))"
8484 ) ;
@@ -124,9 +124,9 @@ describe('Tab Navigation', () => {
124124 } ,
125125 } ;
126126 test ( 'it mounts with correct tab highlighted' , ( ) => {
127- const wrapper = shallow ( < TabNavigationComponent { ...mockProps } /> ) ;
127+ const wrapper = mount ( < TabNavigationComponent { ...mockProps } /> ) ;
128128 const tableNavigationTab = wrapper . find (
129- `[data-test-subj="navigation-${ HostsTableType . authentications } "]`
129+ `EuiTab [data-test-subj="navigation-${ HostsTableType . authentications } "]`
130130 ) ;
131131
132132 expect ( tableNavigationTab . prop ( 'isSelected' ) ) . toBeTruthy ( ) ;
@@ -145,9 +145,9 @@ describe('Tab Navigation', () => {
145145 expect ( tableNavigationTab ( ) . prop ( 'isSelected' ) ) . toBeTruthy ( ) ;
146146 } ) ;
147147 test ( 'it carries the url state in the link' , ( ) => {
148- const wrapper = shallow ( < TabNavigationComponent { ...mockProps } /> ) ;
148+ const wrapper = mount ( < TabNavigationComponent { ...mockProps } /> ) ;
149149 const firstTab = wrapper . find (
150- `[data-test-subj="navigation-${ HostsTableType . authentications } "]`
150+ `EuiTab [data-test-subj="navigation-${ HostsTableType . authentications } "]`
151151 ) ;
152152 expect ( firstTab . props ( ) . href ) . toBe (
153153 `#/${ pageName } /${ hostName } /${ HostsTableType . authentications } ?query=(language:kuery,query:'host.name:%22siem-es%22')&timerange=(global:(linkTo:!(timeline),timerange:(from:1558048243696,fromStr:now-24h,kind:relative,to:1558134643697,toStr:now)),timeline:(linkTo:!(global),timerange:(from:1558048243696,fromStr:now-24h,kind:relative,to:1558134643697,toStr:now)))`
0 commit comments