text: import React from 'react';
  import ReactTestUtils from 'react-dom/test-utils';
  import { getDOMNode } from '@test/testUtils';
  
  import Sidenav from '../Sidenav';
  import Nav from '../../Nav';
  import Dropdown from '../../Dropdown';
  
  describe('Sidenav', () => {
    it('Should render a navigation', () => {
      const instance = getDOMNode(<Sidenav />);
      assert.include(instance.className, 'rs-sidenav');
    });
  
    it('Should apply appearance', () => {
      const instance = getDOMNode(<Sidenav appearance="subtle" />);
      assert.include(instance.className, 'rs-sidenav-subtle');
    });
  
    it('Should be expanded', () => {
      const instance = getDOMNode(<Sidenav expanded />);
      assert.include(instance.className, 'rs-sidenav-collapse-in');
    });
  
    it('Should call onSelect callback', done => {
      const doneOp = () => {
        done();
      };
      const instance = getDOMNode(
        <Sidenav onSelect={doneOp}>
          <Nav>
            <Nav.Item eventKey="1">a</Nav.Item>
            <Nav.Item eventKey="2">b</Nav.Item>
          </Nav>
        </Sidenav>
      );
  
      ReactTestUtils.Simulate.click(instance.querySelector('.rs-nav-item-content'));
    });
  
    it('Should call onOpenChange callback', done => {
      const doneOp = () => {
        done();
      };
      const instance = getDOMNode(
        <Sidenav onOpenChange={doneOp}>
          <Nav>
            <Nav.Item eventKey="1">a</Nav.Item>
            <Nav.Item eventKey="2">b</Nav.Item>
            <Dropdown eventKey="3" title="3">
              <Dropdown.Item eventKey="3-1">3-1</Dropdown.Item>
              <Dropdown.Item eventKey="3-2">3-2</Dropdown.Item>
            </Dropdown>
          </Nav>
        </Sidenav>
      );
  
      ReactTestUtils.Simulate.click(instance.querySelector('.rs-dropdown-toggle'));
    });
  
    it('Should have a custom className', () => {
      const instance = getDOMNode(<Sidenav className="custom" />);
      assert.include(instance.className, 'custom');
    });
  
    it('Should have a custom style', () => {
      const fontSize = '12px';
      const instance = getDOMNode(<Sidenav style={{ fontSize }} />);
      assert.equal(instance.style.fontSize, fontSize);
    });
  
    it('Should have a custom className prefix', () => {
      const instance = getDOMNode(<Sidenav classPrefix="custom-prefix" />);
      assert.ok(instance.className.match(/\bcustom-prefix\b/));
    });
  });
  