Skip to content

Commit

Permalink
Fix snapshot tests (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
czgu authored Dec 3, 2020
1 parent 31a0af3 commit e1f0855
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 321 deletions.
38 changes: 4 additions & 34 deletions datahub/webapp/__tests__/ui/__snapshots__/Box.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,46 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`matches enzyme snapshots matches snapshot 1`] = `
<StyledComponent
forwardedComponent={
Object {
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [
Object {
"className": "Box",
},
],
"componentStyle": ComponentStyle {
"componentId": "sc-bdVaJa",
"isStatic": true,
"rules": Array [
"
background-color: var(--bg-color);
box-shadow: var(--box-shadow);
padding: 18px;
border-radius: var(--border-radius);
",
],
},
"displayName": "styled.div",
"foldedComponentIds": Array [],
"render": [Function],
"styledComponentId": "sc-bdVaJa",
"target": "div",
"toString": [Function],
"warnTooManyClasses": [Function],
"withComponent": [Function],
}
}
forwardedRef={null}
<div
className="sc-bdfBwQ bciwx Box"
>
Test
</StyledComponent>
</div>
`;

exports[`matches test renderer snapshot serializes the styles 1`] = `
<div
className="sc-bdVaJa Box cBKBJg"
className="sc-bdfBwQ bciwx Box"
>
Test
</div>
Expand Down
4 changes: 2 additions & 2 deletions datahub/webapp/__tests__/ui/__snapshots__/Center.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ exports[`matches enzyme snapshots matches snapshot 1`] = `

exports[`matches test renderer snapshot serializes the styles 1`] = `
<div
className="sc-bdVaJa hujqdG"
className="sc-bdfBwQ itbNMb"
>
<div
className="sc-bwzfXH hhQBEM"
className="sc-gsTCUz fMCZYS"
>
Test
</div>
Expand Down
49 changes: 6 additions & 43 deletions datahub/webapp/__tests__/ui/__snapshots__/Column.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,66 +1,29 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`matches enzyme snapshots matches snapshot 1`] = `
<StyledComponent
forwardedComponent={
Object {
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [
Object {
"className": "Columns",
},
],
"componentStyle": ComponentStyle {
"componentId": "sc-bdVaJa",
"isStatic": true,
"rules": Array [
"
display: flex;
margin-left: -12px;
margin-right: -12px;
margin-top: -8px;
.columns:last-child {
margin-bottom: -8px;
}
.columns:not(:last-child) {
margin-bottom: 8px;
}
",
],
},
"displayName": "styled.div",
"foldedComponentIds": Array [],
"render": [Function],
"styledComponentId": "sc-bdVaJa",
"target": "div",
"toString": [Function],
"warnTooManyClasses": [Function],
"withComponent": [Function],
}
}
forwardedRef={null}
<div
className="sc-bdfBwQ iEvDpo Columns"
>
<styled.div>
Test
</styled.div>
<styled.div>
Test
</styled.div>
</StyledComponent>
</div>
`;

exports[`matches test renderer snapshot serializes the styles 1`] = `
<div
className="sc-bdVaJa Columns cbtqjA"
className="sc-bdfBwQ iEvDpo Columns"
>
<div
className="sc-bwzfXH Column iypiRz"
className="sc-gsTCUz vuYDo Column"
>
Test
</div>
<div
className="sc-bwzfXH Column iypiRz"
className="sc-gsTCUz vuYDo Column"
>
Test
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports[`matches test renderer snapshot serializes the styles 1`] = `
className="TestContainer Container"
>
<div
className="Container-content sc-bdVaJa cNXzBj"
className="sc-bdfBwQ cSFrRC Container-content"
>
Test
</div>
Expand Down
29 changes: 3 additions & 26 deletions datahub/webapp/__tests__/ui/__snapshots__/Content.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,42 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`matches enzyme snapshots matches snapshot 1`] = `
<StyledComponent
<div
className="sc-bdfBwQ Content"
dangerouslySetInnerHTML={
Object {
"__html": "<p>test</p>",
}
}
forwardedComponent={
Object {
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [
Object {
"className": "Content",
},
],
"componentStyle": ComponentStyle {
"componentId": "sc-bdVaJa",
"isStatic": true,
"rules": Array [],
},
"displayName": "styled.div",
"foldedComponentIds": Array [],
"render": [Function],
"styledComponentId": "sc-bdVaJa",
"target": "div",
"toString": [Function],
"warnTooManyClasses": [Function],
"withComponent": [Function],
}
}
forwardedRef={null}
/>
`;

exports[`matches test renderer snapshot serializes the styles 1`] = `
<div
className="sc-bdVaJa Content bDWFJH"
className="sc-bdfBwQ Content"
dangerouslySetInnerHTML={
Object {
"__html": "<p>test</p>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exports[`matches enzyme snapshots matches snapshot 1`] = `

exports[`matches test renderer snapshot serializes the styles 1`] = `
<span
className="sc-bdVaJa jtnFdk"
className="sc-bdfBwQ kaxqOP"
size={2}
>
<span
Expand Down
Original file line number Diff line number Diff line change
@@ -1,75 +1,25 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`matches enzyme snapshots matches snapshot - false 1`] = `
<StyledComponent
<div
className="sc-bdfBwQ fQYtYk"
disabled={false}
forwardedComponent={
Object {
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
"componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
",
[Function],
";
",
],
},
"displayName": "styled.div",
"foldedComponentIds": Array [],
"render": [Function],
"styledComponentId": "sc-bdVaJa",
"target": "div",
"toString": [Function],
"warnTooManyClasses": [Function],
"withComponent": [Function],
}
}
forwardedRef={null}
>
<input />
</StyledComponent>
</div>
`;

exports[`matches enzyme snapshots matches snapshot 1`] = `
<StyledComponent
forwardedComponent={
Object {
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
"componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
",
[Function],
";
",
],
},
"displayName": "styled.div",
"foldedComponentIds": Array [],
"render": [Function],
"styledComponentId": "sc-bdVaJa",
"target": "div",
"toString": [Function],
"warnTooManyClasses": [Function],
"withComponent": [Function],
}
}
forwardedRef={null}
<div
className="sc-bdfBwQ fRRYli"
>
<input />
</StyledComponent>
</div>
`;

exports[`matches test renderer snapshot serializes the styles 1`] = `
<div
className="sc-bdVaJa qzEVL"
className="sc-bdfBwQ fRRYli"
>
<input />
</div>
Expand Down
42 changes: 3 additions & 39 deletions datahub/webapp/__tests__/ui/__snapshots__/Divider.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,49 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`matches enzyme snapshots matches snapshot 1`] = `
<StyledComponent
forwardedComponent={
Object {
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
"componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
margin-top: ",
[Function],
";
margin-bottom: ",
[Function],
";
height: ",
[Function],
";
background-color: ",
[Function],
";
margin-left: -4px;
margin-right: -4px;
",
],
},
"displayName": "styled.hr",
"foldedComponentIds": Array [],
"render": [Function],
"styledComponentId": "sc-bdVaJa",
"target": "hr",
"toString": [Function],
"warnTooManyClasses": [Function],
"withComponent": [Function],
}
}
forwardedRef={null}
<hr
className="sc-bdfBwQ fVVgFx"
/>
`;

