Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('invalid type of expression in props.math', () => {
let $;
/* eslint-disable-next-line */
console.error = jest.fn();
$ = render();
expect(
$.queryByText(/KaTeX can only parse string typed expression/)
).not.toBeNull();
});
test("it should work with jsx instead of function as child", () => {
const container = render();
checkForwardsHandling(container);
});
test('App Component renders with toggle switch', () => {
const wrap = render()
expect(wrap.getByTestId('toggle-input')).toBeInTheDocument()
})
test('can cancel 100 callbacks by unmounting why not', (done) => {
__experimentSetTimeout = 'unchanged'
let t = testUtils.render()
let button = t.getByText('RunExperiment')
let i = 0
for (i = 0; i < 100; i++) {
testUtils.fireEvent.click(button)
}
setTimeout(() => {
t.unmount()
}, 100)
setTimeout(() => {
expect(__experimentSetTimeout).toBe('unchanged')
done()
}, 500)
})
})
test('NameProvider composes full name from first, last', () => {
const tree = (
{value => <span>Received: {value}</span>}
)
const {getByText} = render(tree)
expect(getByText(/^Received:/).textContent).toBe('Received: Boba Fett')
})
expect(() => void render()).toThrow(Error);
console.error = e;
button = wrapper.container.firstChild;
expect(button.textContent).toBe("0");
fireEvent.click(button);
expect(button.textContent).toBe("1");
mapDispatchToProps = {
dispatch: action => action,
nested: { add: type => dispatch({ type }) },
ingored: "hi"
};
ConnectedCMP = connectCompNoMapDispatch(
mapStateToProps,
mapDispatchToProps
);
wrapper = render(
);
button = wrapper.container.firstChild;
expect(button.textContent).toBe("0");
fireEvent.click(button);
expect(button.textContent).toBe("1");
mapDispatchToProps = dispatch => ({});
ConnectedCMP = connectCompNoMapDispatch(
mapStateToProps,
mapDispatchToProps
);
wrapper = render(
const renderWithRouter = (ui, renderOptions = {}, { pathname = "/" } = {}) => {
const history = createHistory(createMemorySource(pathname));
return render(
{ui},
renderOptions
);
};
test('expression via props.math', () => {
expect(render().container).toMatchSnapshot();
});
it('should render with Custom Theme', () => {
const checkbox = render(
({
checkbox: {
label: {
color: 'red',
},
},
})}
>
,
);
expect(checkbox).toMatchSnapshot();
});