all files / tests/ tooltip_test.js

100% Statements 53/53
100% Branches 33/33
100% Functions 13/13
100% Lines 13/13
4 statements, 14 branches Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23                      
import React from 'react';
import TestUtils from 'react-addons-test-utils';
import {Tooltip} from '../src/index';
 
export default class DefaultTooltip extends React.Component {
  render() {
    return <Tooltip content="Yes, the default one" ref="tooltip">Simple black tooltip</Tooltip>;
  }
}
 
describe('Tooltip', () => {
  it('should export a function', () => {
    expect(Tooltip).to.exist;
    expect(Tooltip).to.be.instanceof(Function);
  });
 
  it('default state should be equal {visible:false}', () => {
    const rendered = TestUtils.renderIntoDocument(<DefaultTooltip />);
    const node = rendered.refs.tooltip;
    expect(node.state.visible).to.equal(false);
  });
});