Skip to content

Commit d4eb8c9

Browse files
committed
Added common tests and change resize logic to use clientX and clientY for testability
1 parent 7a9cc30 commit d4eb8c9

23 files changed

+612
-811
lines changed

@types/global.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export {};
2+
3+
declare global {
4+
namespace jest {
5+
interface Expect {
6+
<T = any>(actual: T, message: String): Matchers<T>;
7+
}
8+
}
9+
}

jest.config.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ module.exports = {
5858
// globalTeardown: undefined,
5959

6060
// A set of global variables that need to be available in all test environments
61-
// globals: {},
61+
globals: {
62+
"ts-jest": {
63+
tsConfig: {
64+
target: "es2017",
65+
},
66+
},
67+
},
6268

6369
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
6470
// maxWorkers: "50%",
@@ -119,7 +125,7 @@ module.exports = {
119125
// setupFiles: [],
120126

121127
// A list of paths to modules that run some code to configure or set up the testing framework before each test
122-
// setupFilesAfterEnv: [],
128+
setupFilesAfterEnv: ["jest-expect-message"],
123129

124130
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
125131
// snapshotSerializers: [],

package-lock.json

Lines changed: 10 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"babel-plugin-external-helpers": "^6.22.0",
5353
"cssstyle": "^2.3.0",
5454
"jest": "^25.4.0",
55+
"jest-expect-message": "^1.0.2",
5556
"node-sass": "^4.13.1",
5657
"prettier": "^1.19.1",
5758
"react": "^16.13.1",

src/components/__tests__/Bottom.tsx

Lines changed: 0 additions & 129 deletions
This file was deleted.

src/components/__tests__/Fixed.tsx

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/components/__tests__/Left.tsx

Lines changed: 0 additions & 129 deletions
This file was deleted.

0 commit comments

Comments
 (0)