@@ -103,7 +103,7 @@ describe('useAnimate', () => {
103103 const { rerender } = render ( < TestComponent width = { 2000 } /> ) ;
104104
105105 await waitNextFrame ( ) ;
106- expect ( callCount ( ) ) . to . be . equal ( 2 ) ;
106+ expect ( callCount ( ) ) . to . be . equal ( reactMajor > 18 ? 3 : 2 ) ;
107107
108108 const lastIncreasingCall = lastCallWidth ( ) ;
109109 // Should be animating from 1000 to 2000
@@ -150,7 +150,7 @@ describe('useAnimate', () => {
150150 const { rerender } = render ( < TestComponent width = { 2000 } /> ) ;
151151
152152 await waitNextFrame ( ) ;
153- expect ( callCount ( ) ) . to . be . equal ( 2 ) ;
153+ expect ( callCount ( ) ) . to . be . equal ( reactMajor > 18 ? 3 : 2 ) ;
154154
155155 // Should be animating from 1000 to 2000
156156 expect ( lastCallWidth ( ) ) . to . be . greaterThan ( 1000 ) ;
@@ -159,7 +159,7 @@ describe('useAnimate', () => {
159159 rerender ( < TestComponent width = { 0 } skipAnimation /> ) ;
160160
161161 await waitNextFrame ( ) ;
162- expect ( callCount ( ) ) . to . be . equal ( 4 ) ;
162+ expect ( callCount ( ) ) . to . be . equal ( reactMajor > 18 ? 5 : 4 ) ;
163163
164164 // Should jump to 0 immediately after first call
165165 expect ( lastCallWidth ( ) ) . to . equal ( 0 ) ;
@@ -214,21 +214,21 @@ describe('useAnimate', () => {
214214 const { rerender } = render ( < TestComponent width = { 1000 } skip = { false } /> ) ;
215215
216216 await waitNextFrame ( ) ;
217- expect ( callCount ( ) ) . to . be . equal ( 2 ) ;
217+ expect ( callCount ( ) ) . to . be . equal ( reactMajor > 18 ? 3 : 2 ) ;
218218 expect ( lastCallWidth ( ) ) . to . be . greaterThan ( 0 ) ;
219219 expect ( lastCallWidth ( ) ) . to . be . lessThan ( 1000 ) ;
220220
221221 rerender ( < TestComponent width = { 2000 } skip /> ) ;
222222
223223 // Transition finishes immediately
224224 await waitNextFrame ( ) ;
225- expect ( callCount ( ) ) . to . be . equal ( 4 ) ;
225+ expect ( callCount ( ) ) . to . be . equal ( reactMajor > 18 ? 5 : 4 ) ;
226226 expect ( lastCallWidth ( ) ) . to . equal ( 2000 ) ;
227227
228228 rerender ( < TestComponent width = { 1000 } skip = { false } /> ) ;
229229
230230 await waitNextFrame ( ) ;
231- expect ( callCount ( ) ) . to . be . equal ( 6 ) ;
231+ expect ( callCount ( ) ) . to . be . equal ( reactMajor > 18 ? 7 : 6 ) ;
232232 expect ( lastCallWidth ( ) ) . to . be . lessThan ( 2000 ) ;
233233 expect ( lastCallWidth ( ) ) . to . be . greaterThan ( 1000 ) ;
234234 } ) ;
0 commit comments