import * as React from 'react';
import {MenuNavigationItemTypeItem} from '../../types';
import {render} from '../../../test-utils';
import ExtendedMainMenu from '../ExtendedMainMenu';
import {IconButtonStyled} from '../../../Button/Iconbutton';
import MainMenu from '../MainMenu';
import RightSideNav from '../RightSideNav';
import { NavigationProvider } from '../../../Navigation';

describe('RightSideNav', () => {
  
  const navProps = {
    currentPath: '',
    isActiveRoute: () => false,
    navigate: (path: string, isExternal: boolean) => {}
  };


  const items = [{
    label: 'item1',
    to: '#1'
  },
    {
      label: 'item2',
      to: '#2'
    }] as MenuNavigationItemTypeItem[];

  it('should render items', () => {
    const wrapper = render(<NavigationProvider {...navProps}><RightSideNav items={items}/></NavigationProvider>);

    expect(wrapper.getByText('item1')).toBeDefined();
    expect(wrapper.getByText('item2')).toBeDefined();
  });

  it('should render action', () => {
    const wrapper = render(
      <NavigationProvider {...navProps}>
        <RightSideNav items={[]}
                      action={{label: 'label', action: jest.fn()}}/>
      </NavigationProvider>);

    expect(wrapper.getByText('label')).toBeDefined();
  });

});
