File tree Expand file tree Collapse file tree 3 files changed +44
-17
lines changed
packages/dx-react-grid-bootstrap3/src/templates/column-chooser Expand file tree Collapse file tree 3 files changed +44
-17
lines changed Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
2
import * as PropTypes from 'prop-types' ;
3
3
import { Overlay as OverlayBS3 } from 'react-bootstrap' ;
4
-
5
- const Popover = ( { children } ) => (
6
- < div
7
- className = "dropdown-menu"
8
- style = { {
9
- padding : 0 ,
10
- display : 'block' ,
11
- border : 'none' ,
12
- } }
13
- >
14
- { children }
15
- </ div >
16
- ) ;
17
-
18
- Popover . propTypes = {
19
- children : PropTypes . node . isRequired ,
20
- } ;
4
+ import { Popover } from './popover' ;
21
5
22
6
export const Overlay = ( {
23
7
visible, target,
Original file line number Diff line number Diff line change
1
+ import * as React from 'react' ;
2
+ import * as PropTypes from 'prop-types' ;
3
+
4
+ export const Popover = ( { children, style } ) => (
5
+ < div
6
+ className = "dropdown-menu"
7
+ style = { {
8
+ padding : 0 ,
9
+ display : 'block' ,
10
+ border : 'none' ,
11
+ ...style ,
12
+ } }
13
+ >
14
+ { children }
15
+ </ div >
16
+ ) ;
17
+
18
+ Popover . propTypes = {
19
+ children : PropTypes . node . isRequired ,
20
+ style : PropTypes . object ,
21
+ } ;
22
+
23
+ Popover . defaultProps = {
24
+ style : null ,
25
+ } ;
Original file line number Diff line number Diff line change
1
+ import * as React from 'react' ;
2
+ import { shallow } from 'enzyme' ;
3
+ import { Popover } from './popover' ;
4
+
5
+ describe ( 'Popover' , ( ) => {
6
+ it ( 'should pass styles to the root element' , ( ) => {
7
+ const tree = shallow ( (
8
+ < Popover
9
+ style = { { left : 100 , top : 50 } }
10
+ >
11
+ < div />
12
+ </ Popover >
13
+ ) ) ;
14
+
15
+ expect ( tree . prop ( 'style' ) )
16
+ . toMatchObject ( { left : 100 , top : 50 } ) ;
17
+ } ) ;
18
+ } ) ;
You can’t perform that action at this time.
0 commit comments