exports[`matches test renderer snapshot serializes the styles 1`] = `
<hr
className="sc-bdVaJa fKCxyC"
className="sc-bdfBwQ fVVgFx"
/>
`;
36 changes: 4 additions & 32 deletions datahub/webapp/__tests__/ui/__snapshots__/FullHeight.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,44 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`matches enzyme snapshots matches snapshot 1`] = `
<StyledComponent
className="TestFullHeight"
forwardedComponent={
Object {
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
"componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
height: 100%;
",
[Function],
";
",
],
},
"displayName": "styled.div",
"foldedComponentIds": Array [],
"render": [Function],
"styledComponentId": "sc-bdVaJa",
"target": "div",
"toString": [Function],
"warnTooManyClasses": [Function],
"withComponent": [Function],
}
}
forwardedRef={null}
<div
className="sc-bdfBwQ cSFrRC TestFullHeight"
>
Test
</StyledComponent>
</div>
`;

exports[`matches test renderer snapshot serializes the styles 1`] = `
<div
className="TestFullHeight sc-bdVaJa cNXzBj"
className="sc-bdfBwQ cSFrRC TestFullHeight"
>
Test
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports[`matches enzyme snapshots matches snapshot 1`] = `

exports[`matches test renderer snapshot serializes the styles 1`] = `
<div
className="JsonViewer sc-bdVaJa cyihmS"
className="sc-bdfBwQ joUYLa JsonViewer"
>
{
"test": "test"
Expand Down
Loading

0 comments on commit e1f0855

Please sign in to comment.