Adding column type label to dropdowns (#4566)

* Adding column type label to dropdowns

* Changing the style of column type label

* Adding tests for ColumnTypeLabel

* Adding tests for time and fixing if statement order

* Changing location of ColumnTypeLabel tests

* Updating ColumnTypeLabel structure
This commit is contained in:
michellethomas
2018-03-16 14:19:09 -07:00
committed by Chris Williams
parent 6875868cf6
commit 3f1dfb3173
9 changed files with 155 additions and 17 deletions

View File

@@ -4,6 +4,7 @@ import { describe, it } from 'mocha';
import { shallow } from 'enzyme';
import MetricOption from '../../../javascripts/components/MetricOption';
import ColumnTypeLabel from '../../../javascripts/components/ColumnTypeLabel';
import InfoTooltipWithTrigger from '../../../javascripts/components/InfoTooltipWithTrigger';
describe('MetricOption', () => {
@@ -15,6 +16,7 @@ describe('MetricOption', () => {
description: 'Foo is the greatest metric of all',
warning_text: 'Be careful when using foo',
},
showType: false,
};
let wrapper;
@@ -59,4 +61,9 @@ describe('MetricOption', () => {
wrapper = shallow(factory(props));
expect(wrapper.find('a').prop('target')).to.equal('_blank');
});
it('shows a metric type label when showType is true', () => {
props.showType = true;
wrapper = shallow(factory(props));
expect(wrapper.find(ColumnTypeLabel)).to.have.length(1);
});
});