@@ -218,6 +218,50 @@ describe('given the <Parallax> component', () => {
218218 expect ( controller . updateElementPropsById ) . toHaveBeenCalledTimes ( 2 ) ;
219219 } ) ;
220220
221+ it ( 'then it handles disabled prop updates' , ( ) => {
222+ const controller = ParallaxController . init ( {
223+ scrollAxis : ScrollAxis . vertical ,
224+ } ) ;
225+ controller . updateElementPropsById = jest . fn ( ) ;
226+ controller . resetElementStyles = jest . fn ( ) ;
227+
228+ function Wrapper ( props : PropsWithChildren < { } > ) {
229+ return (
230+ < MockProvider controllerMock = { controller } >
231+ { props . children }
232+ </ MockProvider >
233+ ) ;
234+ }
235+
236+ const { rerender } = render (
237+ < Parallax
238+ disabled = { false }
239+ translateX = { [ 100 , - 100 ] }
240+ translateY = { [ - 100 , 100 ] }
241+ /> ,
242+ {
243+ wrapper : Wrapper ,
244+ }
245+ ) ;
246+
247+ rerender (
248+ < Parallax
249+ disabled = { true }
250+ translateX = { [ 100 , - 100 ] }
251+ translateY = { [ - 100 , 100 ] }
252+ />
253+ ) ;
254+
255+ const element = controller . getElements ( ) [ 0 ] ;
256+
257+ expect ( controller . resetElementStyles ) . toBeCalledWith ( element ) ;
258+ expect ( controller . updateElementPropsById ) . toBeCalledWith ( element . id , {
259+ disabled : true ,
260+ translateX : [ 100 , - 100 ] ,
261+ translateY : [ - 100 , 100 ] ,
262+ } ) ;
263+ } ) ;
264+
221265 it ( 'then it resets styles on an element if the disabled prop is true' , ( ) => {
222266 const controller = ParallaxController . init ( {
223267 scrollAxis : ScrollAxis . vertical ,
0 commit comments