mirror of
https://github.com/apache/superset.git
synced 2026-04-07 18:35:15 +00:00
fix: shorten url with extra request parameters (#10693)
This commit is contained in:
@@ -59,12 +59,12 @@ describe('EmbedCodeButton', () => {
|
||||
wrapper.setState({
|
||||
height: '1000',
|
||||
width: '2000',
|
||||
shortUrl: 'http://localhostendpoint_url&height=1000',
|
||||
shortUrlId: 100,
|
||||
});
|
||||
|
||||
const trigger = wrapper.find(OverlayTrigger);
|
||||
trigger.simulate('click');
|
||||
expect(spy1.args[0][1]).toBe('standalone');
|
||||
expect(spy1.callCount).toBe(1);
|
||||
expect(spy2.callCount).toBe(1);
|
||||
|
||||
spy1.restore();
|
||||
@@ -72,11 +72,14 @@ describe('EmbedCodeButton', () => {
|
||||
});
|
||||
|
||||
it('returns correct embed code', () => {
|
||||
const stub = sinon
|
||||
.stub(exploreUtils, 'getURIDirectory')
|
||||
.callsFake(() => 'endpoint_url');
|
||||
const wrapper = mount(<EmbedCodeButton {...defaultProps} />);
|
||||
wrapper.setState({
|
||||
height: '1000',
|
||||
width: '2000',
|
||||
shortUrl: 'http://localhostendpoint_url&height=1000',
|
||||
shortUrlId: 100,
|
||||
});
|
||||
const embedHTML =
|
||||
'<iframe\n' +
|
||||
@@ -85,9 +88,10 @@ describe('EmbedCodeButton', () => {
|
||||
' seamless\n' +
|
||||
' frameBorder="0"\n' +
|
||||
' scrolling="no"\n' +
|
||||
' src="http://localhostendpoint_url&height=1000"\n' +
|
||||
' src="http://localhostendpoint_url?r=100&standalone=true&height=1000"\n' +
|
||||
'>\n' +
|
||||
'</iframe>';
|
||||
expect(wrapper.instance().generateEmbedHTML()).toBe(embedHTML);
|
||||
stub.restore();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user