本文整理汇总了TypeScript中react-dom/test-utils.renderIntoDocument函数的典型用法代码示例。如果您正苦于以下问题:TypeScript renderIntoDocument函数的具体用法?TypeScript renderIntoDocument怎么用?TypeScript renderIntoDocument使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了renderIntoDocument函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: beforeEach
beforeEach(() => {
// @NOTE: set state of sidebarListWrapper in each test case
// might trigger component lifecycle function
sidebarListWrapper = ReactTestUtils.renderIntoDocument(
React.createElement(SidebarListWrapper, {
records: _records,
shouldTagDiffs: false,
openSource: () => { }
})
)
})
示例2: beforeEach
beforeEach(() => {
sidebarRootWrapper = ReactTestUtils.renderIntoDocument(
React.createElement(SidebarRootWrapper, {
records: _records,
shouldTagDiffs: false,
openSource: _openSource
})
)
sidebarFilter = ReactTestUtils.findRenderedComponentWithType(
sidebarRootWrapper,
SidebarFilter
)
sidebarList = ReactTestUtils.findRenderedComponentWithType(
sidebarRootWrapper,
SidebarList
)
})
示例3: it
it('scryRenderedDOMComponentsWithClass', () => {
const component = ReactTestUtils.renderIntoDocument(React.createElement(TestComponent));
ReactTestUtils.scryRenderedDOMComponentsWithClass(component, 'class');
});
示例4: it
it('isCompositeComponent', () => {
const element = React.createElement(TestComponent);
const instance: TestComponent = ReactTestUtils.renderIntoDocument(element);
const isCompositeComponent: boolean = ReactTestUtils.isCompositeComponent(instance);
});