fix(tests): use diffable html for annotation snapshot test

This commit is contained in:
Łukasz Mierzwa
2018-09-07 19:23:17 +01:00
parent fb0a64059e
commit 6d4b3d6746
2 changed files with 20 additions and 37 deletions
@@ -1,45 +1,28 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<RenderLinkAnnotation /> matches snapshot 1`] = `
<a
className="text-nowrap text-truncate badge badge-secondary mr-1"
href="http://localhost/foo"
key="annotation name"
rel="noopener noreferrer"
target="_blank"
"
<a href=\\"http://localhost/foo\\"
target=\\"_blank\\"
rel=\\"noopener noreferrer\\"
class=\\"text-nowrap text-truncate badge badge-secondary mr-1\\"
>
<FontAwesomeIcon
border={false}
className=""
fixedWidth={false}
flip={null}
icon={
Object {
"icon": Array [
576,
512,
Array [],
"f35d",
"M576 24v127.984c0 21.461-25.96 31.98-40.971 16.971l-35.707-35.709-243.523 243.523c-9.373 9.373-24.568 9.373-33.941 0l-22.627-22.627c-9.373-9.373-9.373-24.569 0-33.941L442.756 76.676l-35.703-35.705C391.982 25.9 402.656 0 424.024 0H552c13.255 0 24 10.745 24 24zM407.029 270.794l-16 16A23.999 23.999 0 0 0 384 303.765V448H64V128h264a24.003 24.003 0 0 0 16.97-7.029l16-16C376.089 89.851 365.381 64 344 64H48C21.49 64 0 85.49 0 112v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V287.764c0-21.382-25.852-32.09-40.971-16.97z",
],
"iconName": "external-link-alt",
"prefix": "fas",
}
}
inverse={false}
listItem={false}
mask={null}
pull={null}
pulse={false}
rotation={null}
size={null}
spin={false}
symbol={false}
transform={null}
/>
<svg aria-hidden=\\"true\\"
data-prefix=\\"fas\\"
data-icon=\\"external-link-alt\\"
class=\\"svg-inline--fa fa-external-link-alt fa-w-18 \\"
role=\\"img\\"
xmlns=\\"http://www.w3.org/2000/svg\\"
viewbox=\\"0 0 576 512\\"
>
<path fill=\\"currentColor\\"
d=\\"M576 24v127.984c0 21.461-25.96 31.98-40.971 16.971l-35.707-35.709-243.523 243.523c-9.373 9.373-24.568 9.373-33.941 0l-22.627-22.627c-9.373-9.373-9.373-24.569 0-33.941L442.756 76.676l-35.703-35.705C391.982 25.9 402.656 0 424.024 0H552c13.255 0 24 10.745 24 24zM407.029 270.794l-16 16A23.999 23.999 0 0 0 384 303.765V448H64V128h264a24.003 24.003 0 0 0 16.97-7.029l16-16C376.089 89.851 365.381 64 344 64H48C21.49 64 0 85.49 0 112v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V287.764c0-21.382-25.852-32.09-40.971-16.97z\\"
>
</path>
</svg>
annotation name
</a>
"
`;
exports[`<RenderNonLinkAnnotation /> matches snapshot when visible=false 1`] = `
@@ -22,7 +22,7 @@ const ShallowLinkAnnotation = () => {
describe("<RenderLinkAnnotation />", () => {
it("matches snapshot", () => {
const tree = ShallowLinkAnnotation();
expect(tree).toMatchSnapshot();
expect(toDiffableHtml(tree.html())).toMatchSnapshot();
});
it("contains a link", () => {