mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-17 14:30:34 +08:00
fix(blocksBasic): Html test change to new RenderHtml.
This commit is contained in:
parent
9351255d3a
commit
e43617a47a
@ -18,7 +18,13 @@ import React from 'react';
|
||||
import { blockDefaultProps, RenderHtml } from '@lowdefy/block-tools';
|
||||
|
||||
const HtmlBlock = ({ blockId, properties, methods }) => (
|
||||
<RenderHtml id={blockId} html={properties.html} methods={methods} style={properties.style} />
|
||||
<RenderHtml
|
||||
div={true}
|
||||
html={properties.html}
|
||||
id={blockId}
|
||||
methods={methods}
|
||||
style={properties.style}
|
||||
/>
|
||||
);
|
||||
|
||||
HtmlBlock.defaultProps = blockDefaultProps;
|
||||
|
@ -57,11 +57,11 @@ test('update on properties.html change', () => {
|
||||
);
|
||||
const wrapper = mount(<Shell properties={config.properties} />);
|
||||
expect(wrapper.html()).toMatchInlineSnapshot(
|
||||
`"<div id=\\"update\\" data-testid=\\"update\\" class=\\"{"style":[{"display":"inline-block"},null]}\\"><div>one</div></div>"`
|
||||
`"<div id=\\"update\\" data-testid=\\"update\\" class=\\"{}\\"><div>one</div></div>"`
|
||||
);
|
||||
wrapper.setProps({ properties: { html: '<div>two</div>' } });
|
||||
wrapper.update();
|
||||
expect(wrapper.html()).toMatchInlineSnapshot(
|
||||
`"<div id=\\"update\\" data-testid=\\"update\\" class=\\"{"style":[{"display":"inline-block"},null]}\\"><div>two</div></div>"`
|
||||
`"<div id=\\"update\\" data-testid=\\"update\\" class=\\"{}\\"><div>two</div></div>"`
|
||||
);
|
||||
});
|
||||
|
@ -1,16 +1,10 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Render default - value[0] 1`] = `
|
||||
<div
|
||||
className="{\\"style\\":[{\\"display\\":\\"inline-block\\"},null]}"
|
||||
data-testid="default"
|
||||
id="default"
|
||||
/>
|
||||
`;
|
||||
exports[`Render default - value[0] 1`] = `""`;
|
||||
|
||||
exports[`Render properties.html - value[0] 1`] = `
|
||||
<div
|
||||
className="{\\"style\\":[{\\"display\\":\\"inline-block\\"},null]}"
|
||||
className="{}"
|
||||
data-testid="properties.html"
|
||||
id="properties.html"
|
||||
/>
|
||||
@ -18,7 +12,7 @@ exports[`Render properties.html - value[0] 1`] = `
|
||||
|
||||
exports[`Render properties.html-bad-code - value[0] 1`] = `
|
||||
<div
|
||||
className="{\\"style\\":[{\\"display\\":\\"inline-block\\"},null]}"
|
||||
className="{}"
|
||||
data-testid="properties.html-bad-code"
|
||||
id="properties.html-bad-code"
|
||||
/>
|
||||
@ -26,7 +20,7 @@ exports[`Render properties.html-bad-code - value[0] 1`] = `
|
||||
|
||||
exports[`Render properties.html-iframe - value[0] 1`] = `
|
||||
<div
|
||||
className="{\\"style\\":[{\\"display\\":\\"inline-block\\"},null]}"
|
||||
className="{}"
|
||||
data-testid="properties.html-iframe"
|
||||
id="properties.html-iframe"
|
||||
/>
|
||||
@ -34,7 +28,7 @@ exports[`Render properties.html-iframe - value[0] 1`] = `
|
||||
|
||||
exports[`Render properties.html-styled - value[0] 1`] = `
|
||||
<div
|
||||
className="{\\"style\\":[{\\"display\\":\\"inline-block\\"},{\\"background\\":\\"yellow\\",\\"padding\\":10}]}"
|
||||
className="{\\"style\\":{\\"background\\":\\"yellow\\",\\"padding\\":10}}"
|
||||
data-testid="properties.html-styled"
|
||||
id="properties.html-styled"
|
||||
/>
|
||||
@ -42,7 +36,7 @@ exports[`Render properties.html-styled - value[0] 1`] = `
|
||||
|
||||
exports[`Render properties.style - value[0] 1`] = `
|
||||
<div
|
||||
className="{\\"style\\":[{\\"display\\":\\"inline-block\\"},{\\"background\\":\\"yellow\\",\\"padding\\":10}]}"
|
||||
className="{\\"style\\":{\\"background\\":\\"yellow\\",\\"padding\\":10}}"
|
||||
data-testid="properties.style"
|
||||
id="properties.style"
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user