File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -110,15 +110,22 @@ it("should render with custom defaults", async () => {
110
110
assertSize ( { width : 24 , height : 42 } ) ;
111
111
} ) ;
112
112
113
- it ( "should follow size changes correctly without subpixels as they're used in CSS" , async ( ) => {
114
- const { setSize, assertSize } = await render ( Observed ) ;
113
+ it ( "should follow size changes correctly with appropriate render count and without sub-pixels as they're used in CSS" , async ( ) => {
114
+ const { setSize, assertSize, assertRenderCount } = await render ( Observed ) ;
115
+
116
+ // Default render
117
+ assertRenderCount ( 1 ) ;
115
118
116
119
setSize ( { width : 100 , height : 200 } ) ;
117
120
await delay ( 50 ) ;
121
+ // One render for setting the CSS, and another for the hook to react
122
+ assertRenderCount ( 3 ) ;
118
123
assertSize ( { width : 100 , height : 200 } ) ;
119
124
120
125
setSize ( { width : 321 , height : 456 } ) ;
121
126
await delay ( 50 ) ;
127
+ // One render for setting the CSS, and another for the hook to react
128
+ assertRenderCount ( 5 ) ;
122
129
assertSize ( { width : 321 , height : 456 } ) ;
123
130
} ) ;
124
131
You can’t perform that action at this time.
0 commit comments