Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Unwrap all wrapping and annoying HOCs
while (getWrapperName(result) !== target) {
const type = result.type();
if (typeof type === 'string') {
result = result.children();
} else if (
typeof type === 'object' ||
(typeof type === 'function' && type.name === 'TempConsumer') ||
(typeof type === 'function' && type.name === 'TempProvider')
) {
const child = result.prop('children');
if (typeof child === 'function') {
result = new Enzyme.ShallowWrapper((child as any)(context), result, { context });
if (options.exitOnContext) {
return result.shallow({ context });
}
} else {
result = result.shallow({ context });
}
} else {
result = result.shallow({ context });
}
}
// Unwrap one more time to drill into the rendered HTML (children) of the target
if (options.render) {
result = result.shallow({ context });
}
function test_constructor() {
let anyWrapper: ShallowWrapper;
anyWrapper = new ShallowWrapper();
shallowWrapper = new ShallowWrapper();
shallowWrapper = new ShallowWrapper([, ]);
shallowWrapper = new ShallowWrapper(, shallowWrapper);
shallowWrapper = new ShallowWrapper(, undefined, { lifecycleExperimental: true });
shallowWrapper = new ShallowWrapper(, shallowWrapper, { lifecycleExperimental: true });
}
function test_constructor() {
let anyWrapper: ShallowWrapper;
anyWrapper = new ShallowWrapper();
shallowWrapper = new ShallowWrapper();
shallowWrapper = new ShallowWrapper([, ]);
shallowWrapper = new ShallowWrapper(, shallowWrapper);
shallowWrapper = new ShallowWrapper(, undefined, { lifecycleExperimental: true });
shallowWrapper = new ShallowWrapper(, shallowWrapper, { lifecycleExperimental: true });
}
function test_constructor() {
let anyWrapper: ShallowWrapper;
anyWrapper = new ShallowWrapper();
shallowWrapper = new ShallowWrapper();
shallowWrapper = new ShallowWrapper([, ]);
shallowWrapper = new ShallowWrapper(, shallowWrapper);
shallowWrapper = new ShallowWrapper(, undefined, { lifecycleExperimental: true });
shallowWrapper = new ShallowWrapper(, shallowWrapper, { lifecycleExperimental: true });
}
function test_constructor() {
let anyWrapper: ShallowWrapper;
anyWrapper = new ShallowWrapper();
shallowWrapper = new ShallowWrapper();
shallowWrapper = new ShallowWrapper([, ]);
shallowWrapper = new ShallowWrapper(, shallowWrapper);
shallowWrapper = new ShallowWrapper(, undefined, { lifecycleExperimental: true });
shallowWrapper = new ShallowWrapper(, shallowWrapper, { lifecycleExperimental: true });
}
function test_constructor() {
let anyWrapper: ShallowWrapper;
anyWrapper = new ShallowWrapper();
shallowWrapper = new ShallowWrapper();
shallowWrapper = new ShallowWrapper([, ]);
shallowWrapper = new ShallowWrapper(, shallowWrapper);
shallowWrapper = new ShallowWrapper(, undefined, { lifecycleExperimental: true });
shallowWrapper = new ShallowWrapper(, shallowWrapper, { lifecycleExperimental: true });
}
function test_renderProp() {
let shallowWrapper = new ShallowWrapper( <div>} />);
shallowWrapper = shallowWrapper.renderProp('children')('test');
}
</div>
function getPopperChildren(wrapper) {
return new ShallowWrapper(
wrapper
.find(Popper)
.props()
.children({ popperProps: { style: {} }, restProps: {} }),
null,
);
}
shallow: (node, options) => new ShallowWrapper(node, null, {
...options,
adapter: new Adapter15()
}),
mount: (node, options) => new ReactWrapper(node, null, {