import '../../../__mocks__/shallow_useeffect.mock' ; import { setMockActions } from '../../../__mocks__/kea_logic' ; import React from 'react' ; import { Route , Switch } from 'react-router-dom' ; import { shallow } from 'enzyme' ; import { GroupRouter } from './group_router' ; import { Groups } from './groups' ; import { GroupsRouter } from './groups_router' ; describe ( 'GroupsRouter' , ( ) => { const initializeGroups = jest . fn ( ) ; beforeEach ( ( ) => { setMockActions ( { initializeGroups } ) ; } ) ; it ( 'renders' , ( ) => { const wrapper = shallow ( < GroupsRouter />); expect ( wrapper . find ( Switch ) ) . toHaveLength ( 1 ) ; expect ( wrapper . find ( Route ) ) . toHaveLength ( 2 ) ; expect ( wrapper . find ( GroupRouter ) ) . toHaveLength ( 1 ) ; expect ( wrapper . find ( Groups ) ) . toHaveLength ( 1 ) ; } ) ; } ) ;