This repository was archived by the owner on Nov 1, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -4,20 +4,11 @@ import 'jest-styled-components'
4
4
5
5
import { Dropdown } from '.'
6
6
7
- test ( 'passing checked prop as true should show dropdown content' , ( ) => {
8
- const dropdown = mount ( < Dropdown open triggerComponent = { < div > test</ div > } > test</ Dropdown > )
9
-
10
- const dropdownContent = dropdown . find ( { 'data-test' : 'dropdown-content' } )
11
-
12
- expect ( dropdownContent ) . toHaveStyleRule ( 'visibility' , 'visible' )
13
- dropdown . unmount ( )
14
- } )
15
-
16
- test ( 'passing checked prop as false should hide dropdown content' , ( ) => {
7
+ test ( 'passing open prop as false should hide dropdown content' , ( ) => {
17
8
const dropdown = mount ( < Dropdown open = { false } triggerComponent = { < div > test</ div > } > test</ Dropdown > )
18
9
19
10
const dropdownContent = dropdown . find ( { 'data-test' : 'dropdown-content' } )
20
11
21
- expect ( dropdownContent ) . toHaveStyleRule ( 'visibility ' , 'hidden ' )
12
+ expect ( dropdownContent ) . toHaveStyleRule ( 'display ' , 'none ' )
22
13
dropdown . unmount ( )
23
14
} )
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ const Content = styled(Block) <ContentProps>`
31
31
width : ${ props . triggerWidth } ;
32
32
` }
33
33
34
- visibility: ${ ( { open } ) => open ? 'visible' : 'hidden' } ;
34
+ ${ ( { open } ) => ! open && 'display: none;' }
35
35
${ ( { position } ) => css `${ position } ` }
36
36
`
37
37
You can’t perform that action at this time.
0 commit comments