superset/superset-frontend/plugins/legacy-plugin-chart-partition/test/OptionDescription.test.jsx

49 lines
1.5 KiB
React
Raw Normal View History

feat(legacy-plugin-chart-partition): add control panel (#470) * PR to merge packges for controls migration * fix: add bootstrap * fix: change tooltip to tsx * fix: types * fix: tsx error * appease linter, enhance a11y * chore(release): publish v0.13.6 * chore(release): publish v0.13.7 * Revert "chore(release): publish v0.13.7" This reverts commit 3c9ce9ed4c46f9a52fd78bd9b43732803e93c0ac. * Revert "chore(release): publish v0.13.6" This reverts commit 0e6e829beba0df62a717601b20fdd790ebf49714. * chore(release): publish v0.13.7 * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit 48bf14b49a7fd7bb579b057c85b013edd278dbd8. * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit a96936a350b3e10224e8858c208247118d360200. * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit bfcffe01cbe21d385e79820b1440339bbefaeed3. * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit 3ee33577bc3de11efefec07b05ebc052900f0266. * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit aa362fd80e1b238a429e7f32e8520ede64532250. * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit a1468c3e6760357f7f4573ce868342b6107a190d. * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit 2af55a45b2a3fffa15aa61759f5eb510737a6dc7. * Revert "chore(release): publish v0.13.7" This reverts commit 20e46d49ada03ec25d9802503cbe57099d4ecf96. * first stages change for charts * addressing PR feedback * tweaking bootstrap types * fix test * test enter key * moar tests * code > key * ugh fine * chore: more refactor * push change yarn diffs * Update plugins/legacy-plugin-chart-partition/src/OptionDescription.jsx Co-authored-by: Evan Rusackas <evan@preset.io> * Update OptionDescription.jsx * lint :sparkles: * fix suggestions * Delete optionDescirption.test.jsx * fix: add controller to package * mr fix Co-authored-by: Phillip Kelley-Dotson <pkd@pkd.lan> Co-authored-by: David Aaron Suddjian <aasuddjian@gmail.com> Co-authored-by: Evan Rusackas <evan@preset.io>
2020-05-12 17:05:10 -04:00
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import { shallow } from 'enzyme';
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
feat(legacy-plugin-chart-partition): add control panel (#470) * PR to merge packges for controls migration * fix: add bootstrap * fix: change tooltip to tsx * fix: types * fix: tsx error * appease linter, enhance a11y * chore(release): publish v0.13.6 * chore(release): publish v0.13.7 * Revert "chore(release): publish v0.13.7" This reverts commit 3c9ce9ed4c46f9a52fd78bd9b43732803e93c0ac. * Revert "chore(release): publish v0.13.6" This reverts commit 0e6e829beba0df62a717601b20fdd790ebf49714. * chore(release): publish v0.13.7 * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit 48bf14b49a7fd7bb579b057c85b013edd278dbd8. * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit a96936a350b3e10224e8858c208247118d360200. * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit bfcffe01cbe21d385e79820b1440339bbefaeed3. * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit 3ee33577bc3de11efefec07b05ebc052900f0266. * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit aa362fd80e1b238a429e7f32e8520ede64532250. * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit a1468c3e6760357f7f4573ce868342b6107a190d. * chore(release): publish v0.13.8 * Revert "chore(release): publish v0.13.8" This reverts commit 2af55a45b2a3fffa15aa61759f5eb510737a6dc7. * Revert "chore(release): publish v0.13.7" This reverts commit 20e46d49ada03ec25d9802503cbe57099d4ecf96. * first stages change for charts * addressing PR feedback * tweaking bootstrap types * fix test * test enter key * moar tests * code > key * ugh fine * chore: more refactor * push change yarn diffs * Update plugins/legacy-plugin-chart-partition/src/OptionDescription.jsx Co-authored-by: Evan Rusackas <evan@preset.io> * Update OptionDescription.jsx * lint :sparkles: * fix suggestions * Delete optionDescirption.test.jsx * fix: add controller to package * mr fix Co-authored-by: Phillip Kelley-Dotson <pkd@pkd.lan> Co-authored-by: David Aaron Suddjian <aasuddjian@gmail.com> Co-authored-by: Evan Rusackas <evan@preset.io>
2020-05-12 17:05:10 -04:00
import OptionDescription from '../src/OptionDescription';
const defaultProps = {
option: {
label: 'Some option',
description: 'Description for some option',
},
};
describe('OptionDescription', () => {
let wrapper;
let props;
beforeEach(() => {
props = { option: { ...defaultProps.option } };
wrapper = shallow(<OptionDescription {...props} />);
});
it('renders an InfoTooltipWithTrigger', () => {
expect(wrapper.find(InfoTooltipWithTrigger)).toHaveLength(1);
});
it('renders a span with the label', () => {
expect(wrapper.find('.option-label').text()).toBe('Some option');
});
});