Files
superset2/superset/assets/spec/javascripts/explore/components/AdhocMetricStaticOption_spec.jsx
Chris Williams b453cd2bf2 [lint] turn no-undef back on, set browser, cypress, and mocha env's (#5879)
* [lint] turn no-undef back on, set browser, cypress, and mocha env's, and fix issues

* [lint] fix undefined var in TimeTable.jsx
2018-09-13 14:45:24 -07:00

22 lines
812 B
JavaScript

/* eslint-disable no-unused-expressions */
import React from 'react';
import { expect } from 'chai';
import { shallow } from 'enzyme';
import AdhocMetricStaticOption from '../../../../src/explore/components/AdhocMetricStaticOption';
import AdhocMetric, { EXPRESSION_TYPES } from '../../../../src/explore/AdhocMetric';
import { AGGREGATES } from '../../../../src/explore/constants';
const sumValueAdhocMetric = new AdhocMetric({
expressionType: EXPRESSION_TYPES.SIMPLE,
column: { type: 'VARCHAR(255)', column_name: 'source' },
aggregate: AGGREGATES.SUM,
});
describe('AdhocMetricStaticOption', () => {
it('renders the adhoc metrics label', () => {
const wrapper = shallow(<AdhocMetricStaticOption adhocMetric={sumValueAdhocMetric} />);
expect(wrapper.text()).to.equal('SUM(source)');
});
});