Skip to content

Commit

Permalink
PWA-1774 Updated HTMLWidget snapshots for the GMD theme
Browse files Browse the repository at this point in the history
  • Loading branch information
fkloes committed Apr 10, 2019
1 parent 57b331c commit 133c6d4
Showing 1 changed file with 53 additions and 116 deletions.
169 changes: 53 additions & 116 deletions themes/theme-gmd/widgets/Html/__snapshots__/spec.jsx.snap
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<HtmlWidget /> Basic rendering should re-render when html updates 1`] = `
exports[`<HtmlWidget /> should render the widget 1`] = `
<Provider
store={
Object {
"clearActions": [Function],
"dispatch": [Function],
"getActions": [Function],
"getState": [Function],
"replaceReducer": [Function],
"subscribe": [Function],
Symbol(observable): [Function],
}
}
>
<Connect(Html)
navigate={[MockFunction]}
settings={
Object {
"defaultPadding": false,
Expand All @@ -31,42 +31,51 @@ exports[`<HtmlWidget /> Basic rendering should re-render when html updates 1`] =
}
>
<div
className="css-7v4dr8"
dangerouslySetInnerHTML={
Object {
"__html": "<h1>Hello World!</h1>",
}
}
style={Object {}}
/>
>
<HtmlSanitizer
className="css-7v4dr8"
decode={true}
processStyles={true}
settings={
Object {
"handleClick": [Function],
"html": "&lt;h1&gt;Hello World!&lt;/h1&gt;",
}
}
>
<div
className="css-7v4dr8"
dangerouslySetInnerHTML={
Object {
"__html": "<h1>Hello World!</h1>",
}
}
/>
</HtmlSanitizer>
</div>
</Html>
</Connect(Html)>
</Provider>
`;

exports[`<HtmlWidget /> Basic rendering should re-render when html updates 2`] = `
exports[`<HtmlWidget /> should render the widget with a padding 1`] = `
<Provider
settings={
Object {
"defaultPadding": false,
"html": "&lt;h1&gt;Hello User!&lt;/h1&gt;",
}
}
store={
Object {
"clearActions": [Function],
"dispatch": [Function],
"getActions": [Function],
"getState": [Function],
"replaceReducer": [Function],
"subscribe": [Function],
Symbol(observable): [Function],
}
}
>
<Connect(Html)
navigate={[MockFunction]}
settings={
Object {
"defaultPadding": false,
"defaultPadding": true,
"html": "&lt;h1&gt;Hello World!&lt;/h1&gt;",
}
}
Expand All @@ -75,111 +84,39 @@ exports[`<HtmlWidget /> Basic rendering should re-render when html updates 2`] =
navigate={[Function]}
settings={
Object {
"defaultPadding": false,
"defaultPadding": true,
"html": "&lt;h1&gt;Hello World!&lt;/h1&gt;",
}
}
>
<div
className="css-7v4dr8"
dangerouslySetInnerHTML={
style={
Object {
"__html": "<h1>Hello World!</h1>",
"padding": 16,
}
}
style={Object {}}
/>
</Html>
</Connect(Html)>
</Provider>
`;

exports[`<HtmlWidget /> Basic rendering should re-render when html updates 3`] = `
<Html
navigate={[MockFunction]}
settings={
Object {
"defaultPadding": true,
"html": "&lt;h1&gt;Hello World!&lt;/h1&gt;",
}
}
>
<div
className="css-7v4dr8"
dangerouslySetInnerHTML={
Object {
"__html": "<h1>Hello World!</h1>",
}
}
style={
Object {
"padding": 16,
}
}
/>
</Html>
`;

exports[`<HtmlWidget /> Basic rendering should render the HtmlWidget 1`] = `
<div
class="css-7v4dr8"
>
<h1>
Hello World!
</h1>
</div>
`;

exports[`<HtmlWidget /> Basic rendering should render the HtmlWidget with a padding 1`] = `
<div
class="css-7v4dr8"
style="padding: 16px;"
>
<h1>
Hello World!
</h1>
</div>
`;

exports[`<HtmlWidget /> strips out the script tags 1`] = `
<Provider
store={
Object {
"dispatch": [Function],
"getState": [Function],
"replaceReducer": [Function],
"subscribe": [Function],
Symbol(observable): [Function],
}
}
>
<Connect(Html)
navigate={[MockFunction]}
settings={
Object {
"defaultPadding": false,
"html": "&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt;var x = 42;&lt;/script&gt; &lt;p&gt;Foo Bar&lt;/p&gt; &lt;script&gt;var y = 23;&lt;/script&gt;",
}
}
>
<Html
navigate={[Function]}
settings={
Object {
"defaultPadding": false,
"html": "&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt;var x = 42;&lt;/script&gt; &lt;p&gt;Foo Bar&lt;/p&gt; &lt;script&gt;var y = 23;&lt;/script&gt;",
}
}
>
<div
className="css-7v4dr8"
dangerouslySetInnerHTML={
Object {
"__html": " <p>Foo Bar</p> ",
>
<HtmlSanitizer
className="css-7v4dr8"
decode={true}
processStyles={true}
settings={
Object {
"handleClick": [Function],
"html": "&lt;h1&gt;Hello World!&lt;/h1&gt;",
}
}
}
style={Object {}}
/>
>
<div
className="css-7v4dr8"
dangerouslySetInnerHTML={
Object {
"__html": "<h1>Hello World!</h1>",
}
}
/>
</HtmlSanitizer>
</div>
</Html>
</Connect(Html)>
</Provider>
Expand Down

0 comments on commit 133c6d4

Please sign in to comment.