import React from 'react' import { mount, shallow } from 'enzyme' import { Button } from '../button' import { TopBar } from './TopBar' describe('TopBar', () => { it('should not have the scrolled class if hasScrolled is false or null', () => { const topBar = shallow() expect(topBar.hasClass('kirk-topBar--scrolled')).toBe(false) }) it('should not have the scrolled class if hasScrolled is true', () => { const topBar = shallow() expect(topBar.hasClass('kirk-topBar--scrolled')).toBe(true) }) it('should have a clickable button ', () => { const onClick = jest.fn() const topBar = mount(} />) expect(topBar.find('button')).toHaveLength(1) const button = topBar.find('button') button.simulate('click') expect(onClick).toHaveBeenCalledTimes(1) }) it('should have a left area with a button', () => { const topBar = mount(} />) const leftArea = topBar.find('.kirk-topBar-left') expect(leftArea.contains(