More Dashboard UX unit tests (#1603)

This commit is contained in:
Maxime Beauchemin
2016-11-17 10:05:08 -08:00
committed by GitHub
parent 4f7f437527
commit c362f2869e
6 changed files with 66 additions and 7 deletions

View File

@@ -0,0 +1,21 @@
import React from 'react';
import CssEditor from '../../../javascripts/dashboard/components/CssEditor';
import { mount } from 'enzyme';
import { describe, it } from 'mocha';
import { expect } from 'chai';
describe('CssEditor', () => {
const mockedProps = {
triggerNode: <i className="fa fa-edit" />,
};
it('is valid', () => {
expect(
React.isValidElement(<CssEditor {...mockedProps} />)
).to.equal(true);
});
it('renders the trigger node', () => {
const wrapper = mount(<CssEditor {...mockedProps} />);
expect(wrapper.find('.fa-edit')).to.have.length(1);
});
});