Skip to content

Commit ec6217c

Browse files
committed
remove custom snapshotSerializers from jest config
1 parent f5c2514 commit ec6217c

File tree

4 files changed

+117
-271
lines changed

4 files changed

+117
-271
lines changed

__tests__/Snapshottest/UIOutputComparisonTests.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import * as React from 'react';
66
import '@testing-library/jest-dom';
7-
import { prettyDOM, render } from '@testing-library/react';
7+
import { render } from '@testing-library/react';
88
import * as LibraryEntryPoint from '../../src/entry-point';
99
import { LibraryItem } from '../../src/components/LibraryItem';
1010
import { ItemData } from "../../src/LibraryUtilities";
@@ -28,13 +28,13 @@ describe("LibraryContainer", function () {
2828

2929
// When running for the first time creates a snapshot in __snapshots__ folder
3030
// To compare with the existing snapshot for subsequent running.
31-
expect(prettyDOM(container)).toMatchSnapshot();
31+
expect(container).toMatchSnapshot();
3232
});
3333

3434
it("Test UI rendering of Library Item and child components", function () {
3535
// Render with render() to test child components
3636
const { container } = render(libraryItemComponent);
37-
expect(prettyDOM(container)).toMatchSnapshot();
37+
expect(container).toMatchSnapshot();
3838
});
3939

4040
it("Demonstrate testing UIitems loads correctly from static data", function () {
@@ -55,8 +55,10 @@ describe("LibraryContainer", function () {
5555
libController.refreshLibraryView();
5656

5757
// Search for all LibraryItems
58-
let text = container.querySelectorAll('div.LibraryItemText')[0];
59-
expect(prettyDOM(text)).toMatchSnapshot();
58+
const text = container.querySelectorAll('.LibraryItemText');
59+
const serializedNodes = Array.from(text).map((node)=> node.outerHTML).join("\n");
60+
console.log('text: ', text);
61+
expect(serializedNodes).toMatchSnapshot();
6062
});
6163
});
6264

0 commit comments

Comments
 (0)