fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

withViewport decorator does not respect viewport given as props to a decorated component

Open petdun2519 opened this issue 9 years ago • 2 comments

Priorities and help requested (not applicable if asking question):

Are you willing to submit a PR to fix? Yes

Requested priority: Normal

Products/sites affected: Testing

Describe the issue:

Right now if I am trying to write some component unit tests for a component that renders a details list, it is impossible to get the details list to render, because it is wrapped in a withViewport decorator which checks for viewport size before rendering the child component. In a test environment there is often no actual viewport. So I would expect that for testing purposes, I should be able to override this behavior by supplying my own viewport via props. In reality, the decorator just ignores these props and keeps on reading viewport size from window/another parent. I would expect the withViewport decorator to respect the overriden props, or at least have some option to turn off it's viewport check before rendering child component, so that a unit test can be written for these components

petdun2519 avatar Jul 17 '17 22:07 petdun2519

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Fabric React!

stale[bot] avatar Apr 11 '18 10:04 stale[bot]

This issue has been automatically closed because it has not had recent activity after being marked as stale. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to Fabric React! Why am I receiving this notification?

stale[bot] avatar May 18 '18 20:05 stale[bot]