You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2017/10/16 23:31:45 UTC
[incubator-superset] branch master updated: unit tests for
OptionDescription component (#3678)
This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 2a89c90 unit tests for OptionDescription component (#3678)
2a89c90 is described below
commit 2a89c90e0bfd74ad2bf88f7da080c58a02a9b33b
Author: Jeff Niu <je...@gmail.com>
AuthorDate: Mon Oct 16 16:31:43 2017 -0700
unit tests for OptionDescription component (#3678)
---
.../components/OptionDescription_spec.jsx | 32 ++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/superset/assets/spec/javascripts/components/OptionDescription_spec.jsx b/superset/assets/spec/javascripts/components/OptionDescription_spec.jsx
new file mode 100644
index 0000000..e9a6a9d
--- /dev/null
+++ b/superset/assets/spec/javascripts/components/OptionDescription_spec.jsx
@@ -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');
+ });
+});
--
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <co...@superset.apache.org>'].