Skip to content

Commit

Permalink
improving snapshot using snapshotSerializers to remove unnecessary th…
Browse files Browse the repository at this point in the history
…ings (finos#596)
  • Loading branch information
VICTOR RAPHAEL BRAGA DE SALES MASCARENHAS authored and KiranNiranjan committed Mar 28, 2019
1 parent e333a4c commit 50eaea3
Show file tree
Hide file tree
Showing 8 changed files with 255 additions and 2,730 deletions.
3 changes: 2 additions & 1 deletion jest.unit.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
],
"setupFiles": [
"./spec/setup/test-setup.js"
]
],
"snapshotSerializers": ["enzyme-to-json/serializer"]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
"electron-fetch": "1.3.0",
"electron-log": "2.2.17",
"electron-spellchecker": "git+https://github.com/symphonyoss/electron-spellchecker.git#v1.1.5",
"enzyme-to-json": "^3.3.5",
"ffi": "git+https://github.com/symphonyoss/node-ffi.git#v1.2.9",
"filesize": "3.6.1",
"jimp": "0.6.0",
Expand Down
222 changes: 23 additions & 199 deletions spec/__snapshots__/aboutApp.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -1,203 +1,27 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`about app should render correctly 1`] = `
ShallowWrapper {
Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <AboutApp />,
Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function],
"checkPropTypes": [Function],
"getNode": [Function],
"render": [Function],
"simulateError": [Function],
"simulateEvent": [Function],
"unmount": [Function],
},
Symbol(enzyme.__node__): Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": Array [
<img
className="AboutApp-logo"
src="../assets/symphony-logo.png"
/>,
<span
className="AboutApp-name"
>
Symphony
</span>,
<span
className="AboutApp-versionText"
>
Version 0-N/A ()
</span>,
<span
className="AboutApp-copyrightText"
>
Copyright © 2019 Symphony
</span>,
],
"className": "AboutApp",
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"className": "AboutApp-logo",
"src": "../assets/symphony-logo.png",
},
"ref": null,
"rendered": null,
"type": "img",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Symphony",
"className": "AboutApp-name",
},
"ref": null,
"rendered": "Symphony",
"type": "span",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Version 0-N/A ()",
"className": "AboutApp-versionText",
},
"ref": null,
"rendered": "Version 0-N/A ()",
"type": "span",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Copyright © 2019 Symphony",
"className": "AboutApp-copyrightText",
},
"ref": null,
"rendered": "Copyright © 2019 Symphony",
"type": "span",
},
],
"type": "div",
},
Symbol(enzyme.__nodes__): Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": Array [
<img
className="AboutApp-logo"
src="../assets/symphony-logo.png"
/>,
<span
className="AboutApp-name"
>
Symphony
</span>,
<span
className="AboutApp-versionText"
>
Version 0-N/A ()
</span>,
<span
className="AboutApp-copyrightText"
>
Copyright © 2019 Symphony
</span>,
],
"className": "AboutApp",
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"className": "AboutApp-logo",
"src": "../assets/symphony-logo.png",
},
"ref": null,
"rendered": null,
"type": "img",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Symphony",
"className": "AboutApp-name",
},
"ref": null,
"rendered": "Symphony",
"type": "span",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Version 0-N/A ()",
"className": "AboutApp-versionText",
},
"ref": null,
"rendered": "Version 0-N/A ()",
"type": "span",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Copyright © 2019 Symphony",
"className": "AboutApp-copyrightText",
},
"ref": null,
"rendered": "Copyright © 2019 Symphony",
"type": "span",
},
],
"type": "div",
},
],
Symbol(enzyme.__options__): Object {
"adapter": ReactSixteenAdapter {
"options": Object {
"enableComponentDidUpdateOnSetState": true,
"legacyContextMode": "parent",
"lifecycles": Object {
"componentDidUpdate": Object {
"onSetState": true,
},
"getChildContext": Object {
"calledByRenderer": false,
},
"getDerivedStateFromProps": true,
"getSnapshotBeforeUpdate": true,
"setState": Object {
"skipsComponentDidUpdateOnNullish": true,
},
},
},
},
},
Symbol(enzyme.__childContext__): null,
}
<div
className="AboutApp"
>
<img
className="AboutApp-logo"
src="../assets/symphony-logo.png"
/>
<span
className="AboutApp-name"
>
Symphony
</span>
<span
className="AboutApp-versionText"
>
Version 0-N/A ()
</span>
<span
className="AboutApp-copyrightText"
>
Copyright © 2019 Symphony
</span>
</div>
`;
Loading

0 comments on commit 50eaea3

Please sign in to comment.