diff --git a/src/AutoSizer.test.tsx b/src/AutoSizer.test.tsx index e4e9d2c..0250216 100644 --- a/src/AutoSizer.test.tsx +++ b/src/AutoSizer.test.tsx @@ -88,6 +88,7 @@ describe("AutoSizer", () => { paddingRight = 0, paddingTop = 0, width = 200, + excludeWrapperStyling = false, } = {}, props: Omit = {} ) { @@ -110,7 +111,7 @@ describe("AutoSizer", () => { const root = createRoot(container); act(() => { root.render( -
+
{ expect(container.textContent).toContain("width:200"); }); + it("should not render children for elements with empty computed styles", () => { + mockOffsetSize(0, 0); + + renderHelper({ + excludeWrapperStyling: true, + height: 0, + width: 0, + }); + + expect(container.textContent).toEqual(""); + }); + it("should account for padding when calculating the available width and height", () => { renderHelper({ paddingBottom: 10,