mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-06 22:17:59 +00:00
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
import DyteAPIClient from '../../integrations/dyte';
|
|
import ApiClient from '../../ApiClient';
|
|
import describeWithAPIMock from '../apiSpecHelper';
|
|
|
|
describe('#accountAPI', () => {
|
|
it('creates correct instance', () => {
|
|
expect(DyteAPIClient).toBeInstanceOf(ApiClient);
|
|
expect(DyteAPIClient).toHaveProperty('createAMeeting');
|
|
expect(DyteAPIClient).toHaveProperty('addParticipantToMeeting');
|
|
});
|
|
|
|
describeWithAPIMock('createAMeeting', context => {
|
|
it('creates a valid request', () => {
|
|
DyteAPIClient.createAMeeting(1);
|
|
expect(context.axiosMock.post).toHaveBeenCalledWith(
|
|
'/api/v1/integrations/dyte/create_a_meeting',
|
|
{
|
|
conversation_id: 1,
|
|
}
|
|
);
|
|
});
|
|
});
|
|
|
|
describeWithAPIMock('addParticipantToMeeting', context => {
|
|
it('creates a valid request', () => {
|
|
DyteAPIClient.addParticipantToMeeting(1);
|
|
expect(context.axiosMock.post).toHaveBeenCalledWith(
|
|
'/api/v1/integrations/dyte/add_participant_to_meeting',
|
|
{
|
|
message_id: 1,
|
|
}
|
|
);
|
|
});
|
|
});
|
|
});
|