mirror of
https://github.com/apache/superset.git
synced 2024-09-12 16:49:40 -04:00
unit tests for OptionDescription component (#3678)
This commit is contained in:
parent
ce5fa379ec
commit
2a89c90e0b
@ -0,0 +1,32 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { shallow } from 'enzyme';
|
||||||
|
import { describe, it } from 'mocha';
|
||||||
|
import { expect } from 'chai';
|
||||||
|
|
||||||
|
import InfoTooltipWithTrigger from '../../../javascripts/components/InfoTooltipWithTrigger';
|
||||||
|
import OptionDescription from '../../../javascripts/components/OptionDescription';
|
||||||
|
|
||||||
|
const defaultProps = {
|
||||||
|
option: {
|
||||||
|
label: 'Some option',
|
||||||
|
description: 'Description for some option',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
describe('OptionDescription', () => {
|
||||||
|
let wrapper;
|
||||||
|
let props;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
props = { option: Object.assign({}, defaultProps.option) };
|
||||||
|
wrapper = shallow(<OptionDescription {...props} />);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders an InfoTooltipWithTrigger', () => {
|
||||||
|
expect(wrapper.find(InfoTooltipWithTrigger)).to.have.lengthOf(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders a span with the label', () => {
|
||||||
|
expect(wrapper.find('.option-label').text()).to.equal('Some option');
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user