Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('sets `inProgress` to true before resolving promise', (done) => {
let wrapper = shallow();
const promise = new Promise((resolve) => {
// expect(wrapper.text()).toEqual('Loading...');
resolve(42);
expect(wrapper.find('button').exists()).toBe(true);
done();
});
wrapper = wrapper.setProps({ promise });
wrapper.find('button').simulate('click');
});
});
it(`does not add any className when ${bool}`, () => {
consoleUtil.disableOnce()
const wrapper = shallow(React.createElement(Component, { ...requiredProps, [propKey]: bool }))
wrapper.should.not.have.className(className)
wrapper.should.not.have.className('true')
wrapper.should.not.have.className('false')
propValues.forEach(propVal => wrapper.should.not.have.className(propVal.toString()))
}),
)
test('wrapperClassName', () => {
const component = shallow(render())
expect(component.prop('className')).toBe('paragraph paragraph--xtight')
})
it('should be a Collapse', () => {
const collapse = shallow(Yo!);
expect(collapse.type()).toBe(Collapse);
});
describe("tags on component", () => {
let wrapper = shallow();
it('include correct component, element and role data tags', () => {
rootTagTest(wrapper, 'settings-row', 'bar', 'baz');
});
});
});
beforeEach(() => {
props = createTestProps({
columns: [{ key: '1', isFixed: true }, { key: '2' }],
});
wrapper = shallow();
gridWrapper = shallow(
wrapper.find(ClassNames).prop('children')({
css: jest.fn(),
cx: jest.fn(),
})
);
});
it('should not pass fixedColumnCount prop to ', () => {
it('should render with common props without exploding', () => {
const wrapper = shallow();
expect(wrapper).to.have.length(1);
expect(wrapper.props().randomProp).to.be.equal('foo');
});
it('should render nothing when tier prices are not available (field missing)', () => {
const price = { currency: 'USD' };
const wrapper = shallow();
expect(wrapper).toBeEmptyRender();
});
});
function makeEventBox(
events: protos.cockroach.server.serverpb.EventsResponse.IEvent[],
refreshEventsFn: typeof refreshEvents,
) {
return shallow(
,
);
}