Files
superset2/superset/assets/spec/javascripts/explore/components/DatasourceControl_spec.jsx
Maxime Beauchemin 62fcdf2a92 [explore] DatasourceControl to pick datasource in modal (#3210)
* [explore] DatasourceControl to pick datasource in modal

Makes it easier to change datasource, also makes it such that the list
of all datasources doesn't need to be loaded upfront.

* Adding more metadata
2017-08-01 12:08:00 -07:00

33 lines
770 B
JavaScript

import React from 'react';
import sinon from 'sinon';
import { expect } from 'chai';
import { describe, it, beforeEach } from 'mocha';
import { shallow } from 'enzyme';
import { Modal } from 'react-bootstrap';
import DatasourceControl from '../../../../javascripts/explore/components/controls/DatasourceControl';
const defaultProps = {
name: 'datasource',
label: 'Datasource',
value: '1__table',
datasource: {
name: 'birth_names',
type: 'table',
uid: '1__table',
id: 1,
},
onChange: sinon.spy(),
};
describe('DatasourceControl', () => {
let wrapper;
beforeEach(() => {
wrapper = shallow(<DatasourceControl {...defaultProps} />);
});
it('renders a Modal', () => {
expect(wrapper.find(Modal)).to.have.lengthOf(1);
});
});