File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
src/components/transition/test Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 1
- import { mount } from '@hypothesis/frontend-testing' ;
1
+ import { mount , waitFor } from '@hypothesis/frontend-testing' ;
2
2
3
3
import { testTransitionComponent } from '../../test/common-tests' ;
4
4
import Slider from '../Slider' ;
@@ -57,16 +57,11 @@ describe('Slider', () => {
57
57
assert . equal ( containerStyle . height , '200px' ) ;
58
58
} ) ;
59
59
60
- it ( 'should transition to collapsed if `direction` changes to `out`' , done => {
60
+ it ( 'should transition to collapsed if `direction` changes to `out`' , async ( ) => {
61
61
const wrapper = createSlider ( { direction : 'in' } ) ;
62
62
63
63
wrapper . setProps ( { direction : 'out' } ) ;
64
-
65
- setTimeout ( ( ) => {
66
- const containerStyle = wrapper . getDOMNode ( ) . style ;
67
- assert . equal ( containerStyle . height , '0px' ) ;
68
- done ( ) ;
69
- } , 1 ) ;
64
+ await waitFor ( ( ) => wrapper . getDOMNode ( ) . style . height === '0px' ) ;
70
65
} ) ;
71
66
72
67
it ( 'should set the container height to "auto" when an expand transition finishes' , ( ) => {
You can’t perform that action at this time.
0 commit comments