mirror of
https://github.com/apache/superset.git
synced 2026-04-22 09:35:23 +00:00
[explore] Improved time filters controls (#3371)
* Improved time filters controls * lint * Fix coverage * Allow empty dates
This commit is contained in:
committed by
GitHub
parent
aff7a82664
commit
a47a512808
@@ -0,0 +1,34 @@
|
||||
import React from 'react';
|
||||
import { expect } from 'chai';
|
||||
import { describe, it } from 'mocha';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import PopoverSection from '../../../javascripts/components/PopoverSection';
|
||||
|
||||
describe('PopoverSection', () => {
|
||||
const defaultProps = {
|
||||
title: 'Section Title',
|
||||
isSelected: true,
|
||||
onSelect: () => {},
|
||||
info: 'info section',
|
||||
children: <div />,
|
||||
};
|
||||
|
||||
let wrapper;
|
||||
const factory = (overrideProps) => {
|
||||
const props = Object.assign({}, defaultProps, overrideProps || {});
|
||||
return shallow(<PopoverSection {...props} />);
|
||||
};
|
||||
beforeEach(() => {
|
||||
wrapper = factory();
|
||||
});
|
||||
it('renders', () => {
|
||||
expect(React.isValidElement(<PopoverSection {...defaultProps} />)).to.equal(true);
|
||||
});
|
||||
it('is show an icon when selected', () => {
|
||||
expect(wrapper.find('.fa-check')).to.have.length(1);
|
||||
});
|
||||
it('is show no icon when not selected', () => {
|
||||
expect(factory({ isSelected: false }).find('.fa-check')).to.have.length(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user