feat: one-click copy chart and dashboard URL (#13037)

Closes #10328
This commit is contained in:
Michael S. Molina
2021-02-17 19:14:08 -03:00
committed by GitHub
parent 91db008d72
commit ad4ca2223e
22 changed files with 422 additions and 344 deletions

View File

@@ -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();
});
});