@@ -138,117 +138,4 @@ describe('<Baba />', () => {
138138
139139 expect ( callback . mock . calls [ 0 ] [ 0 ] . destination . elementBoundingBox ) . toMatchSnapshot ( ) ;
140140 } ) ;
141-
142- it ( 'should make children visible inside first baba element before animating has been triggered' , ( ) => {
143- const Animation = utils . createTestAnimation ( ) ;
144-
145- const wrapper = mount (
146- < Baba name = "anim-cc" >
147- < Animation > { props => < div { ...props } /> } </ Animation >
148- </ Baba >
149- ) ;
150-
151- expect ( wrapper . find ( 'div' ) ) . toHaveProp ( 'style' , { opacity : 1 } ) ;
152- } ) ;
153-
154- it ( 'should hide children inside target baba element when animating has been triggered' , ( ) => {
155- const Animation = utils . createTestAnimation ( ) ;
156- const wrapper = mount (
157- < utils . BabaUnderTest
158- from = {
159- < Baba name = "anim-dd" >
160- < Animation > { props => < div { ...props } /> } </ Animation >
161- </ Baba >
162- }
163- to = { < Baba name = "anim-dd" > { props => < div { ...props } /> } </ Baba > }
164- start = { false }
165- />
166- ) ;
167-
168- wrapper . setProps ( {
169- start : true ,
170- } ) ;
171- wrapper . update ( ) ;
172-
173- expect ( wrapper . find ( 'div' ) ) . toHaveProp ( 'style' , { opacity : 0 } ) ;
174- } ) ;
175-
176- it ( 'should show children when when flipping back to an already mounted baba' , ( ) => {
177- const wrapper = mount (
178- < utils . BabaUnderTest
179- from = { start => (
180- < Baba name = "flip-back-ee" in = { ! start } >
181- { props => < div { ...props } /> }
182- </ Baba >
183- ) }
184- to = { < Baba name = "flip-back-ee" > { props => < div { ...props } /> } </ Baba > }
185- start
186- />
187- ) ;
188-
189- wrapper . setProps ( {
190- start : false ,
191- } ) ;
192- wrapper . update ( ) ;
193-
194- expect ( wrapper . find ( 'div' ) ) . toHaveProp ( 'style' , { opacity : 1 } ) ;
195- } ) ;
196-
197- it ( 'should keep showing baba elements that have no matching pair when flipping in prop' , ( ) => {
198- const Animation = utils . createTestAnimation ( ) ;
199- const wrapper = mount (
200- < utils . BabaUnderTest
201- from = { start => (
202- < Baba name = "keep-showing-aa" in = { ! start } >
203- < Animation > { props => < div { ...props } /> } </ Animation >
204- </ Baba >
205- ) }
206- to = {
207- < Baba name = "sdadsdad" >
208- { props => (
209- < Animation >
210- < span { ...props } />
211- </ Animation >
212- ) }
213- </ Baba >
214- }
215- start = { false }
216- />
217- ) ;
218-
219- wrapper . setProps ( {
220- start : true ,
221- } ) ;
222- wrapper . update ( ) ;
223-
224- expect ( wrapper . find ( 'div' ) ) . toHaveProp ( 'style' , { opacity : 1 } ) ;
225- } ) ;
226-
227- it ( 'should show children inside target baba element when animating has completed' , async ( ) => {
228- const Animation = utils . createTestAnimation ( ) ;
229- const deferred = defer ( ) ;
230- const wrapper = mount (
231- < utils . BabaUnderTest
232- from = {
233- < Baba name = "anim-pp" >
234- < Animation > { props => < div { ...props } /> } </ Animation >
235- </ Baba >
236- }
237- to = {
238- < Baba name = "anim-pp" onFinish = { deferred . resolve } >
239- { props => < div { ...props } /> }
240- </ Baba >
241- }
242- start = { false }
243- />
244- ) ;
245-
246- wrapper . setProps ( {
247- start : true ,
248- } ) ;
249- await deferred . promise ;
250- wrapper . update ( ) ;
251-
252- expect ( wrapper . find ( 'div' ) ) . toHaveProp ( 'style' , { opacity : 1 } ) ;
253- } ) ;
254141} ) ;
0 commit comments