mirror of
https://github.com/apache/superset.git
synced 2026-04-16 22:55:52 +00:00
Bumping the JS libs to fix the build (#2616)
* bumping the js libs * New linting rules * More linting * More * Done linting * npm >=4.5.0 * Bumping node * Tweaking the build * Fixing the damn build * Fixing the apps
This commit is contained in:
committed by
GitHub
parent
a2b30f35fc
commit
366ecefbaa
@@ -0,0 +1,32 @@
|
||||
/* eslint-disable no-unused-expressions */
|
||||
import React from 'react';
|
||||
import { Checkbox } from 'react-bootstrap';
|
||||
import sinon from 'sinon';
|
||||
import { expect } from 'chai';
|
||||
import { describe, it, beforeEach } from 'mocha';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import CheckboxControl from '../../../../javascripts/explorev2/components/controls/CheckboxControl';
|
||||
|
||||
const defaultProps = {
|
||||
name: 'show_legend',
|
||||
onChange: sinon.spy(),
|
||||
};
|
||||
|
||||
describe('CheckboxControl', () => {
|
||||
let wrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<CheckboxControl {...defaultProps} />);
|
||||
});
|
||||
|
||||
it('renders a Checkbox', () => {
|
||||
expect(wrapper.find(Checkbox)).to.have.lengthOf(1);
|
||||
});
|
||||
|
||||
it('calls onChange when toggled', () => {
|
||||
const checkbox = wrapper.find(Checkbox);
|
||||
checkbox.simulate('change', { value: true });
|
||||
expect(defaultProps.onChange.calledWith(true)).to.be.true;
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user