mirror of
https://github.com/apache/superset.git
synced 2026-04-09 11:25:23 +00:00
Prettify the frontend code (#8648)
* Add Prettier global configs * Format js/jsx/ts/tsx/less files
This commit is contained in:
@@ -30,7 +30,9 @@ describe('EmbedCodeButton', () => {
|
||||
};
|
||||
|
||||
it('renders', () => {
|
||||
expect(React.isValidElement(<EmbedCodeButton {...defaultProps} />)).toBe(true);
|
||||
expect(React.isValidElement(<EmbedCodeButton {...defaultProps} />)).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it('renders overlay trigger', () => {
|
||||
@@ -39,13 +41,15 @@ describe('EmbedCodeButton', () => {
|
||||
});
|
||||
|
||||
it('returns correct embed code', () => {
|
||||
const stub = sinon.stub(exploreUtils, 'getExploreLongUrl').callsFake(() => ('endpoint_url'));
|
||||
const stub = sinon
|
||||
.stub(exploreUtils, 'getExploreLongUrl')
|
||||
.callsFake(() => 'endpoint_url');
|
||||
const wrapper = mount(<EmbedCodeButton {...defaultProps} />);
|
||||
wrapper.setState({
|
||||
height: '1000',
|
||||
width: '2000',
|
||||
});
|
||||
const embedHTML = (
|
||||
const embedHTML =
|
||||
'<iframe\n' +
|
||||
' width="2000"\n' +
|
||||
' height="1000"\n' +
|
||||
@@ -54,8 +58,7 @@ describe('EmbedCodeButton', () => {
|
||||
' scrolling="no"\n' +
|
||||
' src="http://localhostendpoint_url&height=1000"\n' +
|
||||
'>\n' +
|
||||
'</iframe>'
|
||||
);
|
||||
'</iframe>';
|
||||
expect(wrapper.instance().generateEmbedHTML()).toBe(embedHTML);
|
||||
stub.restore();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user