Simon Egersand
2018-02-11 7c6792c135fbcd5f4140c1c6416a2ed14d74e610
Fix failing test by using shallow instead of mount

Found the solution here: https://github.com/airbnb/enzyme/issues/1253
2 files modified
10 ■■■■ changed files
test/testUtils.js 6 ●●●● patch | view | raw | blame | history
test/tests.spec.js 4 ●●●● patch | view | raw | blame | history
test/testUtils.js
@@ -1,5 +1,5 @@
import React from 'react'; // eslint-disable-line no-unused-vars
import { mount } from 'enzyme';
import { mount, shallow } from 'enzyme';
import Datetime from '../DateTime'; // eslint-disable-line no-unused-vars
const simulateClickOnElement = (element) => {
@@ -16,6 +16,10 @@
        return mount(<Datetime {...props} />);
    },
    createDatetimeShallow: (props) => {
        return shallow(<Datetime {...props} />);
    },
    /*
     * Click Simulations
     */
test/tests.spec.js
@@ -374,8 +374,8 @@
            expect(utils.isTimeView(component)).toBeTruthy();
        });
        xit('className -> type string', () => {
            const component = utils.createDatetime({ className: 'custom-class' });
        it('className -> type string', () => {
            const component = utils.createDatetimeShallow({ className: 'custom-class' });
            expect(component.find('.custom-class').length).toEqual(1);
        });