芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/app.optimyar.com/backend/node_modules/reactstrap/src/__tests__/CardSubtitle.spec.js
import React from 'react'; import { shallow } from 'enzyme'; import { CardSubtitle } from '../'; describe('CardSubtitle', () => { it('should render with "card-subtitle" class', () => { const wrapper = shallow(
Yo!
); expect(wrapper.text()).toBe('Yo!'); expect(wrapper.hasClass('card-subtitle')).toBe(true); }); it('should render additional classes', () => { const wrapper = shallow(
Yo!
); expect(wrapper.hasClass('other')).toBe(true); expect(wrapper.hasClass('card-subtitle')).toBe(true); }); it('should render custom tag', () => { const wrapper = shallow(
Yo!
); expect(wrapper.text()).toBe('Yo!'); expect(wrapper.hasClass('card-subtitle')).toBe(true); expect(wrapper.find('h3').length).toBe(1); }); it('should render a "div" tag by default', () => { const wrapper = shallow(
Yo!
); expect(wrapper.find('div').length).toBe(1); }); });