Skip to content

Conversation

@mwclemy
Copy link
Collaborator

@mwclemy mwclemy commented Feb 11, 2026

Issue: https://mxcom.atlassian.net/browse/CT-1922

This PR introduces a new screen to guard demo users from connecting to real institutions.

Screenshot

Screenshot 2026-02-12 at 15 00 15

Testing instructions

  • Load connect as a demo user(You can use demo_user/password123! as the username and password for sand)
  • Attempt to connect to a non-demo institution (e.g: American Express Credit Card).
  • Verify that the demo guard screen appears, as shown in the screenshot.

@platypus801
Copy link

super close! just need to bold "MX Bank" in the body.
image

const institution = useSelector(getSelectedInstitution)
const initialConfig = useSelector(selectInitialConfig)
const containerRef = useRef(null)
const styles = getStyles()
Copy link
Collaborator

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.

Copy link
Collaborator Author

@mwclemy mwclemy Feb 12, 2026

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 () => {
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@mwclemy
Copy link
Collaborator Author

mwclemy commented Feb 12, 2026

super close! just need to bold "MX Bank" in the body. image

Updated with a new screenshot in the description.

@platypus801
Copy link

looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants