const inputType = wrapper.type(); expect(inputType).toEqual('input'); });
test('fails with a tag expectation', t => { var actual = shallow(<Foo/>); t.is(actual.type(), 'span'); });
describe('<LeftRoof />', () => { it('should render an <div> tag', () => { const wrapper = shallow(<LeftRoof />); expect(wrapper.type()).toEqual('div'); }); });
it('should have the following structure', () => { const wrapper = shallow(<WeatherSearch />) expect(wrapper.type()).equal('div') const searchBox = wrapper.children().at(0) expect(searchBox.type()).equal('div') expect(searchBox.prop('className')).equal('WeatherSearch_searchBox') const inputSearch = searchBox.children().at(0) expect(inputSearch.type()).equal('input') expect(inputSearch.prop('type')).equal('text') expect(inputSearch.prop('placeholder')).equal('City') const searchButtonContainer = searchBox.children().at(1) expect(searchButtonContainer.type()).equal('div') expect(searchButtonContainer.find('button').text()).equal('Get weather') })
it('has the "Start" button enabled and the "Pause" and "Reset" buttons disabled initially', () => { const wrapper = shallow(<Timer />); expect(wrapper.findWhere(n => n.type() === 'button' && n.text() === 'Start')).to.not.be.disabled(); expect(wrapper.findWhere(n => n.type() === 'button' && n.text() === 'Pause')).to.be.disabled(); expect(wrapper.findWhere(n => n.type() === 'button' && n.text() === 'Reset')).to.be.disabled(); });
it('has "Start", "Pause", and "Reset" buttons', () => { const wrapper = shallow(<Timer />); expect(wrapper.findWhere(n => n.type() === 'button' && n.text() === 'Start').length).to.equal(1); expect(wrapper.findWhere(n => n.type() === 'button' && n.text() === 'Pause').length).to.equal(1); expect(wrapper.findWhere(n => n.type() === 'button' && n.text() === 'Reset').length).to.equal(1); });
describe('<App />', () => { it('is a Router', () => { expect(shallow(<App />).type()).toBe(Router); }); });
it('should render an <div> tag', () => { const renderedComponent = shallow(<Percent />); expect(renderedComponent.type()).toEqual('div'); });
describe('Container', () => { it('should render with a "container" class', () => { const wrapper = shallow(<Container />); expect(wrapper.hasClass('container')).toBeTruthy(); }); it('should render children', () => { const wrapper = shallow( <Container> <h1>Title</h1> </Container> ); expect(wrapper.children().type()).toBe('h1'); expect(wrapper.text()).toBe('Title'); }); });
// TODO: cover plugin with a test cases describe('<MarkerClusterGroup>', () => { it('should render nothing', () => { const wrapper = shallow(<MarkerClusterGroup />, LayerGroupContext); expect(wrapper.type()).toBeNull(); }); });
it('should render an <div> tag', () => { const renderedComponent = shallow(<Wrapper />); expect(renderedComponent.type()).toEqual('div'); });
describe('<NavBar />', () => { it('should render an <div> tag', () => { const wrapper = shallow(<NavBar />); expect(wrapper.type()).toEqual('div'); }); });
describe('<RightRoof />', () => { it('should render an <div> tag', () => { const wrapper = shallow(<RightRoof />); expect(wrapper.type()).toEqual('div'); }); });
it('should render an <div> tag', () => { const renderedComponent = shallow(<Wrapper />); expect(renderedComponent.type()).toEqual('div'); });
it('should render an <div> tag', () => { const renderedComponent = shallow(<Percent />); expect(renderedComponent.type()).toEqual('div'); });