Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint-disable react/jsx-filename-extension */
import expect from 'expect.js';
import Enzyme, { mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import React from 'react';
import assign from 'object-assign';
import Steps from '../src';
Enzyme.configure({ adapter: new Adapter() });
const generateSteps = (options = {}) => {
const opts = assign({}, {
current: 1,
direction: '',
showIcon: true,
type: 'default', // default title-on-top or long-desc
}, options || {});
const items = ['hello', 'hi', 'wola'].map((i) => {
if (i === 'wola') {
return ;
}
return ;
});
const wrapper = mount(
// Note: This file is only necessary for the tests that use `@jest-environment node` (the SSR tests)
import Enzyme from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
Enzyme.configure({ adapter: new Adapter() })
import Enzyme from "enzyme";
import Adapter from "enzyme-adapter-react-16";
import sizeMe from "react-sizeme";
// import fetch from "jest-fetch-mock";
import "core-js/stable";
import "regenerator-runtime/runtime";
Enzyme.configure({ adapter: new Adapter() });
sizeMe.noPlaceholders = true;
// global.fetch = fetch;
localStorage.clear();
import React from 'react';
import Enzyme, { shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { createFakeMapInstance } from '../../test/mockGoogleMaps';
import { Redo } from '../Redo';
Enzyme.configure({ adapter: new Adapter() });
describe('Redo', () => {
const defaultProps = {
googleMapsInstance: createFakeMapInstance(),
translate: x => x,
hasMapMoveSinceLastRefine: false,
refineWithInstance: () => {},
};
it('expect to render correctly', () => {
const props = {
...defaultProps,
};
const wrapper = shallow();
import React from 'react';
import Enzyme, { mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import Input from 'input';
Enzyme.configure({ adapter: new Adapter() });
describe('Input', () => {
beforeAll(() => {
window.getSelection = function() {
return 'autoSelect';
};
});
it('will render div wrapper contains an input without any props', () => {
const wrapper = mount(<input>);
expect(wrapper.childAt(0).type()).toBe('div');
expect(wrapper.childAt(0).hasClass('zent-input-wrapper')).toBe(true);
expect(wrapper.find('div input').length).toBe(1);
expect(wrapper.find('span').exists()).toBe(false);
});
import { JSDOM } from 'jsdom';
import chai from 'chai';
import sinonChai from 'sinon-chai';
import chaiEnzyme from 'chai-enzyme';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
chai.use(chaiEnzyme());
chai.use(sinonChai);
global.window = new JSDOM('').window;
global.document = global.window.document;
Enzyme.configure({ adapter: new Adapter() });
import React from 'react';
import Enzyme, { shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { map } from 'ramda';
import { notifyActions, soundActions } from 'actions/';
import { SoundEdit } from 'components/';
import { newSoundObj } from 'utils/';
import { getData, createComponentWithIntl, mockEvent } from '../helper';
Enzyme.configure({ adapter: new Adapter() });
function setup(props = {}) {
const propData = {
...getData('themes'),
soundActions: {},
...props,
};
const comp = ;
return {
props,
wrapper: shallow(comp),
tree: createComponentWithIntl(comp).toJSON(),
};
}
const soundProp = (props = {}) => {
import React from 'react'
import Enzyme, {shallow} from 'enzyme'
import Adapter from 'enzyme-adapter-react-15'
Enzyme.configure({adapter: new Adapter()})
import ErrorWrapper from './ErrorWrapper'
import Error from './Error'
describe('ErrorWrapper', function() {
it('wrapper', function() {
const wrapper = shallow(
foo
)
expect(wrapper.childAt(0).find(Error)).to.be.present()
expect(wrapper.childAt(1)).to.have.text('foo')
expect(wrapper.childAt(2).find(Error)).to.be.present()
})
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
Enzyme.configure({ adapter: new Adapter() });