Skip to content

Commit

Permalink
remove custom snapshotSerializers from jest config
Browse files Browse the repository at this point in the history
  • Loading branch information
EnzoBatistaU committed Nov 27, 2024
1 parent f5c2514 commit 466bbdf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
10 changes: 5 additions & 5 deletions __tests__/Snapshottest/UIOutputComparisonTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

// When running for the first time creates a snapshot in __snapshots__ folder
// To compare with the existing snapshot for subsequent running.
expect(prettyDOM(container)).toMatchSnapshot();
expect(container).toMatchSnapshot();
});

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

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

// Search for all LibraryItems
let text = container.querySelectorAll('div.LibraryItemText')[0];
expect(prettyDOM(text)).toMatchSnapshot();
const text = container.querySelectorAll('div.LibraryItemText')[0];
expect(text).toMatchSnapshot();
});
});

3 changes: 0 additions & 3 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ const config: Config = {
testPathIgnorePatterns: [
"__tests__/data/"
],
snapshotSerializers: [
"<rootDir>/node_modules/enzyme-to-json/serializer"
],
reporters: [
"default",
[
Expand Down
1 change: 0 additions & 1 deletion src/components/LibraryItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ export class LibraryItem extends React.Component<LibraryItemProps, LibraryItemSt
}

onLibraryItemClicked() {
console.log("CLICKED !!");
//https://jira.autodesk.com/browse/QNTM-2975
//Add-ons section is always expanded.
if(this.props.data.text == "Add-ons") return;
Expand Down

0 comments on commit 466bbdf

Please sign in to comment.