// @flow
import { expect } from 'chai';
import React from 'react';
import ReactTestUtils, { Simulate } from 'react-dom/test-utils';
import HeaderBar from '../../app/components/HeaderBar';
describe('components/HeaderBar', () => {
it('should display headerbar', () => {
const component = ReactTestUtils.renderIntoDocument(
);
ReactTestUtils.findRenderedDOMComponentWithClass(component, 'headerbar__container');
});
it('should not display headerbar', () => {
const component = ReactTestUtils.renderIntoDocument(
);
const domNodes = ReactTestUtils.scryRenderedDOMComponentsWithClass(component, 'headerbar__container');
expect(domNodes.length).to.be.equal(0);
});
it('should display settings button', () => {
const component = ReactTestUtils.renderIntoDocument(
);
ReactTestUtils.findRenderedDOMComponentWithClass(component, 'headerbar__settings');
});
it('should not display settings button', () => {
const component = ReactTestUtils.renderIntoDocument(
);
const domNodes = ReactTestUtils.scryRenderedDOMComponentsWithClass(component, 'headerbar__settings');
expect(domNodes.length).to.be.equal(0);
});
it('should call settings callback', (done) => {
const component = ReactTestUtils.renderIntoDocument(
done() } />
);
const domNode = ReactTestUtils.findRenderedDOMComponentWithClass(component, 'headerbar__settings');
Simulate.click(domNode);
});
});