Skip to content

Commit 220b313

Browse files
raju249AutomatedTester
authored andcommitted
Update tests moduleMapper for svg
1 parent 7262726 commit 220b313

File tree

6 files changed

+9
-49
lines changed

6 files changed

+9
-49
lines changed

javascript/grid-ui/jest.config.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ export default {
44
],
55
testMatch: [
66
"<rootDir>/src/tests/*.test.ts",
7+
"<rootDir>/src/tests/*.test.tsx"
78
],
89
transform: {
910
"^.+\\.(ts|tsx)$": "ts-jest"
1011
},
1112
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
1213
snapshotSerializers: ["enzyme-to-json/serializer"],
1314
setupFilesAfterEnv: ["<rootDir>/src/setupTests.ts"],
14-
testEnvironment: "node"
15+
testEnvironment: "node",
16+
moduleNameMapper: {
17+
".+\\.(svg|png|jpg)$": "identity-obj-proxy"
18+
}
1519
}

javascript/grid-ui/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"enzyme": "^3.11.0",
7070
"enzyme-adapter-react-16": "^1.15.5",
7171
"enzyme-to-json": "^3.6.1",
72+
"identity-obj-proxy": "^3.0.0",
7273
"jest": "^26.6.3",
7374
"jest-cli": "^26.6.3",
7475
"ts-jest": "^26.4.4",

javascript/grid-ui/src/components/CheckBox.ts

-30
This file was deleted.

javascript/grid-ui/src/components/Status.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const LABEL_COLORS: { [key in StatusType]: string } = {
4646
[StatusType.UNAVAILABLE]: "#8b8b8b",
4747
};
4848

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

javascript/grid-ui/src/tests/Checkbox.test.ts

-15
This file was deleted.

javascript/grid-ui/src/tests/Status.test.ts renamed to javascript/grid-ui/src/tests/Status.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import React from 'react';
22
import { shallow, mount } from 'enzyme';
33
import { Status } from '../components/Status';
44

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

0 commit comments

Comments
 (0)