-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Abhinav Kumar <[email protected]>
- Loading branch information
1 parent
982228d
commit 9c8d53f
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
apps/meteor/tests/unit/app/livechat/server/hooks/beforeNewRoom.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { expect } from 'chai'; | ||
import proxyquire from 'proxyquire'; | ||
|
||
import { callbacks } from '../../../../../../lib/callbacks'; | ||
|
||
proxyquire.noCallThru().load('../../../../../../ee/app/livechat-enterprise/server/hooks/beforeNewRoom.ts', { | ||
'meteor/meteor': { | ||
Meteor: { | ||
Error, | ||
}, | ||
}, | ||
}); | ||
|
||
describe('livechat.beforeRoom', () => { | ||
it('should return roomInfo with customFields when provided', async () => { | ||
const roomInfo = { name: 'test' }; | ||
const extraData = { customFields: { test: 'test' } }; | ||
const result = await callbacks.run('livechat.beforeRoom', roomInfo, extraData); | ||
expect(result).to.deep.equal({ ...roomInfo, customFields: extraData.customFields }); | ||
}); | ||
}); |