mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
committed by
GitHub
parent
91db008d72
commit
ad4ca2223e
@@ -86,8 +86,12 @@ describe('EmbedCodeButton', () => {
|
||||
const stub = sinon
|
||||
.stub(exploreUtils, 'getURIDirectory')
|
||||
.callsFake(() => 'endpoint_url');
|
||||
const wrapper = mount(<EmbedCodeButton {...defaultProps} />);
|
||||
wrapper.setState({
|
||||
const wrapper = mount(
|
||||
<ThemeProvider theme={supersetTheme}>
|
||||
<EmbedCodeButton {...defaultProps} />
|
||||
</ThemeProvider>,
|
||||
);
|
||||
wrapper.find(EmbedCodeButton).setState({
|
||||
height: '1000',
|
||||
width: '2000',
|
||||
shortUrlId: 100,
|
||||
@@ -104,7 +108,9 @@ describe('EmbedCodeButton', () => {
|
||||
}${DashboardStandaloneMode.HIDE_NAV}&height=1000"\n` +
|
||||
`>\n` +
|
||||
`</iframe>`;
|
||||
expect(wrapper.instance().generateEmbedHTML()).toBe(embedHTML);
|
||||
expect(wrapper.find(EmbedCodeButton).instance().generateEmbedHTML()).toBe(
|
||||
embedHTML,
|
||||
);
|
||||
stub.restore();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { mockStore } from 'spec/fixtures/mockStore';
|
||||
import ExploreActionButtons from 'src/explore/components/ExploreActionButtons';
|
||||
|
||||
describe('ExploreActionButtons', () => {
|
||||
@@ -35,8 +36,10 @@ describe('ExploreActionButtons', () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('should render 5 children/buttons', () => {
|
||||
const wrapper = shallow(<ExploreActionButtons {...defaultProps} />);
|
||||
expect(wrapper.children()).toHaveLength(5);
|
||||
it('should render 6 children/buttons', () => {
|
||||
const wrapper = shallow(
|
||||
<ExploreActionButtons {...defaultProps} store={mockStore} />,
|
||||
);
|
||||
expect(wrapper.dive().children()).toHaveLength(6);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user