You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we do a fair amount of socket communication between the redux sagas and backend, and will do more as more control is allocated to the backend. The issue is that every test redefines their own socket mock, and use different methods for doing so. This makes keeping tests up to date with the expected socket responses very tedious as you have to track down every definition and update them. We can probably create a common SocketMock class used by every test across desktop and state-manager that provides the sagas with the same expected responses to emitWithAck across tests. Then, developers will only need to update the socket mock in one place.
Potential complications may arise if we expect that a socket action will respond with different values across different calls.
Acceptance Criteria
Custom SocketMock class injected into all saga tests
All socket actions defined in startConnectionSaga are defined with responses in SocketMock
API for overriding emitWithAck responses (maybe define each response as a function that can be overridden in the instance constructed by the test and then use a switch for calling the correct function in the emitWithAck mock
The text was updated successfully, but these errors were encountered:
Description
Currently, we do a fair amount of socket communication between the redux sagas and backend, and will do more as more control is allocated to the backend. The issue is that every test redefines their own socket mock, and use different methods for doing so. This makes keeping tests up to date with the expected socket responses very tedious as you have to track down every definition and update them. We can probably create a common SocketMock class used by every test across
desktop
andstate-manager
that provides the sagas with the same expected responses toemitWithAck
across tests. Then, developers will only need to update the socket mock in one place.Potential complications may arise if we expect that a socket action will respond with different values across different calls.
Acceptance Criteria
startConnectionSaga
are defined with responses in SocketMockThe text was updated successfully, but these errors were encountered: