File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import React , { PropTypes } from 'react' ;
2+ import classNames from 'classnames' ;
3+
4+ const propTypes = { } ;
5+
6+ const defaultProps = { } ;
7+
8+ class PopoverTitle extends React . Component {
9+ constructor ( props ) {
10+ super ( props ) ;
11+ }
12+
13+ render ( ) {
14+ const {
15+ children,
16+ className,
17+ ...attributes
18+ } = this . props ;
19+
20+ const classes = classNames (
21+ className ,
22+ 'popover-title'
23+ ) ;
24+
25+ return (
26+ < h3 { ...attributes }
27+ className = { classes } >
28+ { children }
29+ </ h3 >
30+ ) ;
31+ }
32+ }
33+
34+ PopoverTitle . propTypes = propTypes ;
35+ PopoverTitle . defaultProps = defaultProps ;
36+
37+ export default PopoverTitle ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import DropdownItem from './DropdownItem';
77import DropdownMenu from './DropdownMenu' ;
88import DropdownToggle from './DropdownToggle' ;
99import Label from './Label' ;
10+ import PopoverTitle from './PopoverTitle' ;
1011import TetherContent from './TetherContent' ;
1112import Tooltip from './Tooltip' ;
1213
@@ -20,6 +21,7 @@ export {
2021 DropdownMenu ,
2122 DropdownToggle ,
2223 Label ,
24+ PopoverTitle ,
2325 TetherContent ,
2426 Tooltip
2527} ;
Original file line number Diff line number Diff line change 1+ /* eslint react/no-multi-comp: 0, react/prop-types: 0 */
2+ import React from 'react' ;
3+ import { shallow , mount } from 'enzyme' ;
4+ import { PopoverTitle } from '../lib' ;
5+
6+ describe ( 'PopoverTitle' , ( ) => {
7+ it ( 'should render children' , ( ) => {
8+ const wrapper = shallow ( < PopoverTitle > Ello world</ PopoverTitle > ) ;
9+
10+ expect ( wrapper . text ( ) ) . toBe ( 'Ello world' ) ;
11+ expect ( wrapper . hasClass ( 'popover-title' ) ) . toBe ( true ) ;
12+ } ) ;
13+ } ) ;
You can’t perform that action at this time.
0 commit comments