-
Notifications
You must be signed in to change notification settings - Fork 1
Add demo connect guard screen #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| const institution = useSelector(getSelectedInstitution) | ||
| const initialConfig = useSelector(selectInitialConfig) | ||
| const containerRef = useRef(null) | ||
| const styles = getStyles() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an ADR to use css modules. Let's use css modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially started with css modules, but since the styles I have are theme overrides that need to be applied via the sx prop and sx expects a style object rather than class names, there isn’t a way to inject css module classes. Given that constraint, I had to use inline styles in this case.
| import * as connectActions from 'src/redux/actions/Connect' | ||
|
|
||
| // Mock useDispatch | ||
| vitest.mock('react-redux', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests feel very mocky, so they don't give me much confidence that things will work when they're actually put together. How can you mock as little as possible while ensuring the functionality is tested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless you have better ideas, I couldn’t think of another way to test the action dispatch without mocking useDispatch.
|
looks good! |


Issue: https://mxcom.atlassian.net/browse/CT-1922
This PR introduces a new screen to guard demo users from connecting to real institutions.
Screenshot
Testing instructions
demo_user/password123!as the username and password for sand)