-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into r2-2608-prevent-multiple-cases
- Loading branch information
Showing
18 changed files
with
1,708 additions
and
892 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
// .swcrc should be treated as JSONC | ||
|
||
"sourceMaps": true, | ||
|
||
"jsc": { | ||
"parser": { | ||
"syntax": "ecmascript", | ||
"jsx": true | ||
}, | ||
|
||
"transform": { | ||
"react": { | ||
"runtime": "automatic" | ||
} | ||
}, | ||
|
||
"baseUrl": "./app/javascript", | ||
"paths": { | ||
"test-utils":[ "./test-utils/index.js"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
app/javascript/components/conditional-tooltip/component.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Tooltip } from "@material-ui/core"; | ||
import PropTypes from "prop-types"; | ||
|
||
function Component({ children, condition, title }) { | ||
if (condition) { | ||
return ( | ||
<Tooltip title={title} enterTouchDelay={20}> | ||
<div>{children}</div> | ||
</Tooltip> | ||
); | ||
} | ||
|
||
return children; | ||
} | ||
|
||
Component.displayName = "ConditionalTooltip"; | ||
|
||
Component.propTypes = { | ||
children: PropTypes.node.isRequired, | ||
condition: PropTypes.bool.isRequired, | ||
title: PropTypes.string.isRequired | ||
}; | ||
|
||
export default Component; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from "./component"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
import "react-16-node-hanging-test-fix"; // TODO: Remove when update to React 18 | ||
import "./globals"; | ||
|
||
import "@testing-library/jest-dom/extend-expect"; | ||
import { MessageChannel } from "worker_threads"; | ||
|
||
import { createMocks } from "react-idle-timer"; | ||
import { cleanup } from "@testing-library/react"; | ||
|
||
global.IS_REACT_ACT_ENVIRONMENT = true; | ||
|
||
beforeAll(() => { | ||
createMocks(); | ||
global.MessageChannel = MessageChannel; | ||
}); | ||
|
||
afterEach(cleanup); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.