Skip to content

Commit

Permalink
Increased test coverage of socketSlice
Browse files Browse the repository at this point in the history
  • Loading branch information
YaroslavLys committed Oct 15, 2024
1 parent 96d7b21 commit 28b7413
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/unit/redux/socketSlice.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import reducer, {
disconnectSocket,
setUsersOnline,
addIsTyping,
removeIsTyping
removeIsTyping,
sendTyping
} from '~/redux/features/socketSlice'

const initialState = {
Expand Down Expand Up @@ -80,4 +81,16 @@ describe('socketSlice test', () => {
expectedState
)
})

it('should send correct payload in sendTyping', () => {
expect(
reducer(
initialState,
sendTyping({
chatId: 'chat1',
receiverId: 'receiver1'
})
)
).toEqual(initialState)
})
})

0 comments on commit 28b7413

Please sign in to comment.