Skip to content

Commit

Permalink
feat: add Slider component (EightfoldAI#190)
Browse files Browse the repository at this point in the history
* feat: add Slider component

* chore: update test snapshots

* chore: address PR feedback

* fix: ensure marker and thumb align

* fix: eliminate race condition in Slider

* chore: clean up testing output

* fix: cleanup build errors

Co-authored-by: phrough <[email protected]>
  • Loading branch information
2 people authored and ayadav-eightfold committed Jun 23, 2022
1 parent df186b5 commit 07a18fc
Show file tree
Hide file tree
Showing 17 changed files with 1,485 additions and 573 deletions.
16 changes: 16 additions & 0 deletions config/jest/identity-obj-proxy-revised.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Proxy for jest tests to convert css moodule class names.
// Based on https://medium.com/trabe/testing-css-modules-in-react-components-with-jest-enzyme-and-a-custom-modulenamemapper-8ff86c7d18a2

module.exports = new Proxy(
{},
{
get: function getter(target, key) {
if (key === '__esModule') {
return false;
}

// Convert camelCase to kebab-case for class selectors in unit tests.
return key.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`);
},
}
);
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
"html-webpack-plugin": "5.5.0",
"husky": "7.0.4",
"icomoon-react": "^3.0.0",
"identity-obj-proxy": "3.0.0",
"install-peers": "1.0.3",
"install-peers-cli": "2.2.0",
"jest": "27.4.3",
Expand Down Expand Up @@ -209,7 +208,7 @@
"modulePaths": [],
"moduleNameMapper": {
"^react-native$": "react-native-web",
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
"^.+\\.module\\.(css|sass|scss)$": "<rootDir>/config/jest/identity-obj-proxy-revised.js"
},
"moduleFileExtensions": [
"web.js",
Expand Down
Loading

0 comments on commit 07a18fc

Please sign in to comment.