Add +/- buttons in scale deployment popup screen (#1191)

* Add @testing-library/jest-dom and @testing-library/react for writing test cases

* Make eslint check __mocks__/*.ts files

* Mock electron.ipcRenderer.on to prevent errors in React compoment test cases

* Mock <Trans /> from @lingui/macro as a component simplely returns children components

* Use optional chaining operator (?.) to avoid TypeError: Cannot read property 'replicas' of undefined

* Add jest-fetch-mock for mocking global.fetch, activate for all test cases in jest.setup.ts

* Add basic tests for <DeploymentScaleDialog /> to ensure it initialises/renders without errors

* Add +/- button for changing desired replicas, and its test cases

* Adjust the styles of +/- buttons container to make sure it aligns with the slider

* Refactor after rebase from master

* Use var defined in vars.scss

* Add flex align-center to slider-container and remove margin-top: -4px

* Use <Icon /> to replace <i/>

* Add flex gaps to plus-minus-container

Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
This commit is contained in:
chh authored and GitHub committed 2020-11-03 20:30:36 +08:00
1 parent 3ed7d93e91
commit 484de2ec21
10 files changed
+414 -11

No files matched your search

+8 -1
View File
@@ -71,10 +71,14 @@
"^.+\\.tsx?$": "ts-jest"
},
"moduleNameMapper": {
"\\.(css|scss)$": "<rootDir>/__mocks__/styleMock.ts"
"\\.(css|scss)$": "<rootDir>/__mocks__/styleMock.ts",
"^@lingui/macro$": "<rootDir>/__mocks__/@linguiMacro.ts"
},
"modulePathIgnorePatterns": [
"<rootDir>/dist"
],
"setupFiles": [
"<rootDir>/src/jest.setup.ts"
]
},
"build": {
@@ -264,6 +268,8 @@
"@lingui/react": "^3.0.0-13",
"@material-ui/core": "^4.10.1",
"@rollup/plugin-json": "^4.1.0",
"@testing-library/jest-dom": "^5.11.5",
"@testing-library/react": "^11.1.0",
"@types/chart.js": "^2.9.21",
"@types/circular-dependency-plugin": "^5.0.1",
"@types/color": "^3.0.1",
@@ -337,6 +343,7 @@
"identity-obj-proxy": "^3.0.0",
"include-media": "^1.4.9",
"jest": "^26.0.1",
"jest-fetch-mock": "^3.0.3",
"jest-mock-extended": "^1.0.10",
"make-plural": "^6.2.1",
"mini-css-extract-plugin": "^0.9.0",