Skip to content

Commit

Permalink
Add test for PAD_TRANSIENT
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfelixrico committed Apr 6, 2024
1 parent a72eed9 commit ac14cc0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions server/jest/__tests__/socket-pad.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,26 @@ describe('socket-join', () => {
},
})
})

it('broadcasts PAD_TRANSIENT events', async () => {
const clientAHandler = jest.fn()
const clientBHandler = jest.fn()

clientA.on('PAD_TRANSIENT', clientAHandler)
clientB.on('PAD_TRANSIENT', clientBHandler)

clientA.emit('PAD_TRANSIENT', {
DUMMY_MESSAGE: {
foo: 'bar',
},
})

await Bluebird.delay(1_000)
expect(clientAHandler).not.toHaveBeenCalled()
expect(clientBHandler).toHaveBeenCalledWith({
DUMMY_MESSAGE: {
foo: 'bar',
},
})
})
})

0 comments on commit ac14cc0

Please sign in to comment.