Problem
frontend/src/components/__tests__/WebSocketToastNotifications.test.tsx (431 lines, 12 tests) mocks socket.io-client's io() and asserts toast behavior — but there is no WebSocketToastNotifications component anywhere in frontend/src/components/. Every test defines its own local TestComponent inline that wires mockSocket.on('remittance:completed', ...) directly to useToast()/ToastContainer. This suite tests a throwaway scratch harness, not production code — it gives a false signal of coverage for real-time UI updates.
Meanwhile, the actual production real-time status component, frontend/src/components/TransactionStatusTracker.tsx, uses the native WebSocket API, not socket.io-client. Its test file has zero references to WebSocket or socket — it only covers polling and API-fetch paths. The component's actual open/message/error/close event handling, and its malformed-payload catch block, are completely untested.
Suggested approach
- Either delete/rename
WebSocketToastNotifications.test.tsx to reflect that it's testing a generic toast+socket pattern, or wire it to a real component if one is intended to exist.
- Add tests to
TransactionStatusTracker.test.tsx that construct the component with a mocked/fake WebSocket, and assert: status updates on message, graceful handling of malformed JSON payloads, and cleanup (close) on unmount.
Problem
frontend/src/components/__tests__/WebSocketToastNotifications.test.tsx(431 lines, 12 tests) mockssocket.io-client'sio()and asserts toast behavior — but there is noWebSocketToastNotificationscomponent anywhere infrontend/src/components/. Every test defines its own localTestComponentinline that wiresmockSocket.on('remittance:completed', ...)directly touseToast()/ToastContainer. This suite tests a throwaway scratch harness, not production code — it gives a false signal of coverage for real-time UI updates.Meanwhile, the actual production real-time status component,
frontend/src/components/TransactionStatusTracker.tsx, uses the nativeWebSocketAPI, notsocket.io-client. Its test file has zero references toWebSocketorsocket— it only covers polling and API-fetch paths. The component's actualopen/message/error/closeevent handling, and its malformed-payload catch block, are completely untested.Suggested approach
WebSocketToastNotifications.test.tsxto reflect that it's testing a generic toast+socket pattern, or wire it to a real component if one is intended to exist.TransactionStatusTracker.test.tsxthat construct the component with a mocked/fakeWebSocket, and assert: status updates onmessage, graceful handling of malformed JSON payloads, and cleanup (close) on unmount.