Skip to content

Commit

Permalink
Update tests moduleMapper for svg
Browse files Browse the repository at this point in the history
  • Loading branch information
raju249 authored and AutomatedTester committed Nov 23, 2020
1 parent 7262726 commit 220b313
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 49 deletions.
6 changes: 5 additions & 1 deletion javascript/grid-ui/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ export default {
],
testMatch: [
"<rootDir>/src/tests/*.test.ts",
"<rootDir>/src/tests/*.test.tsx"
],
transform: {
"^.+\\.(ts|tsx)$": "ts-jest"
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
snapshotSerializers: ["enzyme-to-json/serializer"],
setupFilesAfterEnv: ["<rootDir>/src/setupTests.ts"],
testEnvironment: "node"
testEnvironment: "node",
moduleNameMapper: {
".+\\.(svg|png|jpg)$": "identity-obj-proxy"
}
}
1 change: 1 addition & 0 deletions javascript/grid-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
"enzyme-to-json": "^3.6.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"jest-cli": "^26.6.3",
"ts-jest": "^26.4.4",
Expand Down
30 changes: 0 additions & 30 deletions javascript/grid-ui/src/components/CheckBox.ts

This file was deleted.

2 changes: 1 addition & 1 deletion javascript/grid-ui/src/components/Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const LABEL_COLORS: { [key in StatusType]: string } = {
[StatusType.UNAVAILABLE]: "#8b8b8b",
};

export const Status = React.Component(
export const Status = React.memo(
(props: { status: string; selected?: number }) => {
let { status, selected = -1 } = props;

Expand Down
15 changes: 0 additions & 15 deletions javascript/grid-ui/src/tests/Checkbox.test.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import React from 'react';
import { shallow, mount } from 'enzyme';
import { Status } from '../components/Status';

test('CheckboxWithLabel changes the text after click', () => {
const statusComp = mount(<Status status='UP'/>);
test('Status component', () => {
const statusComp = shallow(<Status status='UP'/>);
});

0 comments on commit 220b313

Please sign in to comment.