Skip to content

Commit

Permalink
Fix failing test by using shallow instead of mount
Browse files Browse the repository at this point in the history
Found the solution here: enzymejs/enzyme#1253
  • Loading branch information
simeg committed Feb 11, 2018
1 parent 0fac4ac commit 7c6792c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion 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) => {
Expand All @@ -16,6 +16,10 @@ module.exports = {
return mount(<Datetime {...props} />);
},

createDatetimeShallow: (props) => {
return shallow(<Datetime {...props} />);
},

/*
* Click Simulations
*/
Expand Down
4 changes: 2 additions & 2 deletions test/tests.spec.js
Expand Up @@ -374,8 +374,8 @@ describe('Datetime', () => {
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);
});

Expand Down

0 comments on commit 7c6792c

Please sign in to comment.