Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('Should exist as a React Component', () => {
const button1 = shallow(<button>
Button
</button>)
assert.ok(ReactTestUtils.isCompositeComponent(button1, Button))
// TODO the rest of components
})
})
it('exists in the page', function () {
expect(T.isCompositeComponent(el)).toBe(true)
})
it('shouldComponentUpdate', () => {
const component = TestUtils.renderIntoDocument();
expect(TestUtils.isCompositeComponent(component)).toBe(true);
expect(component.shouldComponentUpdate({date: new Date()})).toBe(false);
expect(component.shouldComponentUpdate({selected: true})).toBe(true);
expect(component.shouldComponentUpdate({disabled: true})).toBe(true);
});
it('exists in the page', function () {
expect(T.isCompositeComponent(el)).toBe(true)
})
it('exists in the page', function () {
expect(T.isCompositeComponent(el)).toBe(true)
})
it('dom', () => {
component = TestUtils.renderIntoDocument(
);
expect(TestUtils.isCompositeComponent(component)).toBe(true);
const weekheader = TestUtils.findRenderedDOMComponentWithClass(component, 'ui-calendar-month-weekheader');
expect(weekheader.childNodes.length).toBe(7);
const main = TestUtils.findRenderedDOMComponentWithTag(component, 'ul');
expect(main.childNodes.length).toBe(6);
const days = TestUtils.scryRenderedComponentsWithType(component, CalendarDay);
expect(days.length).toBe(42);
const daysInMonth = days.reduce((result, day) => {
let variants = day.props.variants;
if (variants) {
result[variants === 'next-month' ? 'next' : 'pre'].push(day);
it('onDateChange', done => {
const date = new Date(2014, 5, 12);
const panel = TestUtils.findRenderedComponentWithType(calendar, CalendarPanel);
expect(TestUtils.isCompositeComponent(panel)).toBe(true);
panel.onDateChange({date});
then(() => {
expect(calendar.state.date.getDate()).toBe(12);
expect(calendar.state.date.getMonth()).toBe(5);
expect(calendar.state.date.getFullYear()).toBe(2014);
done();
});
});
it('exists in the page', function () {
expect(T.isCompositeComponent(el)).toBe(true)
})
it('is a component', () => {
expect(isCompositeComponent(cmp)).to.be.true;
});
it('has a __node', () => {
export default function react2tree(app, name = 'tree') {
const tree = {
name,
children: []
};
if (!isCompositeComponent(app)) {
return tree;
}
/*eslint-disable*/
traverse(app, tree);
/*eslint-enable*/
function traverse(c, node) {
if (!c || isDOMComponent(c)) {
return;
}
const newNodeName = typeof c === 'function' ? c.name : c.constructor.name;
node.children.push({
name: newNodeName,