diff --git a/src/components/dialog-full-screen/dialog-full-screen.component.js b/src/components/dialog-full-screen/dialog-full-screen.component.js index 71fd9bce7b..41196e9a32 100644 --- a/src/components/dialog-full-screen/dialog-full-screen.component.js +++ b/src/components/dialog-full-screen/dialog-full-screen.component.js @@ -23,11 +23,10 @@ const DialogFullScreen = ({ disableContentPadding, disableEscKey, onCancel, + contentRef, ...rest }) => { const dialogRef = useRef(); - const headingRef = useRef(); - const contentRef = useRef(); const closeIcon = () => { if (!showCloseIcon || !onCancel) return null; @@ -44,7 +43,7 @@ const DialogFullScreen = ({ }; const dialogTitle = () => ( - + {typeof title === "string" ? ( { ); }); + describe("contentRef", () => { + it("the content ref should be forwarded", () => { + let mockRef; + + const WrapperComponent = () => { + mockRef = useRef(); + + return ( + + + + + ); + }; + + wrapper = mount(); + + expect(mockRef.current).toBe(wrapper.find(StyledContent).getDOMNode()); + }); + }); + describe("autoFocus", () => { it("should focus the first element by default", () => { mount(