From 095d090adf035bd0e3e62cd239018e5bfa214c0a Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 18 May 2026 15:08:17 -0400 Subject: [PATCH 1/6] update existing tests --- tests/globals.d.ts | 23 +++++++ tests/tsconfig.json | 9 +++ tests/unit/api/calls-api.test.ts | 15 +++-- tests/unit/api/conferences-api.test.ts | 1 - tests/unit/api/endpoints-api.test.ts | 16 +++-- tests/unit/api/media-api.test.ts | 2 +- tests/unit/api/messages-api.test.ts | 17 ++++-- tests/unit/api/mfaapi.test.ts | 8 ++- .../unit/api/phone-number-lookup-api.test.ts | 61 +++++++++---------- tests/unit/api/recordings-api.test.ts | 13 ++-- tests/unit/api/statistics-api.test.ts | 7 ++- .../api/toll-free-verification-api.test.ts | 42 +++++++------ tests/unit/api/transcriptions-api.test.ts | 1 - 13 files changed, 142 insertions(+), 73 deletions(-) create mode 100644 tests/globals.d.ts create mode 100644 tests/tsconfig.json diff --git a/tests/globals.d.ts b/tests/globals.d.ts new file mode 100644 index 0000000..23f6d3f --- /dev/null +++ b/tests/globals.d.ts @@ -0,0 +1,23 @@ +/// + +declare const BW_USERNAME: string; +declare const BW_PASSWORD: string; +declare const BW_CLIENT_ID: string; +declare const BW_CLIENT_SECRET: string; +declare const BW_ACCOUNT_ID: string; +declare const BW_NUMBER: string; +declare const USER_NUMBER: string; +declare const BW_VOICE_APPLICATION_ID: string; +declare const BW_MESSAGING_APPLICATION_ID: string; +declare const BASE_CALLBACK_URL: string; +declare const OPERATING_SYSTEM: string; +declare const MANTECA_APPLICATION_ID: string; +declare const MANTECA_IDLE_NUMBER: string; +declare const MANTECA_ACTIVE_NUMBER: string; +declare const MANTECA_BASE_URL: string; +declare const FORBIDDEN_USERNAME: string; +declare const FORBIDDEN_PASSWORD: string; +declare const UNAUTHORIZED_USERNAME: string; +declare const UNAUTHORIZED_PASSWORD: string; +declare const MAX_RETRIES: number; +declare const SLEEP_TIME_S: number; diff --git a/tests/tsconfig.json b/tests/tsconfig.json new file mode 100644 index 0000000..f6822c0 --- /dev/null +++ b/tests/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "rootDir": "..", + "types": ["jest", "node"] + }, + "include": ["**/*.ts"], + "exclude": ["../node_modules", "../dist"] +} diff --git a/tests/unit/api/calls-api.test.ts b/tests/unit/api/calls-api.test.ts index 415d25f..3cb17ca 100644 --- a/tests/unit/api/calls-api.test.ts +++ b/tests/unit/api/calls-api.test.ts @@ -1,4 +1,4 @@ -//@ts-nocheck +import axios from 'axios'; import { CallsApi } from '../../../api'; import { Configuration } from '../../../configuration'; import { @@ -158,21 +158,28 @@ describe('CallsApi', () => { describe('HTTP Errors', () => { test('400', async () => { + expect.assertions(1); try { + // @ts-expect-error intentionally empty body to trigger 400 await callsApi.createCall(BW_ACCOUNT_ID, {}); } catch (e) { - expect(e.response.status).toEqual(400); + if (axios.isAxiosError(e)) { + expect(e.response?.status).toEqual(400); + } } }); test('401', async () => { + expect.assertions(1); const unauthorizedConfig = new Configuration({ basePath: 'http://127.0.0.1:4010' }); const unauthorizedCallsApi = new CallsApi(unauthorizedConfig); - + try { await unauthorizedCallsApi.getCallState(BW_ACCOUNT_ID, callId); } catch (e) { - expect(e.response.status).toEqual(401); + if (axios.isAxiosError(e)) { + expect(e.response?.status).toEqual(401); + } } }); }); diff --git a/tests/unit/api/conferences-api.test.ts b/tests/unit/api/conferences-api.test.ts index 4bf870a..ef099c9 100644 --- a/tests/unit/api/conferences-api.test.ts +++ b/tests/unit/api/conferences-api.test.ts @@ -1,4 +1,3 @@ -//@ts-nocheck import { ConferencesApi } from '../../../api'; import { Configuration } from '../../../configuration'; import { diff --git a/tests/unit/api/endpoints-api.test.ts b/tests/unit/api/endpoints-api.test.ts index 78f6d05..4af3bab 100644 --- a/tests/unit/api/endpoints-api.test.ts +++ b/tests/unit/api/endpoints-api.test.ts @@ -1,7 +1,11 @@ -//@ts-nocheck import { EndpointsApi } from '../../../api'; import { Configuration } from '../../../configuration'; -import { CreateWebRtcConnectionRequest, EndpointDirectionEnum, EndpointStatusEnum, EndpointTypeEnum } from '../../../models'; +import { + CreateWebRtcConnectionRequest, + EndpointDirectionEnum, + EndpointStatusEnum, + EndpointTypeEnum +} from '../../../models'; describe('EndpointsApi', () => { const config = new Configuration({ @@ -51,10 +55,10 @@ describe('EndpointsApi', () => { expect(data.links[0].href).toBeString(); expect(data.data).toBeInstanceOf(Array); expect(data.page).toBeDefined(); - expect(data.page.pageSize).toBeNumber(); - expect(data.page.pageNumber).toBeNumber(); - expect(data.page.totalPages).toBeNumber(); - expect(data.page.totalElements).toBeNumber(); + expect(data.page!.pageSize).toBeNumber(); + expect(data.page!.pageNumber).toBeNumber(); + expect(data.page!.totalPages).toBeNumber(); + expect(data.page!.totalElements).toBeNumber(); expect(data.errors).toBeInstanceOf(Array); expect(data.data.length).toBeGreaterThan(0); diff --git a/tests/unit/api/media-api.test.ts b/tests/unit/api/media-api.test.ts index 34abb02..b2826d8 100644 --- a/tests/unit/api/media-api.test.ts +++ b/tests/unit/api/media-api.test.ts @@ -1,4 +1,3 @@ -//@ts-nocheck import { MediaApi } from '../../../api'; import { Configuration } from '../../../configuration'; @@ -18,6 +17,7 @@ describe('MediaApi', () => { const { status } = await mediaApi.uploadMedia( BW_ACCOUNT_ID, binaryMediaName, + // @ts-expect-error SDK types body as File but axios/API accept strings binaryMediaData, undefined, undefined, diff --git a/tests/unit/api/messages-api.test.ts b/tests/unit/api/messages-api.test.ts index 9137752..5f8e7f8 100644 --- a/tests/unit/api/messages-api.test.ts +++ b/tests/unit/api/messages-api.test.ts @@ -1,4 +1,4 @@ -//@ts-nocheck +import axios from 'axios'; import { MessagesApi } from '../../../api'; import { Configuration } from '../../../configuration'; import { @@ -46,9 +46,11 @@ describe('MessagesApi', () => { expect(data.segmentCount).toBeInteger(); expect(data.direction).toBeOneOf(Object.values(MessageDirectionEnum)); expect(data.to).toBeInstanceOf(Array); + // @ts-expect-error SWI-11047: typed as Set but runtime is Array expect(data.to![0]).toHaveLength(12); expect(data.from).toHaveLength(12); expect(data.media).toBeInstanceOf(Array); + // @ts-expect-error SWI-11047: typed as Set but runtime is Array expect(data.media![0]).toStartWith('http'); expect(data.text).toBeString(); expect(data.tag).toBeString(); @@ -98,21 +100,28 @@ describe('MessagesApi', () => { describe('HTTP Errors', () => { test('400', async () => { + expect.assertions(1); try { + // @ts-expect-error intentionally empty body to trigger 400 await messagesApi.createMessage(BW_ACCOUNT_ID, {}); } catch (e) { - expect(e.response.status).toEqual(400); + if (axios.isAxiosError(e)) { + expect(e.response?.status).toEqual(400); + } } }); test('401', async () => { + expect.assertions(1); const unauthorizedConfig = new Configuration({ basePath: 'http://127.0.0.1:4010' }); const unauthorizedMessagesApi = new MessagesApi(unauthorizedConfig); - + try { await unauthorizedMessagesApi.listMessages(BW_ACCOUNT_ID); } catch (e) { - expect(e.response.status).toEqual(401); + if (axios.isAxiosError(e)) { + expect(e.response?.status).toEqual(401); + } } }); }); diff --git a/tests/unit/api/mfaapi.test.ts b/tests/unit/api/mfaapi.test.ts index 5c04cd7..3eed5f1 100644 --- a/tests/unit/api/mfaapi.test.ts +++ b/tests/unit/api/mfaapi.test.ts @@ -1,4 +1,4 @@ -//@ts-nocheck +import axios from 'axios'; import { MFAApi } from '../../../api'; import { Configuration } from '../../../configuration'; import { CodeRequest, VerifyCodeRequest } from '../../../models'; @@ -66,10 +66,14 @@ describe('MFAApi', () => { describe('HTTP Errors', () => { test('400', async () => { + expect.assertions(1); try { + // @ts-expect-error intentionally empty body to trigger 400 await mfaApi.generateMessagingCode(BW_ACCOUNT_ID, {}); } catch (e) { - expect(e.response.status).toEqual(400); + if (axios.isAxiosError(e)) { + expect(e.response?.status).toEqual(400); + } } }); }); diff --git a/tests/unit/api/phone-number-lookup-api.test.ts b/tests/unit/api/phone-number-lookup-api.test.ts index 333e75a..c773b92 100644 --- a/tests/unit/api/phone-number-lookup-api.test.ts +++ b/tests/unit/api/phone-number-lookup-api.test.ts @@ -1,4 +1,3 @@ -//@ts-nocheck import { PhoneNumberLookupApi } from "../../../api"; import { Configuration } from "../../../configuration"; import { @@ -28,12 +27,12 @@ describe('PhoneNumberLookupApi', () => { const { status, data } = await phoneNumberLookupApi.createAsyncBulkLookup(BW_ACCOUNT_ID, request); expect(status).toEqual(202); - expect(data.links[0]).toBeDefined(); - expect(data.links[0].rel).toBeString(); - expect(data.links[0].href).toBeString(); - expect(data.links[0].method).toBeString(); - expect(data.data.requestId).toBeString(); - expect(data.data.status).toBeOneOf(Object.values(InProgressLookupStatusEnum)); + expect(data.links![0]).toBeDefined(); + expect(data.links![0].rel).toBeString(); + expect(data.links![0].href).toBeString(); + expect(data.links![0].method).toBeString(); + expect(data.data!.requestId).toBeString(); + expect(data.data!.status).toBeOneOf(Object.values(InProgressLookupStatusEnum)); expect(data.errors).toBeInstanceOf(Array); }); }); @@ -48,18 +47,18 @@ describe('PhoneNumberLookupApi', () => { const { status, data } = await phoneNumberLookupApi.createSyncLookup(BW_ACCOUNT_ID, request); expect(status).toEqual(200); - expect(data.data.requestId).toBeString(); - expect(data.data.status).toBeOneOf(Object.values(CompletedLookupStatusEnum)); - expect(data.data.results).toBeInstanceOf(Array); - expect(data.data.results[0]).toBeDefined(); - expect(data.data.results[0].phoneNumber).toBeString(); - expect(data.data.results[0].lineType).toBeOneOf(Object.values(LineTypeEnum)); - expect(data.data.results[0].messagingProvider).toBeString(); - expect(data.data.results[0].voiceProvider).toBeString(); - expect(data.data.results[0].countryCodeA3).toBeString(); - expect(data.data.results[0].latestMessageDeliveryStatus).toBeOneOf(Object.values(LatestMessageDeliveryStatusEnum)); - expect(data.data.results[0].initialMessageDeliveryStatusDate).toBeDateString(); - expect(data.data.results[0].latestMessageDeliveryStatusDate).toBeDateString(); + expect(data.data!.requestId).toBeString(); + expect(data.data!.status).toBeOneOf(Object.values(CompletedLookupStatusEnum)); + expect(data.data!.results).toBeInstanceOf(Array); + expect(data.data!.results![0]).toBeDefined(); + expect(data.data!.results![0].phoneNumber).toBeString(); + expect(data.data!.results![0].lineType).toBeOneOf(Object.values(LineTypeEnum)); + expect(data.data!.results![0].messagingProvider).toBeString(); + expect(data.data!.results![0].voiceProvider).toBeString(); + expect(data.data!.results![0].countryCodeA3).toBeString(); + expect(data.data!.results![0].latestMessageDeliveryStatus).toBeOneOf(Object.values(LatestMessageDeliveryStatusEnum)); + expect(data.data!.results![0].initialMessageDeliveryStatusDate).toBeDateString(); + expect(data.data!.results![0].latestMessageDeliveryStatusDate).toBeDateString(); expect(data.errors).toBeInstanceOf(Array); }); }); @@ -69,18 +68,18 @@ describe('PhoneNumberLookupApi', () => { const { status, data } = await phoneNumberLookupApi.getAsyncBulkLookup(BW_ACCOUNT_ID, requestId); expect(status).toEqual(200); - expect(data.data.requestId).toBeString(); - expect(data.data.status).toBeOneOf(Object.values(InProgressLookupStatusEnum)); - expect(data.data.results).toBeInstanceOf(Array); - expect(data.data.results[0]).toBeDefined(); - expect(data.data.results[0].phoneNumber).toBeString(); - expect(data.data.results[0].lineType).toBeOneOf(Object.values(LineTypeEnum)); - expect(data.data.results[0].messagingProvider).toBeString(); - expect(data.data.results[0].voiceProvider).toBeString(); - expect(data.data.results[0].countryCodeA3).toBeString(); - expect(data.data.results[0].latestMessageDeliveryStatus).toBeOneOf(Object.values(LatestMessageDeliveryStatusEnum)); - expect(data.data.results[0].initialMessageDeliveryStatusDate).toBeDateString(); - expect(data.data.results[0].latestMessageDeliveryStatusDate).toBeDateString(); + expect(data.data!.requestId).toBeString(); + expect(data.data!.status).toBeOneOf(Object.values(InProgressLookupStatusEnum)); + expect(data.data!.results).toBeInstanceOf(Array); + expect(data.data!.results![0]).toBeDefined(); + expect(data.data!.results![0].phoneNumber).toBeString(); + expect(data.data!.results![0].lineType).toBeOneOf(Object.values(LineTypeEnum)); + expect(data.data!.results![0].messagingProvider).toBeString(); + expect(data.data!.results![0].voiceProvider).toBeString(); + expect(data.data!.results![0].countryCodeA3).toBeString(); + expect(data.data!.results![0].latestMessageDeliveryStatus).toBeOneOf(Object.values(LatestMessageDeliveryStatusEnum)); + expect(data.data!.results![0].initialMessageDeliveryStatusDate).toBeDateString(); + expect(data.data!.results![0].latestMessageDeliveryStatusDate).toBeDateString(); expect(data.errors).toBeInstanceOf(Array); }); }); diff --git a/tests/unit/api/recordings-api.test.ts b/tests/unit/api/recordings-api.test.ts index 37d8284..a7b9a51 100644 --- a/tests/unit/api/recordings-api.test.ts +++ b/tests/unit/api/recordings-api.test.ts @@ -1,7 +1,12 @@ -//@ts-nocheck import { RecordingsApi } from "../../../api"; import { Configuration } from "../../../configuration"; -import { CallDirectionEnum, FileFormatEnum, RecordingStateEnum } from "../../../models"; +import { + CallDirectionEnum, + FileFormatEnum, + RecordingStateEnum, + TranscribeRecording, + UpdateCallRecording +} from "../../../models"; describe('RecordingsApi', () => { const config = new Configuration({ @@ -16,7 +21,7 @@ describe('RecordingsApi', () => { describe('updateCallRecordingState', () => { test('should update call recording state', async () => { - const pauseRecording = { state: RecordingStateEnum.Paused }; + const pauseRecording: UpdateCallRecording = { state: RecordingStateEnum.Paused }; const { status } = await recordingsApi.updateCallRecordingState(BW_ACCOUNT_ID, callId, pauseRecording); @@ -130,7 +135,7 @@ describe('RecordingsApi', () => { describe('transcribeCallRecording', () => { test('should create a transcription request', async () => { - const transcribeRecording = { + const transcribeRecording: TranscribeRecording = { callbackUrl: `${MANTECA_BASE_URL}/transcriptions`, tag: callId }; diff --git a/tests/unit/api/statistics-api.test.ts b/tests/unit/api/statistics-api.test.ts index 3c38627..2d2631b 100644 --- a/tests/unit/api/statistics-api.test.ts +++ b/tests/unit/api/statistics-api.test.ts @@ -1,4 +1,4 @@ -//@ts-nocheck +import axios from 'axios'; import { StatisticsApi } from '../../../api'; import { Configuration } from '../../../configuration'; @@ -22,13 +22,16 @@ describe('StatisticsApi', () => { describe('HTTP Errors', () => { test('401', async () => { + expect.assertions(1); const unauthorizedConfig = new Configuration({ basePath: 'http://127.0.0.1:4010' }); const unauthorizedStatisticsApi = new StatisticsApi(unauthorizedConfig); try { await unauthorizedStatisticsApi.getStatistics(BW_ACCOUNT_ID); } catch (e) { - expect(e.response.status).toEqual(401); + if (axios.isAxiosError(e)) { + expect(e.response?.status).toEqual(401); + } } }); }); diff --git a/tests/unit/api/toll-free-verification-api.test.ts b/tests/unit/api/toll-free-verification-api.test.ts index b8062d9..d66d267 100644 --- a/tests/unit/api/toll-free-verification-api.test.ts +++ b/tests/unit/api/toll-free-verification-api.test.ts @@ -1,7 +1,15 @@ -//@ts-nocheck import { TollFreeVerificationApi } from '../../../api'; import { Configuration } from '../../../configuration'; -import { BusinessEntityTypeEnum, BusinessRegistrationIssuingCountryEnum, BusinessRegistrationTypeEnum, CallbackTypeEnum, TfvStatusEnum, WebhookSubscriptionTypeEnum } from '../../../models'; +import { + BusinessEntityTypeEnum, + BusinessRegistrationTypeEnum, + TfvStatusEnum, + TfvSubmissionWrapper, + VerificationRequest, + WebhookSubscriptionRequestSchema, + WebhookSubscriptionTypeEnum + +} from '../../../models'; describe('TollFreeVerificationApi', () => { const config = new Configuration({ @@ -11,7 +19,7 @@ describe('TollFreeVerificationApi', () => { }); const tfvApi = new TollFreeVerificationApi(config); - const webhookSubscriptionRequestSchema = { + const webhookSubscriptionRequestSchema: WebhookSubscriptionRequestSchema = { basicAuthentication: { username: 'username', password: 'password' @@ -90,25 +98,25 @@ describe('TollFreeVerificationApi', () => { expect(data.links!.previous).toBeString(); expect(data.links!.last).toBeString(); expect(data.errors).toBeInstanceOf(Array); - expect(data.errors[0]!.code).toBeNumber(); - expect(data.errors[0]!.description).toBeString(); - expect(data.errors[0]!.telephoneNumbers).toBeInstanceOf(Array); - expect(data.errors[0]!.telephoneNumbers[0].telephoneNumber).toBeString(); + expect(data.errors![0]!.code).toBeNumber(); + expect(data.errors![0]!.description).toBeString(); + expect(data.errors![0]!.telephoneNumbers).toBeInstanceOf(Array); + expect(data.errors![0]!.telephoneNumbers![0].telephoneNumber).toBeString(); expect(data.data).toBeInstanceOf(Array); - expect(data.data[0]!.id).toBeString(); - expect(data.data[0]!.accountId).toBeString(); - expect(data.data[0]!.callbackUrl).toBeString(); - expect(data.data[0]!.type).toBeOneOf(Object.values(WebhookSubscriptionTypeEnum)); - expect(data.data[0]!.basicAuthentication.username).toBeString(); - expect(data.data[0]!.basicAuthentication.password).toBeString(); - expect(data.data[0]!.createdDate).toBeDateString(); - expect(data.data[0]!.modifiedDate).toBeDateString(); + expect(data.data![0]!.id).toBeString(); + expect(data.data![0]!.accountId).toBeString(); + expect(data.data![0]!.callbackUrl).toBeString(); + expect(data.data![0]!.type).toBeOneOf(Object.values(WebhookSubscriptionTypeEnum)); + expect(data.data![0]!.basicAuthentication!.username).toBeString(); + expect(data.data![0]!.basicAuthentication!.password).toBeString(); + expect(data.data![0]!.createdDate).toBeDateString(); + expect(data.data![0]!.modifiedDate).toBeDateString(); }); }); describe('requestTollFreeVerification', () => { test('should request toll-free verification', async () => { - const verificationRequest = { + const verificationRequest: VerificationRequest = { businessAddress: { name: 'name', addr1: 'addr1', @@ -154,7 +162,7 @@ describe('TollFreeVerificationApi', () => { describe('updateTollFreeVerificationRequest', () => { test('should update toll-free verification request', async () => { - const tfvSubmissionWrapper = { + const tfvSubmissionWrapper: TfvSubmissionWrapper = { submission: undefined }; const { status } = await tfvApi.updateTollFreeVerificationRequest(BW_ACCOUNT_ID, '+18005551234', tfvSubmissionWrapper); diff --git a/tests/unit/api/transcriptions-api.test.ts b/tests/unit/api/transcriptions-api.test.ts index 3903968..ae15c3f 100644 --- a/tests/unit/api/transcriptions-api.test.ts +++ b/tests/unit/api/transcriptions-api.test.ts @@ -1,4 +1,3 @@ -//@ts-nocheck import { TranscriptionsApi } from "../../../api"; import { Configuration } from "../../../configuration"; import { CallTranscriptionDetectedLanguageEnum, CallTranscriptionTrackEnum } from "../../../models"; From b8ef8de4943f15907c28ab126594f755ea812824 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 18 May 2026 15:50:19 -0400 Subject: [PATCH 2/6] update enum tests --- .../models/business-entity-type-enum.test.ts | 7 +++++++ .../business-registration-type-enum.test.ts | 20 +++++++++++++++++++ tests/unit/models/call-direction-enum.test.ts | 4 ++++ tests/unit/models/call-state-enum.test.ts | 4 ++++ ...anscription-detected-language-enum.test.ts | 5 +++++ .../call-transcription-track-enum.test.ts | 4 ++++ .../unit/models/callback-method-enum.test.ts | 4 ++++ tests/unit/models/card-width-enum.test.ts | 4 ++++ .../completed-lookup-status-enum.test.ts | 5 +++++ .../unit/models/conference-state-enum.test.ts | 4 ++++ .../models/deactivation-event-enum.test.ts | 3 +++ tests/unit/models/file-format-enum.test.ts | 4 ++++ .../in-progress-lookup-status-enum.test.ts | 6 ++++++ .../models/inbound-callback-type-enum.test.ts | 5 +++++ ...atest-message-delivery-status-enum.test.ts | 6 ++++++ tests/unit/models/line-type-enum.test.ts | 6 ++++++ .../list-message-direction-enum.test.ts | 4 ++++ .../machine-detection-mode-enum.test.ts | 4 ++++ .../models/message-direction-enum.test.ts | 4 ++++ tests/unit/models/message-status-enum.test.ts | 10 ++++++++++ tests/unit/models/message-type-enum.test.ts | 5 +++++ ...multi-channel-message-channel-enum.test.ts | 5 +++++ tests/unit/models/priority-enum.test.ts | 4 ++++ tests/unit/models/product-type-enum.test.ts | 11 ++++++++++ .../unit/models/rbm-action-type-enum.test.ts | 8 ++++++++ .../unit/models/rbm-media-height-enum.test.ts | 5 +++++ tests/unit/models/rbm-open-url-enum.test.ts | 4 ++++ tests/unit/models/rbm-veb-view-enum.test.ts | 5 +++++ .../unit/models/recording-state-enum.test.ts | 4 ++++ .../unit/models/redirect-method-enum.test.ts | 4 ++++ .../standalone-card-orientation-enum.test.ts | 4 ++++ .../models/status-callback-type-enum.test.ts | 6 ++++++ .../models/tfv-callback-status-enum.test.ts | 4 ++++ tests/unit/models/tfv-status-enum.test.ts | 5 +++++ .../models/thumbnail-alignment-enum.test.ts | 4 ++++ .../webhook-subscription-type-enum.test.ts | 4 ++++ 36 files changed, 195 insertions(+) diff --git a/tests/unit/models/business-entity-type-enum.test.ts b/tests/unit/models/business-entity-type-enum.test.ts index b70dd70..e055450 100644 --- a/tests/unit/models/business-entity-type-enum.test.ts +++ b/tests/unit/models/business-entity-type-enum.test.ts @@ -7,5 +7,12 @@ describe('BusinessEntityTypeEnum', () => { expect(BusinessEntityTypeEnum.PublicProfit).toBe('PUBLIC_PROFIT'); expect(BusinessEntityTypeEnum.NonProfit).toBe('NON_PROFIT'); expect(BusinessEntityTypeEnum.Government).toBe('GOVERNMENT'); + expect(Object.values(BusinessEntityTypeEnum)).toEqual([ + 'SOLE_PROPRIETOR', + 'PRIVATE_PROFIT', + 'PUBLIC_PROFIT', + 'NON_PROFIT', + 'GOVERNMENT' + ]); }); }); diff --git a/tests/unit/models/business-registration-type-enum.test.ts b/tests/unit/models/business-registration-type-enum.test.ts index d8164f3..8e416ff 100644 --- a/tests/unit/models/business-registration-type-enum.test.ts +++ b/tests/unit/models/business-registration-type-enum.test.ts @@ -20,5 +20,25 @@ describe('BusinessRegistrationTypeEnum', () => { expect(BusinessRegistrationTypeEnum.Cnpj).toBe('CNPJ'); expect(BusinessRegistrationTypeEnum.Uid).toBe('UID'); expect(BusinessRegistrationTypeEnum.Other).toBe('OTHER'); + expect(Object.values(BusinessRegistrationTypeEnum)).toEqual([ + 'EIN', + 'CBN', + 'NEQ', + 'PROVINCIAL_NUMBER', + 'CRN', + 'VAT', + 'ACN', + 'ABN', + 'BRN', + 'SIREN', + 'SIRET', + 'NZBN', + 'UST_IDNR', + 'CIF', + 'NIF', + 'CNPJ', + 'UID', + 'OTHER' + ]); }); }); diff --git a/tests/unit/models/call-direction-enum.test.ts b/tests/unit/models/call-direction-enum.test.ts index 9631af8..685275c 100644 --- a/tests/unit/models/call-direction-enum.test.ts +++ b/tests/unit/models/call-direction-enum.test.ts @@ -4,5 +4,9 @@ describe('CallDirectionEnum', () => { test('should define the expected values', () => { expect(CallDirectionEnum.Inbound).toBe('inbound'); expect(CallDirectionEnum.Outbound).toBe('outbound'); + expect(Object.values(CallDirectionEnum)).toEqual([ + 'inbound', + 'outbound' + ]); }); }); diff --git a/tests/unit/models/call-state-enum.test.ts b/tests/unit/models/call-state-enum.test.ts index 2d46612..5ae2828 100644 --- a/tests/unit/models/call-state-enum.test.ts +++ b/tests/unit/models/call-state-enum.test.ts @@ -4,5 +4,9 @@ describe('CallStateEnum', () => { test('should define the expected values', () => { expect(CallStateEnum.Active).toBe('active'); expect(CallStateEnum.Completed).toBe('completed'); + expect(Object.values(CallStateEnum)).toEqual([ + 'active', + 'completed' + ]); }); }); diff --git a/tests/unit/models/call-transcription-detected-language-enum.test.ts b/tests/unit/models/call-transcription-detected-language-enum.test.ts index ab847b1..bda3dac 100644 --- a/tests/unit/models/call-transcription-detected-language-enum.test.ts +++ b/tests/unit/models/call-transcription-detected-language-enum.test.ts @@ -5,5 +5,10 @@ describe('CallTranscriptionTrackEnum', () => { expect(CallTranscriptionDetectedLanguageEnum.EnUs).toBe('en-US'); expect(CallTranscriptionDetectedLanguageEnum.EsUs).toBe('es-US'); expect(CallTranscriptionDetectedLanguageEnum.FrFr).toBe('fr-FR'); + expect(Object.values(CallTranscriptionDetectedLanguageEnum)).toEqual([ + 'en-US', + 'es-US', + 'fr-FR' + ]); }); }); diff --git a/tests/unit/models/call-transcription-track-enum.test.ts b/tests/unit/models/call-transcription-track-enum.test.ts index d457866..77cf4a1 100644 --- a/tests/unit/models/call-transcription-track-enum.test.ts +++ b/tests/unit/models/call-transcription-track-enum.test.ts @@ -4,5 +4,9 @@ describe('CallTranscriptionTrackEnum', () => { test('should define the expected values', () => { expect(CallTranscriptionTrackEnum.Inbound).toBe('inbound'); expect(CallTranscriptionTrackEnum.Outbound).toBe('outbound'); + expect(Object.values(CallTranscriptionTrackEnum)).toEqual([ + 'inbound', + 'outbound' + ]); }); }); diff --git a/tests/unit/models/callback-method-enum.test.ts b/tests/unit/models/callback-method-enum.test.ts index d9db33b..22cdd4e 100644 --- a/tests/unit/models/callback-method-enum.test.ts +++ b/tests/unit/models/callback-method-enum.test.ts @@ -4,5 +4,9 @@ describe('CallbackMethodEnum', () => { test('should define the expected values', () => { expect(CallbackMethodEnum.Get).toBe('GET'); expect(CallbackMethodEnum.Post).toBe('POST'); + expect(Object.values(CallbackMethodEnum)).toEqual([ + 'GET', + 'POST' + ]); }); }); diff --git a/tests/unit/models/card-width-enum.test.ts b/tests/unit/models/card-width-enum.test.ts index df7e9e9..77b3a9a 100644 --- a/tests/unit/models/card-width-enum.test.ts +++ b/tests/unit/models/card-width-enum.test.ts @@ -4,5 +4,9 @@ describe('CardWidthEnum', () => { test('should define the expected values', () => { expect(CardWidthEnum.Small).toBe('SMALL'); expect(CardWidthEnum.Medium).toBe('MEDIUM'); + expect(Object.values(CardWidthEnum)).toEqual([ + 'SMALL', + 'MEDIUM' + ]); }); }); diff --git a/tests/unit/models/completed-lookup-status-enum.test.ts b/tests/unit/models/completed-lookup-status-enum.test.ts index 431c1a6..f9ee710 100644 --- a/tests/unit/models/completed-lookup-status-enum.test.ts +++ b/tests/unit/models/completed-lookup-status-enum.test.ts @@ -5,5 +5,10 @@ describe('CompletedLookupStatusEnum', () => { expect(CompletedLookupStatusEnum.Complete).toBe('COMPLETE'); expect(CompletedLookupStatusEnum.PartialComplete).toBe('PARTIAL_COMPLETE'); expect(CompletedLookupStatusEnum.Failed).toBe('FAILED'); + expect(Object.values(CompletedLookupStatusEnum)).toEqual([ + 'COMPLETE', + 'PARTIAL_COMPLETE', + 'FAILED' + ]); }); }); diff --git a/tests/unit/models/conference-state-enum.test.ts b/tests/unit/models/conference-state-enum.test.ts index 4597c76..737c719 100644 --- a/tests/unit/models/conference-state-enum.test.ts +++ b/tests/unit/models/conference-state-enum.test.ts @@ -4,5 +4,9 @@ describe('ConferenceStateEnum', () => { test('should define the expected values', () => { expect(ConferenceStateEnum.Active).toBe('active'); expect(ConferenceStateEnum.Completed).toBe('completed'); + expect(Object.values(ConferenceStateEnum)).toEqual([ + 'active', + 'completed' + ]); }); }); diff --git a/tests/unit/models/deactivation-event-enum.test.ts b/tests/unit/models/deactivation-event-enum.test.ts index d7e53e5..e24044f 100644 --- a/tests/unit/models/deactivation-event-enum.test.ts +++ b/tests/unit/models/deactivation-event-enum.test.ts @@ -3,5 +3,8 @@ import { DeactivationEventEnum } from '../../../models/deactivation-event-enum'; describe('DeactivationEventEnum', () => { test('should define the expected values', () => { expect(DeactivationEventEnum.Deactivated).toBe('DEACTIVATED'); + expect(Object.values(DeactivationEventEnum)).toEqual([ + 'DEACTIVATED' + ]); }); }); diff --git a/tests/unit/models/file-format-enum.test.ts b/tests/unit/models/file-format-enum.test.ts index 4ea9afe..40ee425 100644 --- a/tests/unit/models/file-format-enum.test.ts +++ b/tests/unit/models/file-format-enum.test.ts @@ -4,5 +4,9 @@ describe('FileFormatEnum', () => { test('should define the expected values', () => { expect(FileFormatEnum.Mp3).toBe('mp3'); expect(FileFormatEnum.Wav).toBe('wav'); + expect(Object.values(FileFormatEnum)).toEqual([ + 'mp3', + 'wav' + ]); }); }); diff --git a/tests/unit/models/in-progress-lookup-status-enum.test.ts b/tests/unit/models/in-progress-lookup-status-enum.test.ts index f829f06..c0e991f 100644 --- a/tests/unit/models/in-progress-lookup-status-enum.test.ts +++ b/tests/unit/models/in-progress-lookup-status-enum.test.ts @@ -6,6 +6,12 @@ describe('InProgressLookupStatusEnum', () => { expect(InProgressLookupStatusEnum.Complete).toBe('COMPLETE'); expect(InProgressLookupStatusEnum.PartialComplete).toBe('PARTIAL_COMPLETE'); expect(InProgressLookupStatusEnum.Failed).toBe('FAILED'); + expect(Object.values(InProgressLookupStatusEnum)).toEqual([ + 'IN_PROGRESS', + 'COMPLETE', + 'PARTIAL_COMPLETE', + 'FAILED' + ]); }); }); diff --git a/tests/unit/models/inbound-callback-type-enum.test.ts b/tests/unit/models/inbound-callback-type-enum.test.ts index 54da6bd..5418bd8 100644 --- a/tests/unit/models/inbound-callback-type-enum.test.ts +++ b/tests/unit/models/inbound-callback-type-enum.test.ts @@ -5,5 +5,10 @@ describe('InboundCallbackTypeEnum', () => { expect(InboundCallbackTypeEnum.MessageReceived).toBe('message-received'); expect(InboundCallbackTypeEnum.RequestLocationResponse).toBe('request-location-response'); expect(InboundCallbackTypeEnum.SuggestionResponse).toBe('suggestion-response'); + expect(Object.values(InboundCallbackTypeEnum)).toEqual([ + 'message-received', + 'request-location-response', + 'suggestion-response' + ]); }); }); diff --git a/tests/unit/models/latest-message-delivery-status-enum.test.ts b/tests/unit/models/latest-message-delivery-status-enum.test.ts index 42ea3ac..aed5434 100644 --- a/tests/unit/models/latest-message-delivery-status-enum.test.ts +++ b/tests/unit/models/latest-message-delivery-status-enum.test.ts @@ -6,6 +6,12 @@ describe('LatestMessageDeliveryStatusEnum', () => { expect(LatestMessageDeliveryStatusEnum.Deactivated).toBe('DEACTIVATED'); expect(LatestMessageDeliveryStatusEnum.Unknown).toBe('UNKNOWN'); expect(LatestMessageDeliveryStatusEnum.NotEnabled).toBe('NOT_ENABLED'); + expect(Object.values(LatestMessageDeliveryStatusEnum)).toEqual([ + 'ACTIVE', + 'DEACTIVATED', + 'UNKNOWN', + 'NOT_ENABLED' + ]); }); }); diff --git a/tests/unit/models/line-type-enum.test.ts b/tests/unit/models/line-type-enum.test.ts index d1e429c..4e59bb9 100644 --- a/tests/unit/models/line-type-enum.test.ts +++ b/tests/unit/models/line-type-enum.test.ts @@ -6,6 +6,12 @@ describe('LineTypeEnum', () => { expect(LineTypeEnum.VoipFixed).toBe('VOIP-FIXED'); expect(LineTypeEnum.Mobile).toBe('MOBILE'); expect(LineTypeEnum.Voip).toBe('VOIP'); + expect(Object.values(LineTypeEnum)).toEqual([ + 'FIXED', + 'VOIP-FIXED', + 'MOBILE', + 'VOIP' + ]); }); }); diff --git a/tests/unit/models/list-message-direction-enum.test.ts b/tests/unit/models/list-message-direction-enum.test.ts index e5b54fd..f9e4d97 100644 --- a/tests/unit/models/list-message-direction-enum.test.ts +++ b/tests/unit/models/list-message-direction-enum.test.ts @@ -4,5 +4,9 @@ describe('ListMessageDirectionEnum', () => { test('should define the expected values', () => { expect(ListMessageDirectionEnum.Inbound).toBe('INBOUND'); expect(ListMessageDirectionEnum.Outbound).toBe('OUTBOUND'); + expect(Object.values(ListMessageDirectionEnum)).toEqual([ + 'INBOUND', + 'OUTBOUND' + ]); }); }); diff --git a/tests/unit/models/machine-detection-mode-enum.test.ts b/tests/unit/models/machine-detection-mode-enum.test.ts index 22c5ee3..a60892e 100644 --- a/tests/unit/models/machine-detection-mode-enum.test.ts +++ b/tests/unit/models/machine-detection-mode-enum.test.ts @@ -4,5 +4,9 @@ describe('MachineDetectionModeEnum', () => { test('should define the expected values', () => { expect(MachineDetectionModeEnum.Sync).toBe('sync'); expect(MachineDetectionModeEnum.Async).toBe('async'); + expect(Object.values(MachineDetectionModeEnum)).toEqual([ + 'sync', + 'async' + ]); }); }); diff --git a/tests/unit/models/message-direction-enum.test.ts b/tests/unit/models/message-direction-enum.test.ts index af5a8b0..ebca751 100644 --- a/tests/unit/models/message-direction-enum.test.ts +++ b/tests/unit/models/message-direction-enum.test.ts @@ -4,5 +4,9 @@ describe('MessageDirectionEnum', () => { test('should define the expected values', () => { expect(MessageDirectionEnum.In).toBe('in'); expect(MessageDirectionEnum.Out).toBe('out'); + expect(Object.values(MessageDirectionEnum)).toEqual([ + 'in', + 'out' + ]); }); }); diff --git a/tests/unit/models/message-status-enum.test.ts b/tests/unit/models/message-status-enum.test.ts index 26fbb49..0949778 100644 --- a/tests/unit/models/message-status-enum.test.ts +++ b/tests/unit/models/message-status-enum.test.ts @@ -10,5 +10,15 @@ describe('MessageStatusEnum', () => { expect(MessageStatusEnum.Delivered).toBe('DELIVERED'); expect(MessageStatusEnum.Accepted).toBe('ACCEPTED'); expect(MessageStatusEnum.Undelivered).toBe('UNDELIVERED'); + expect(Object.values(MessageStatusEnum)).toEqual([ + 'RECEIVED', + 'QUEUED', + 'SENDING', + 'SENT', + 'FAILED', + 'DELIVERED', + 'ACCEPTED', + 'UNDELIVERED' + ]); }); }); diff --git a/tests/unit/models/message-type-enum.test.ts b/tests/unit/models/message-type-enum.test.ts index f143faa..4fbd399 100644 --- a/tests/unit/models/message-type-enum.test.ts +++ b/tests/unit/models/message-type-enum.test.ts @@ -5,5 +5,10 @@ describe('MessageTypeEnum', () => { expect(MessageTypeEnum.Sms).toBe('sms'); expect(MessageTypeEnum.Mms).toBe('mms'); expect(MessageTypeEnum.Rcs).toBe('rcs'); + expect(Object.values(MessageTypeEnum)).toEqual([ + 'sms', + 'mms', + 'rcs' + ]); }); }); diff --git a/tests/unit/models/multi-channel-message-channel-enum.test.ts b/tests/unit/models/multi-channel-message-channel-enum.test.ts index 03cc427..94e48e8 100644 --- a/tests/unit/models/multi-channel-message-channel-enum.test.ts +++ b/tests/unit/models/multi-channel-message-channel-enum.test.ts @@ -5,5 +5,10 @@ describe('MultiChannelMessageChannelEnum', () => { expect(MultiChannelMessageChannelEnum.Rbm).toBe('RBM'); expect(MultiChannelMessageChannelEnum.Sms).toBe('SMS'); expect(MultiChannelMessageChannelEnum.Mms).toBe('MMS'); + expect(Object.values(MultiChannelMessageChannelEnum)).toEqual([ + 'RBM', + 'SMS', + 'MMS' + ]); }); }); diff --git a/tests/unit/models/priority-enum.test.ts b/tests/unit/models/priority-enum.test.ts index c1bcfc4..2891f02 100644 --- a/tests/unit/models/priority-enum.test.ts +++ b/tests/unit/models/priority-enum.test.ts @@ -4,5 +4,9 @@ describe('PriorityEnum', () => { test('should define the expected values', () => { expect(PriorityEnum.Default).toBe('default'); expect(PriorityEnum.High).toBe('high'); + expect(Object.values(PriorityEnum)).toEqual([ + 'default', + 'high' + ]); }); }); diff --git a/tests/unit/models/product-type-enum.test.ts b/tests/unit/models/product-type-enum.test.ts index 2c61992..06f204c 100644 --- a/tests/unit/models/product-type-enum.test.ts +++ b/tests/unit/models/product-type-enum.test.ts @@ -11,5 +11,16 @@ describe('ProductTypeEnum', () => { expect(ProductTypeEnum.RbmMedia).toBe('RBM_MEDIA'); expect(ProductTypeEnum.RbmRich).toBe('RBM_RICH'); expect(ProductTypeEnum.RbmConversational).toBe('RBM_CONVERSATIONAL'); + expect(Object.values(ProductTypeEnum)).toEqual([ + 'LOCAL_A2P', + 'P2P', + 'SHORT_CODE_REACH', + 'TOLL_FREE', + 'HOSTED_SHORT_CODE', + 'ALPHA_NUMERIC', + 'RBM_MEDIA', + 'RBM_RICH', + 'RBM_CONVERSATIONAL' + ]); }); }); diff --git a/tests/unit/models/rbm-action-type-enum.test.ts b/tests/unit/models/rbm-action-type-enum.test.ts index f393869..dbb74ca 100644 --- a/tests/unit/models/rbm-action-type-enum.test.ts +++ b/tests/unit/models/rbm-action-type-enum.test.ts @@ -8,5 +8,13 @@ describe('RbmActionTypeEnum', () => { expect(RbmActionTypeEnum.CreateCalendarEvent).toBe('CREATE_CALENDAR_EVENT'); expect(RbmActionTypeEnum.OpenUrl).toBe('OPEN_URL'); expect(RbmActionTypeEnum.RequestLocation).toBe('REQUEST_LOCATION'); + expect(Object.values(RbmActionTypeEnum)).toEqual([ + 'REPLY', + 'DIAL_PHONE', + 'SHOW_LOCATION', + 'CREATE_CALENDAR_EVENT', + 'OPEN_URL', + 'REQUEST_LOCATION' + ]); }); }); diff --git a/tests/unit/models/rbm-media-height-enum.test.ts b/tests/unit/models/rbm-media-height-enum.test.ts index 54c707b..e17d4d5 100644 --- a/tests/unit/models/rbm-media-height-enum.test.ts +++ b/tests/unit/models/rbm-media-height-enum.test.ts @@ -5,5 +5,10 @@ describe('RbmMediaHeightEnum', () => { expect(RbmMediaHeightEnum.Short).toBe('SHORT'); expect(RbmMediaHeightEnum.Medium).toBe('MEDIUM'); expect(RbmMediaHeightEnum.Tall).toBe('TALL'); + expect(Object.values(RbmMediaHeightEnum)).toEqual([ + 'SHORT', + 'MEDIUM', + 'TALL' + ]); }); }); diff --git a/tests/unit/models/rbm-open-url-enum.test.ts b/tests/unit/models/rbm-open-url-enum.test.ts index 2ba1209..1ae438a 100644 --- a/tests/unit/models/rbm-open-url-enum.test.ts +++ b/tests/unit/models/rbm-open-url-enum.test.ts @@ -4,5 +4,9 @@ describe('RbmOpenUrlEnum', () => { test('should define the expected values', () => { expect(RbmOpenUrlEnum.Browser).toBe('BROWSER'); expect(RbmOpenUrlEnum.Webview).toBe('WEBVIEW'); + expect(Object.values(RbmOpenUrlEnum)).toEqual([ + 'BROWSER', + 'WEBVIEW' + ]); }); }); diff --git a/tests/unit/models/rbm-veb-view-enum.test.ts b/tests/unit/models/rbm-veb-view-enum.test.ts index a4019b6..62bb7ab 100644 --- a/tests/unit/models/rbm-veb-view-enum.test.ts +++ b/tests/unit/models/rbm-veb-view-enum.test.ts @@ -5,5 +5,10 @@ describe('RbmWebViewEnum', () => { expect(RbmWebViewEnum.Full).toBe('FULL'); expect(RbmWebViewEnum.Half).toBe('HALF'); expect(RbmWebViewEnum.Tall).toBe('TALL'); + expect(Object.values(RbmWebViewEnum)).toEqual([ + 'FULL', + 'HALF', + 'TALL' + ]); }); }); diff --git a/tests/unit/models/recording-state-enum.test.ts b/tests/unit/models/recording-state-enum.test.ts index 1585e38..a71e3cf 100644 --- a/tests/unit/models/recording-state-enum.test.ts +++ b/tests/unit/models/recording-state-enum.test.ts @@ -4,5 +4,9 @@ describe('RecordingStateEnum', () => { test('should define the expected values', () => { expect(RecordingStateEnum.Paused).toBe('paused'); expect(RecordingStateEnum.Recording).toBe('recording'); + expect(Object.values(RecordingStateEnum)).toEqual([ + 'paused', + 'recording' + ]); }); }); diff --git a/tests/unit/models/redirect-method-enum.test.ts b/tests/unit/models/redirect-method-enum.test.ts index 77b06a1..2b762e9 100644 --- a/tests/unit/models/redirect-method-enum.test.ts +++ b/tests/unit/models/redirect-method-enum.test.ts @@ -4,5 +4,9 @@ describe('RedirectMethodEnum', () => { test('should define the expected values', () => { expect(RedirectMethodEnum.Get).toBe('GET'); expect(RedirectMethodEnum.Post).toBe('POST'); + expect(Object.values(RedirectMethodEnum)).toEqual([ + 'GET', + 'POST' + ]); }); }); diff --git a/tests/unit/models/standalone-card-orientation-enum.test.ts b/tests/unit/models/standalone-card-orientation-enum.test.ts index ec73044..ef02f25 100644 --- a/tests/unit/models/standalone-card-orientation-enum.test.ts +++ b/tests/unit/models/standalone-card-orientation-enum.test.ts @@ -4,5 +4,9 @@ describe('StandaloneCardOrientationEnum', () => { test('should define the expected values', () => { expect(StandaloneCardOrientationEnum.Horizontal).toBe('HORIZONTAL'); expect(StandaloneCardOrientationEnum.Vertical).toBe('VERTICAL'); + expect(Object.values(StandaloneCardOrientationEnum)).toEqual([ + 'HORIZONTAL', + 'VERTICAL' + ]); }); }); diff --git a/tests/unit/models/status-callback-type-enum.test.ts b/tests/unit/models/status-callback-type-enum.test.ts index 590c95b..db5463b 100644 --- a/tests/unit/models/status-callback-type-enum.test.ts +++ b/tests/unit/models/status-callback-type-enum.test.ts @@ -6,5 +6,11 @@ describe('StatusCallbackTypeEnum', () => { expect(StatusCallbackTypeEnum.MessageDelivered).toBe('message-delivered'); expect(StatusCallbackTypeEnum.MessageFailed).toBe('message-failed'); expect(StatusCallbackTypeEnum.MessageRead).toBe('message-read'); + expect(Object.values(StatusCallbackTypeEnum)).toEqual([ + 'message-sending', + 'message-delivered', + 'message-failed', + 'message-read' + ]); }); }); diff --git a/tests/unit/models/tfv-callback-status-enum.test.ts b/tests/unit/models/tfv-callback-status-enum.test.ts index a7e81fd..87cdda9 100644 --- a/tests/unit/models/tfv-callback-status-enum.test.ts +++ b/tests/unit/models/tfv-callback-status-enum.test.ts @@ -4,5 +4,9 @@ describe('TfvCallbackStatusEnum', () => { test('should define the expected values', () => { expect(TfvCallbackStatusEnum.Verified).toBe('VERIFIED'); expect(TfvCallbackStatusEnum.Unverified).toBe('UNVERIFIED'); + expect(Object.values(TfvCallbackStatusEnum)).toEqual([ + 'VERIFIED', + 'UNVERIFIED' + ]); }); }); diff --git a/tests/unit/models/tfv-status-enum.test.ts b/tests/unit/models/tfv-status-enum.test.ts index b74122b..885c1b1 100644 --- a/tests/unit/models/tfv-status-enum.test.ts +++ b/tests/unit/models/tfv-status-enum.test.ts @@ -5,5 +5,10 @@ describe('TfvStatusEnum', () => { expect(TfvStatusEnum.Verified).toBe('VERIFIED'); expect(TfvStatusEnum.Unverified).toBe('UNVERIFIED'); expect(TfvStatusEnum.Pending).toBe('PENDING'); + expect(Object.values(TfvStatusEnum)).toEqual([ + 'VERIFIED', + 'UNVERIFIED', + 'PENDING' + ]); }); }); diff --git a/tests/unit/models/thumbnail-alignment-enum.test.ts b/tests/unit/models/thumbnail-alignment-enum.test.ts index 312c164..fe938b0 100644 --- a/tests/unit/models/thumbnail-alignment-enum.test.ts +++ b/tests/unit/models/thumbnail-alignment-enum.test.ts @@ -3,5 +3,9 @@ describe('ThumbnailAlignmentEnum', () => { test('should define the expected values', () => { expect(ThumbnailAlignmentEnum.Left).toBe('LEFT'); expect(ThumbnailAlignmentEnum.Right).toBe('RIGHT'); + expect(Object.values(ThumbnailAlignmentEnum)).toEqual([ + 'LEFT', + 'RIGHT' + ]); }); }); diff --git a/tests/unit/models/webhook-subscription-type-enum.test.ts b/tests/unit/models/webhook-subscription-type-enum.test.ts index 757610f..398b55e 100644 --- a/tests/unit/models/webhook-subscription-type-enum.test.ts +++ b/tests/unit/models/webhook-subscription-type-enum.test.ts @@ -4,5 +4,9 @@ describe('WebhookSubscriptionTypeEnum', () => { test('should define the expected values', () => { expect(WebhookSubscriptionTypeEnum.TollfreeVerificationStatus).toBe('TOLLFREE_VERIFICATION_STATUS'); expect(WebhookSubscriptionTypeEnum.MessagingPortoutApprovalStatus).toBe('MESSAGING_PORTOUT_APPROVAL_STATUS'); + expect(Object.values(WebhookSubscriptionTypeEnum)).toEqual([ + 'TOLLFREE_VERIFICATION_STATUS', + 'MESSAGING_PORTOUT_APPROVAL_STATUS' + ]); }); }); From 714306c3eaabf1de7d84afb40e9430b041edc5ee Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 18 May 2026 15:53:11 -0400 Subject: [PATCH 3/6] jest config --- jest.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jest.config.js b/jest.config.js index e694c84..1386960 100644 --- a/jest.config.js +++ b/jest.config.js @@ -3,6 +3,9 @@ module.exports = { preset: 'ts-jest', testEnvironment: 'node', setupFilesAfterEnv: ["jest-extended/all"], + transform: { + '^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tests/tsconfig.json' }] + }, globals: { 'BW_USERNAME': process.env.BW_USERNAME, 'BW_PASSWORD': process.env.BW_PASSWORD, From 3edc94187ef634fa3d2857ff952409df567413c1 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 18 May 2026 16:32:33 -0400 Subject: [PATCH 4/6] update current tests --- .../models/create-endpoint-response-data.test.ts | 6 ++---- tests/unit/models/create-endpoint-response.test.ts | 8 ++++---- tests/unit/models/device.test.ts | 3 +-- tests/unit/models/endpoint-event.test.ts | 12 +++++------- tests/unit/models/endpoint-response.test.ts | 4 ++-- tests/unit/models/endpoint.test.ts | 6 ++---- tests/unit/models/endpoints.test.ts | 10 ++++------ tests/unit/models/list-endpoints-response.test.ts | 6 ++---- 8 files changed, 22 insertions(+), 33 deletions(-) diff --git a/tests/unit/models/create-endpoint-response-data.test.ts b/tests/unit/models/create-endpoint-response-data.test.ts index 45df605..a032581 100644 --- a/tests/unit/models/create-endpoint-response-data.test.ts +++ b/tests/unit/models/create-endpoint-response-data.test.ts @@ -29,10 +29,8 @@ describe('CreateEndpointResponseData', () => { expect(responseData.endpointId).toBe('ep-123456'); expect(responseData.type).toBe(EndpointTypeEnum.Webrtc); expect(responseData.status).toBe(EndpointStatusEnum.Connected); - expect(new Date(responseData.creationTimestamp).getFullYear()).toBe(2024); - expect(new Date(responseData.creationTimestamp).toISOString()).toBe('2024-02-18T10:30:00.000Z'); - expect(new Date(responseData.expirationTimestamp).getFullYear()).toBe(2024); - expect(new Date(responseData.expirationTimestamp).toISOString()).toBe('2024-02-19T10:30:00.000Z'); + expect(responseData.creationTimestamp).toBe('2024-02-18T10:30:00Z'); + expect(responseData.expirationTimestamp).toBe('2024-02-19T10:30:00Z'); expect(responseData.token).toBe('xxxxx.yyyyy.zzzzz'); expect(responseData.tag).toBe('endpoint-tag'); expect(responseData.devices).toHaveLength(1); diff --git a/tests/unit/models/create-endpoint-response.test.ts b/tests/unit/models/create-endpoint-response.test.ts index 2ccfdd6..e3ae557 100644 --- a/tests/unit/models/create-endpoint-response.test.ts +++ b/tests/unit/models/create-endpoint-response.test.ts @@ -62,12 +62,12 @@ describe('CreateEndpointResponse', () => { expect(response.links[0].rel).toBe('self'); expect(response.links[0].method).toBe('POST'); expect(response.data.endpointId).toBe('ep-123456'); - expect(response.data.type).toBe('WEBRTC'); - expect(response.data.status).toBe('CONNECTED'); + expect(response.data.type).toBe(EndpointTypeEnum.Webrtc); + expect(response.data.status).toBe(EndpointStatusEnum.Connected); expect(response.data.token).toBe('xxxxx.yyyyy.zzzzz'); expect(response.data.tag).toBe('webrtc-endpoint'); - expect(new Date(response.data.creationTimestamp).getFullYear()).toBe(2024); - expect(new Date(response.data.expirationTimestamp).getFullYear()).toBe(2024); + expect(response.data.creationTimestamp).toBe('2024-02-18T10:30:00Z'); + expect(response.data.expirationTimestamp).toBe('2024-02-19T10:30:00Z'); expect(response.data.devices).toHaveLength(1); expect(response.data.devices![0].deviceId).toBe('dev-1'); expect(response.data.devices![0].deviceName).toBe('Chrome Browser'); diff --git a/tests/unit/models/device.test.ts b/tests/unit/models/device.test.ts index 6972189..740cc89 100644 --- a/tests/unit/models/device.test.ts +++ b/tests/unit/models/device.test.ts @@ -13,7 +13,6 @@ describe('Device', () => { expect(device.deviceId).toBe('dev-1234'); expect(device.deviceName).toBe('Mobile App'); expect(device.status).toBe(DeviceStatusEnum.Connected); - expect(new Date(device.creationTimestamp).getFullYear()).toBe(2024); - expect(new Date(device.creationTimestamp).toISOString()).toBe('2024-02-18T10:30:00.000Z'); + expect(device.creationTimestamp).toBe('2024-02-18T10:30:00Z'); }); }); diff --git a/tests/unit/models/endpoint-event.test.ts b/tests/unit/models/endpoint-event.test.ts index 220e25b..f959b70 100644 --- a/tests/unit/models/endpoint-event.test.ts +++ b/tests/unit/models/endpoint-event.test.ts @@ -27,14 +27,12 @@ describe('EndpointEvent', () => { }; expect(event.endpointId).toBe('ep-123456'); - expect(event.type).toBe('WEBRTC'); - expect(event.status).toBe('CONNECTED'); - expect(new Date(event.creationTimestamp).getFullYear()).toBe(2024); - expect(new Date(event.creationTimestamp).toISOString()).toBe('2024-02-18T10:30:00.000Z'); - expect(new Date(event.expirationTimestamp).getFullYear()).toBe(2024); - expect(new Date(event.expirationTimestamp).toISOString()).toBe('2024-02-19T10:30:00.000Z'); + expect(event.type).toBe(EndpointTypeEnum.Webrtc); + expect(event.status).toBe(EndpointStatusEnum.Connected); + expect(event.creationTimestamp).toBe('2024-02-18T10:30:00Z'); + expect(event.expirationTimestamp).toBe('2024-02-19T10:30:00Z'); expect(event.tag).toBe('test-event'); - expect(new Date(event.eventTime).toISOString()).toBe('2024-02-18T10:35:00.000Z'); + expect(event.eventTime).toBe('2024-02-18T10:35:00Z'); expect(event.eventType).toBe(EndpointEventTypeEnum.DeviceConnected); expect(event.device?.deviceId).toBe('dev-1'); expect(event.device?.deviceName).toBe('Chrome Browser'); diff --git a/tests/unit/models/endpoint-response.test.ts b/tests/unit/models/endpoint-response.test.ts index 6219079..3ca6bb7 100644 --- a/tests/unit/models/endpoint-response.test.ts +++ b/tests/unit/models/endpoint-response.test.ts @@ -63,8 +63,8 @@ describe('EndpointResponse', () => { expect(response.data.endpointId).toBe('ep-123456'); expect(response.data.type).toBe(EndpointTypeEnum.Webrtc); expect(response.data.status).toBe(EndpointStatusEnum.Connected); - expect(new Date(response.data.creationTimestamp).getFullYear()).toBe(2024); - expect(new Date(response.data.expirationTimestamp).getFullYear()).toBe(2024); + expect(response.data.creationTimestamp).toBe('2024-02-18T10:30:00Z'); + expect(response.data.expirationTimestamp).toBe('2024-02-19T10:30:00Z'); expect(response.data.tag).toBe('test-endpoint'); expect(response.data.devices).toHaveLength(1); expect(response.data.devices![0].deviceId).toBe('dev-1'); diff --git a/tests/unit/models/endpoint.test.ts b/tests/unit/models/endpoint.test.ts index f35ccb8..c08a502 100644 --- a/tests/unit/models/endpoint.test.ts +++ b/tests/unit/models/endpoint.test.ts @@ -33,10 +33,8 @@ describe('Endpoint', () => { expect(endpoint.endpointId).toBe('ep-123456'); expect(endpoint.type).toBe(EndpointTypeEnum.Webrtc); expect(endpoint.status).toBe(EndpointStatusEnum.Connected); - expect(new Date(endpoint.creationTimestamp).getFullYear()).toBe(2024); - expect(new Date(endpoint.creationTimestamp).toISOString()).toBe('2024-02-18T10:30:00.000Z'); - expect(new Date(endpoint.expirationTimestamp).getFullYear()).toBe(2024); - expect(new Date(endpoint.expirationTimestamp).toISOString()).toBe('2024-02-19T10:30:00.000Z'); + expect(endpoint.creationTimestamp).toBe('2024-02-18T10:30:00Z'); + expect(endpoint.expirationTimestamp).toBe('2024-02-19T10:30:00Z'); expect(endpoint.tag).toBe('endpoint-tag'); expect(endpoint.devices).toHaveLength(2); expect(endpoint.devices![0].deviceId).toBe('dev-1'); diff --git a/tests/unit/models/endpoints.test.ts b/tests/unit/models/endpoints.test.ts index 5a2505f..3bae839 100644 --- a/tests/unit/models/endpoints.test.ts +++ b/tests/unit/models/endpoints.test.ts @@ -14,12 +14,10 @@ describe('Endpoints', () => { }; expect(endpoint.endpointId).toBe('ep-123456'); - expect(endpoint.type).toBe('WEBRTC'); - expect(endpoint.status).toBe('CONNECTED'); - expect(new Date(endpoint.creationTimestamp).getFullYear()).toBe(2024); - expect(new Date(endpoint.creationTimestamp).toISOString()).toBe('2024-02-18T10:30:00.000Z'); - expect(new Date(endpoint.expirationTimestamp).getFullYear()).toBe(2024); - expect(new Date(endpoint.expirationTimestamp).toISOString()).toBe('2024-02-19T10:30:00.000Z'); + expect(endpoint.type).toBe(EndpointTypeEnum.Webrtc); + expect(endpoint.status).toBe(EndpointStatusEnum.Connected); + expect(endpoint.creationTimestamp).toBe('2024-02-18T10:30:00Z'); + expect(endpoint.expirationTimestamp).toBe('2024-02-19T10:30:00Z'); expect(endpoint.tag).toBe('test-endpoint'); }); }); diff --git a/tests/unit/models/list-endpoints-response.test.ts b/tests/unit/models/list-endpoints-response.test.ts index 7373694..1e81300 100644 --- a/tests/unit/models/list-endpoints-response.test.ts +++ b/tests/unit/models/list-endpoints-response.test.ts @@ -77,10 +77,8 @@ describe('ListEndpointsResponse', () => { expect(response.data[1].endpointId).toBe('ep-002'); expect(response.data[1].type).toBe(EndpointTypeEnum.Webrtc); expect(response.data[1].status).toBe(EndpointStatusEnum.Disconnected); - expect(new Date(response.data[1].creationTimestamp).getFullYear()).toBe(2024); - expect(new Date(response.data[1].creationTimestamp).toISOString()).toBe('2024-02-18T10:30:00.000Z'); - expect(new Date(response.data[1].expirationTimestamp).getFullYear()).toBe(2024); - expect(new Date(response.data[1].expirationTimestamp).toISOString()).toBe('2024-02-19T10:30:00.000Z'); + expect(response.data[1].creationTimestamp).toBe('2024-02-18T10:30:00Z'); + expect(response.data[1].expirationTimestamp).toBe('2024-02-19T10:30:00Z'); expect(response.errors).toHaveLength(1); expect(response.errors[0].id).toBe('err-500'); expect(response.errors[0].type).toBe('internal-error'); From 3a973ba13ff37496fd31ff1061a30b158b962193 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Mon, 18 May 2026 16:58:37 -0400 Subject: [PATCH 5/6] add unit tests --- tests/unit/models/account-statistics.test.ts | 13 +++++ .../models/additional-denial-reason.test.ts | 15 +++++ tests/unit/models/address.test.ts | 23 ++++++++ tests/unit/models/answer-callback.test.ts | 39 +++++++++++++ .../unit/models/async-lookup-request.test.ts | 11 ++++ tests/unit/models/blocked-webhook.test.ts | 22 +++++++ .../models/bridge-complete-callback.test.ts | 42 ++++++++++++++ .../bridge-target-complete-callback.test.ts | 36 ++++++++++++ .../models/call-recording-metadata.test.ts | 50 ++++++++++++++++ tests/unit/models/call-state.test.ts | 46 +++++++++++++++ .../call-transcription-metadata.test.ts | 15 +++++ .../call-transcription-response.test.ts | 17 ++++++ tests/unit/models/call-transcription.test.ts | 19 ++++++ tests/unit/models/code-request.test.ts | 21 +++++++ .../conference-completed-callback.test.ts | 19 ++++++ .../conference-created-callback.test.ts | 19 ++++++ .../conference-member-exit-callback.test.ts | 25 ++++++++ .../conference-member-join-callback.test.ts | 25 ++++++++ tests/unit/models/conference-member.test.ts | 21 +++++++ ...rence-recording-available-callback.test.ts | 38 ++++++++++++ .../conference-recording-metadata.test.ts | 34 +++++++++++ .../conference-redirect-callback.test.ts | 19 ++++++ tests/unit/models/conference.test.ts | 26 +++++++++ tests/unit/models/contact.test.ts | 17 ++++++ ...te-async-bulk-lookup-response-data.test.ts | 14 +++++ .../create-async-bulk-lookup-response.test.ts | 16 +++++ .../unit/models/create-call-response.test.ts | 52 +++++++++++++++++ tests/unit/models/create-call.test.ts | 53 +++++++++++++++++ .../create-message-request-error.test.ts | 15 +++++ ...ate-multi-channel-message-response.test.ts | 16 +++++ .../create-sync-lookup-response-data.test.ts | 16 +++++ .../create-sync-lookup-response.test.ts | 16 +++++ tests/unit/models/disconnect-callback.test.ts | 44 ++++++++++++++ tests/unit/models/diversion.test.ts | 23 ++++++++ tests/unit/models/dtmf-callback.test.ts | 44 ++++++++++++++ tests/unit/models/error-object.test.ts | 16 +++++ tests/unit/models/error-source.test.ts | 17 ++++++ tests/unit/models/failure-webhook.test.ts | 21 +++++++ tests/unit/models/field-error.test.ts | 13 +++++ tests/unit/models/gather-callback.test.ts | 46 +++++++++++++++ ...et-async-bulk-lookup-response-data.test.ts | 16 +++++ .../get-async-bulk-lookup-response.test.ts | 16 +++++ .../models/inbound-callback-message.test.ts | 48 +++++++++++++++ tests/unit/models/inbound-callback.test.ts | 23 ++++++++ tests/unit/models/initiate-callback.test.ts | 38 ++++++++++++ tests/unit/models/link-schema.test.ts | 15 +++++ tests/unit/models/link.test.ts | 13 +++++ tests/unit/models/links-object.test.ts | 17 ++++++ tests/unit/models/list-message-item.test.ts | 58 +++++++++++++++++++ .../unit/models/lookup-error-response.test.ts | 13 +++++ .../models/lookup-error-schema-meta.test.ts | 15 +++++ tests/unit/models/lookup-error-schema.test.ts | 18 ++++++ tests/unit/models/lookup-result.test.ts | 36 ++++++++++++ ...achine-detection-complete-callback.test.ts | 39 +++++++++++++ .../machine-detection-configuration.test.ts | 41 +++++++++++++ .../models/machine-detection-result.test.ts | 13 +++++ tests/unit/models/media.test.ts | 15 +++++ tests/unit/models/message-request.test.ts | 27 +++++++++ tests/unit/models/message.test.ts | 39 +++++++++++++ tests/unit/models/messages-list.test.ts | 16 +++++ .../models/messaging-code-response.test.ts | 11 ++++ .../models/messaging-request-error.test.ts | 13 +++++ .../mfa-forbidden-request-error.test.ts | 11 ++++ tests/unit/models/mfa-request-error.test.ts | 13 +++++ .../mfa-unauthorized-request-error.test.ts | 11 ++++ .../models/mms-message-content-file.test.ts | 11 ++++ tests/unit/models/mms-message-content.test.ts | 13 +++++ ...ulti-channel-action-calendar-event.test.ts | 24 ++++++++ .../unit/models/multi-channel-action.test.ts | 40 +++++++++++++ ...lti-channel-channel-list-mmsobject.test.ts | 19 ++++++ ...el-channel-list-mmsresponse-object.test.ts | 21 +++++++ ...i-channel-channel-list-object-base.test.ts | 16 +++++ ...-channel-channel-list-owner-object.test.ts | 11 ++++ ...lti-channel-channel-list-rbmobject.test.ts | 19 ++++++ ...el-channel-list-rbmresponse-object.test.ts | 21 +++++++ ...hannel-channel-list-request-object.test.ts | 19 ++++++ ...annel-channel-list-response-object.test.ts | 21 +++++++ ...lti-channel-channel-list-smsobject.test.ts | 19 ++++++ ...el-channel-list-smsresponse-object.test.ts | 21 +++++++ tests/unit/models/multi-channel-error.test.ts | 13 +++++ .../multi-channel-message-content.test.ts | 14 +++++ .../multi-channel-message-request.test.ts | 20 +++++++ ...ulti-channel-message-response-data.test.ts | 28 +++++++++ tests/unit/models/opt-in-workflow.test.ts | 15 +++++ tests/unit/models/page-info.test.ts | 17 ++++++ tests/unit/models/rbm-action-base.test.ts | 16 +++++ tests/unit/models/rbm-action-dial.test.ts | 18 ++++++ tests/unit/models/rbm-action-open-url.test.ts | 24 ++++++++ .../models/rbm-action-view-location.test.ts | 22 +++++++ .../models/rbm-card-content-media.test.ts | 16 +++++ tests/unit/models/rbm-card-content.test.ts | 18 ++++++ .../unit/models/rbm-location-response.test.ts | 13 +++++ .../models/rbm-message-carousel-card.test.ts | 16 +++++ .../models/rbm-message-content-file.test.ts | 13 +++++ .../models/rbm-message-content-text.test.ts | 13 +++++ tests/unit/models/rbm-message-media.test.ts | 13 +++++ tests/unit/models/rbm-standalone-card.test.ts | 20 +++++++ .../models/rbm-suggestion-response.test.ts | 13 +++++ .../recording-available-callback.test.ts | 55 ++++++++++++++++++ .../recording-complete-callback.test.ts | 55 ++++++++++++++++++ .../recording-transcription-metadata.test.ts | 17 ++++++ .../models/recording-transcriptions.test.ts | 11 ++++ tests/unit/models/redirect-callback.test.ts | 42 ++++++++++++++ tests/unit/models/sms-message-content.test.ts | 11 ++++ .../models/status-callback-message.test.ts | 39 +++++++++++++ tests/unit/models/status-callback.test.ts | 27 +++++++++ tests/unit/models/stir-shaken.test.ts | 15 +++++ tests/unit/models/sync-lookup-request.test.ts | 13 +++++ tests/unit/models/telephone-number.test.ts | 11 ++++ .../models/tfv-basic-authentication.test.ts | 13 +++++ tests/unit/models/tfv-error.test.ts | 13 +++++ tests/unit/models/tfv-status.test.ts | 33 +++++++++++ tests/unit/models/tfv-submission-info.test.ts | 46 +++++++++++++++ .../models/tfv-submission-wrapper.test.ts | 12 ++++ .../unit/models/transcribe-recording.test.ts | 24 ++++++++ .../transcription-available-callback.test.ts | 54 +++++++++++++++++ tests/unit/models/transcription.test.ts | 13 +++++ .../models/transfer-answer-callback.test.ts | 40 +++++++++++++ .../models/transfer-complete-callback.test.ts | 46 +++++++++++++++ .../transfer-disconnect-callback.test.ts | 50 ++++++++++++++++ .../unit/models/update-call-recording.test.ts | 12 ++++ tests/unit/models/update-call.test.ts | 31 ++++++++++ .../models/update-conference-member.test.ts | 15 +++++ tests/unit/models/update-conference.test.ts | 29 ++++++++++ .../verification-denial-webhook.test.ts | 29 ++++++++++ .../unit/models/verification-request.test.ts | 54 +++++++++++++++++ .../verification-update-request.test.ts | 52 +++++++++++++++++ .../unit/models/verification-webhook.test.ts | 18 ++++++ tests/unit/models/verify-code-request.test.ts | 17 ++++++ .../unit/models/verify-code-response.test.ts | 11 ++++ tests/unit/models/voice-api-error.test.ts | 15 +++++ tests/unit/models/voice-code-response.test.ts | 11 ++++ ...-subscription-basic-authentication.test.ts | 13 +++++ .../models/webhook-subscription-error.test.ts | 15 +++++ ...ebhook-subscription-request-schema.test.ts | 16 +++++ .../unit/models/webhook-subscription.test.ts | 25 ++++++++ .../webhook-subscriptions-list-body.test.ts | 16 +++++ 137 files changed, 3225 insertions(+) create mode 100644 tests/unit/models/account-statistics.test.ts create mode 100644 tests/unit/models/additional-denial-reason.test.ts create mode 100644 tests/unit/models/address.test.ts create mode 100644 tests/unit/models/answer-callback.test.ts create mode 100644 tests/unit/models/async-lookup-request.test.ts create mode 100644 tests/unit/models/blocked-webhook.test.ts create mode 100644 tests/unit/models/bridge-complete-callback.test.ts create mode 100644 tests/unit/models/bridge-target-complete-callback.test.ts create mode 100644 tests/unit/models/call-recording-metadata.test.ts create mode 100644 tests/unit/models/call-state.test.ts create mode 100644 tests/unit/models/call-transcription-metadata.test.ts create mode 100644 tests/unit/models/call-transcription-response.test.ts create mode 100644 tests/unit/models/call-transcription.test.ts create mode 100644 tests/unit/models/code-request.test.ts create mode 100644 tests/unit/models/conference-completed-callback.test.ts create mode 100644 tests/unit/models/conference-created-callback.test.ts create mode 100644 tests/unit/models/conference-member-exit-callback.test.ts create mode 100644 tests/unit/models/conference-member-join-callback.test.ts create mode 100644 tests/unit/models/conference-member.test.ts create mode 100644 tests/unit/models/conference-recording-available-callback.test.ts create mode 100644 tests/unit/models/conference-recording-metadata.test.ts create mode 100644 tests/unit/models/conference-redirect-callback.test.ts create mode 100644 tests/unit/models/conference.test.ts create mode 100644 tests/unit/models/contact.test.ts create mode 100644 tests/unit/models/create-async-bulk-lookup-response-data.test.ts create mode 100644 tests/unit/models/create-async-bulk-lookup-response.test.ts create mode 100644 tests/unit/models/create-call-response.test.ts create mode 100644 tests/unit/models/create-call.test.ts create mode 100644 tests/unit/models/create-message-request-error.test.ts create mode 100644 tests/unit/models/create-multi-channel-message-response.test.ts create mode 100644 tests/unit/models/create-sync-lookup-response-data.test.ts create mode 100644 tests/unit/models/create-sync-lookup-response.test.ts create mode 100644 tests/unit/models/disconnect-callback.test.ts create mode 100644 tests/unit/models/diversion.test.ts create mode 100644 tests/unit/models/dtmf-callback.test.ts create mode 100644 tests/unit/models/error-object.test.ts create mode 100644 tests/unit/models/error-source.test.ts create mode 100644 tests/unit/models/failure-webhook.test.ts create mode 100644 tests/unit/models/field-error.test.ts create mode 100644 tests/unit/models/gather-callback.test.ts create mode 100644 tests/unit/models/get-async-bulk-lookup-response-data.test.ts create mode 100644 tests/unit/models/get-async-bulk-lookup-response.test.ts create mode 100644 tests/unit/models/inbound-callback-message.test.ts create mode 100644 tests/unit/models/inbound-callback.test.ts create mode 100644 tests/unit/models/initiate-callback.test.ts create mode 100644 tests/unit/models/link-schema.test.ts create mode 100644 tests/unit/models/link.test.ts create mode 100644 tests/unit/models/links-object.test.ts create mode 100644 tests/unit/models/list-message-item.test.ts create mode 100644 tests/unit/models/lookup-error-response.test.ts create mode 100644 tests/unit/models/lookup-error-schema-meta.test.ts create mode 100644 tests/unit/models/lookup-error-schema.test.ts create mode 100644 tests/unit/models/lookup-result.test.ts create mode 100644 tests/unit/models/machine-detection-complete-callback.test.ts create mode 100644 tests/unit/models/machine-detection-configuration.test.ts create mode 100644 tests/unit/models/machine-detection-result.test.ts create mode 100644 tests/unit/models/media.test.ts create mode 100644 tests/unit/models/message-request.test.ts create mode 100644 tests/unit/models/message.test.ts create mode 100644 tests/unit/models/messages-list.test.ts create mode 100644 tests/unit/models/messaging-code-response.test.ts create mode 100644 tests/unit/models/messaging-request-error.test.ts create mode 100644 tests/unit/models/mfa-forbidden-request-error.test.ts create mode 100644 tests/unit/models/mfa-request-error.test.ts create mode 100644 tests/unit/models/mfa-unauthorized-request-error.test.ts create mode 100644 tests/unit/models/mms-message-content-file.test.ts create mode 100644 tests/unit/models/mms-message-content.test.ts create mode 100644 tests/unit/models/multi-channel-action-calendar-event.test.ts create mode 100644 tests/unit/models/multi-channel-action.test.ts create mode 100644 tests/unit/models/multi-channel-channel-list-mmsobject.test.ts create mode 100644 tests/unit/models/multi-channel-channel-list-mmsresponse-object.test.ts create mode 100644 tests/unit/models/multi-channel-channel-list-object-base.test.ts create mode 100644 tests/unit/models/multi-channel-channel-list-owner-object.test.ts create mode 100644 tests/unit/models/multi-channel-channel-list-rbmobject.test.ts create mode 100644 tests/unit/models/multi-channel-channel-list-rbmresponse-object.test.ts create mode 100644 tests/unit/models/multi-channel-channel-list-request-object.test.ts create mode 100644 tests/unit/models/multi-channel-channel-list-response-object.test.ts create mode 100644 tests/unit/models/multi-channel-channel-list-smsobject.test.ts create mode 100644 tests/unit/models/multi-channel-channel-list-smsresponse-object.test.ts create mode 100644 tests/unit/models/multi-channel-error.test.ts create mode 100644 tests/unit/models/multi-channel-message-content.test.ts create mode 100644 tests/unit/models/multi-channel-message-request.test.ts create mode 100644 tests/unit/models/multi-channel-message-response-data.test.ts create mode 100644 tests/unit/models/opt-in-workflow.test.ts create mode 100644 tests/unit/models/page-info.test.ts create mode 100644 tests/unit/models/rbm-action-base.test.ts create mode 100644 tests/unit/models/rbm-action-dial.test.ts create mode 100644 tests/unit/models/rbm-action-open-url.test.ts create mode 100644 tests/unit/models/rbm-action-view-location.test.ts create mode 100644 tests/unit/models/rbm-card-content-media.test.ts create mode 100644 tests/unit/models/rbm-card-content.test.ts create mode 100644 tests/unit/models/rbm-location-response.test.ts create mode 100644 tests/unit/models/rbm-message-carousel-card.test.ts create mode 100644 tests/unit/models/rbm-message-content-file.test.ts create mode 100644 tests/unit/models/rbm-message-content-text.test.ts create mode 100644 tests/unit/models/rbm-message-media.test.ts create mode 100644 tests/unit/models/rbm-standalone-card.test.ts create mode 100644 tests/unit/models/rbm-suggestion-response.test.ts create mode 100644 tests/unit/models/recording-available-callback.test.ts create mode 100644 tests/unit/models/recording-complete-callback.test.ts create mode 100644 tests/unit/models/recording-transcription-metadata.test.ts create mode 100644 tests/unit/models/recording-transcriptions.test.ts create mode 100644 tests/unit/models/redirect-callback.test.ts create mode 100644 tests/unit/models/sms-message-content.test.ts create mode 100644 tests/unit/models/status-callback-message.test.ts create mode 100644 tests/unit/models/status-callback.test.ts create mode 100644 tests/unit/models/stir-shaken.test.ts create mode 100644 tests/unit/models/sync-lookup-request.test.ts create mode 100644 tests/unit/models/telephone-number.test.ts create mode 100644 tests/unit/models/tfv-basic-authentication.test.ts create mode 100644 tests/unit/models/tfv-error.test.ts create mode 100644 tests/unit/models/tfv-status.test.ts create mode 100644 tests/unit/models/tfv-submission-info.test.ts create mode 100644 tests/unit/models/tfv-submission-wrapper.test.ts create mode 100644 tests/unit/models/transcribe-recording.test.ts create mode 100644 tests/unit/models/transcription-available-callback.test.ts create mode 100644 tests/unit/models/transcription.test.ts create mode 100644 tests/unit/models/transfer-answer-callback.test.ts create mode 100644 tests/unit/models/transfer-complete-callback.test.ts create mode 100644 tests/unit/models/transfer-disconnect-callback.test.ts create mode 100644 tests/unit/models/update-call-recording.test.ts create mode 100644 tests/unit/models/update-call.test.ts create mode 100644 tests/unit/models/update-conference-member.test.ts create mode 100644 tests/unit/models/update-conference.test.ts create mode 100644 tests/unit/models/verification-denial-webhook.test.ts create mode 100644 tests/unit/models/verification-request.test.ts create mode 100644 tests/unit/models/verification-update-request.test.ts create mode 100644 tests/unit/models/verification-webhook.test.ts create mode 100644 tests/unit/models/verify-code-request.test.ts create mode 100644 tests/unit/models/verify-code-response.test.ts create mode 100644 tests/unit/models/voice-api-error.test.ts create mode 100644 tests/unit/models/voice-code-response.test.ts create mode 100644 tests/unit/models/webhook-subscription-basic-authentication.test.ts create mode 100644 tests/unit/models/webhook-subscription-error.test.ts create mode 100644 tests/unit/models/webhook-subscription-request-schema.test.ts create mode 100644 tests/unit/models/webhook-subscription.test.ts create mode 100644 tests/unit/models/webhook-subscriptions-list-body.test.ts diff --git a/tests/unit/models/account-statistics.test.ts b/tests/unit/models/account-statistics.test.ts new file mode 100644 index 0000000..4f4f90c --- /dev/null +++ b/tests/unit/models/account-statistics.test.ts @@ -0,0 +1,13 @@ +import { AccountStatistics } from '../../../models/account-statistics'; + +describe('AccountStatistics', () => { + test('should accept the expected shape', () => { + const fixture: AccountStatistics = { + currentCallQueueSize: 1.5, + maxCallQueueSize: 1.5, + }; + + expect(fixture.currentCallQueueSize).toBe(1.5); + expect(fixture.maxCallQueueSize).toBe(1.5); + }); +}); diff --git a/tests/unit/models/additional-denial-reason.test.ts b/tests/unit/models/additional-denial-reason.test.ts new file mode 100644 index 0000000..ba62398 --- /dev/null +++ b/tests/unit/models/additional-denial-reason.test.ts @@ -0,0 +1,15 @@ +import { AdditionalDenialReason } from '../../../models/additional-denial-reason'; + +describe('AdditionalDenialReason', () => { + test('should accept the expected shape', () => { + const fixture: AdditionalDenialReason = { + statusCode: 1.5, + reason: 'test-reason', + resubmitAllowed: true, + }; + + expect(fixture.statusCode).toBe(1.5); + expect(fixture.reason).toBe('test-reason'); + expect(fixture.resubmitAllowed).toBe(true); + }); +}); diff --git a/tests/unit/models/address.test.ts b/tests/unit/models/address.test.ts new file mode 100644 index 0000000..1f23ded --- /dev/null +++ b/tests/unit/models/address.test.ts @@ -0,0 +1,23 @@ +import { Address } from '../../../models/address'; + +describe('Address', () => { + test('should accept the expected shape', () => { + const fixture: Address = { + name: 'test-name', + addr1: 'test-addr1', + addr2: 'test-addr2', + city: 'test-city', + state: 'test-state', + zip: 'test-zip', + url: 'test-url', + }; + + expect(fixture.name).toBe('test-name'); + expect(fixture.addr1).toBe('test-addr1'); + expect(fixture.addr2).toBe('test-addr2'); + expect(fixture.city).toBe('test-city'); + expect(fixture.state).toBe('test-state'); + expect(fixture.zip).toBe('test-zip'); + expect(fixture.url).toBe('test-url'); + }); +}); diff --git a/tests/unit/models/answer-callback.test.ts b/tests/unit/models/answer-callback.test.ts new file mode 100644 index 0000000..6c7ab70 --- /dev/null +++ b/tests/unit/models/answer-callback.test.ts @@ -0,0 +1,39 @@ +import { AnswerCallback } from '../../../models/answer-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; +import { MachineDetectionResult } from '../../../models/machine-detection-result'; + +describe('AnswerCallback', () => { + test('should accept the expected shape', () => { + const fixture: AnswerCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + direction: CallDirectionEnum.Inbound, + callId: 'test-callId', + callUrl: 'test-callUrl', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + answerTime: 'test-answerTime', + tag: 'test-tag', + machineDetectionResult: {} as unknown as MachineDetectionResult, + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.answerTime).toBe('test-answerTime'); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.machineDetectionResult).toBeDefined(); + }); +}); diff --git a/tests/unit/models/async-lookup-request.test.ts b/tests/unit/models/async-lookup-request.test.ts new file mode 100644 index 0000000..54cc9af --- /dev/null +++ b/tests/unit/models/async-lookup-request.test.ts @@ -0,0 +1,11 @@ +import { AsyncLookupRequest } from '../../../models/async-lookup-request'; + +describe('AsyncLookupRequest', () => { + test('should accept the expected shape', () => { + const fixture: AsyncLookupRequest = { + phoneNumbers: [], + }; + + expect(fixture.phoneNumbers).toEqual([]); + }); +}); diff --git a/tests/unit/models/blocked-webhook.test.ts b/tests/unit/models/blocked-webhook.test.ts new file mode 100644 index 0000000..d17f322 --- /dev/null +++ b/tests/unit/models/blocked-webhook.test.ts @@ -0,0 +1,22 @@ +import { BlockedWebhook } from '../../../models/blocked-webhook'; +import { TfvCallbackStatusEnum } from '../../../models/tfv-callback-status-enum'; + +describe('BlockedWebhook', () => { + test('should accept the expected shape', () => { + const fixture: BlockedWebhook = { + accountId: 'test-accountId', + phoneNumber: 'test-phoneNumber', + status: TfvCallbackStatusEnum.Verified, + internalTicketNumber: 'test-internalTicketNumber', + blocked: true, + blockedReason: 'test-blockedReason', + }; + + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.phoneNumber).toBe('test-phoneNumber'); + expect(fixture.status).toBe(TfvCallbackStatusEnum.Verified); + expect(fixture.internalTicketNumber).toBe('test-internalTicketNumber'); + expect(fixture.blocked).toBe(true); + expect(fixture.blockedReason).toBe('test-blockedReason'); + }); +}); diff --git a/tests/unit/models/bridge-complete-callback.test.ts b/tests/unit/models/bridge-complete-callback.test.ts new file mode 100644 index 0000000..94ab5b9 --- /dev/null +++ b/tests/unit/models/bridge-complete-callback.test.ts @@ -0,0 +1,42 @@ +import { BridgeCompleteCallback } from '../../../models/bridge-complete-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; + +describe('BridgeCompleteCallback', () => { + test('should accept the expected shape', () => { + const fixture: BridgeCompleteCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + direction: CallDirectionEnum.Inbound, + callId: 'test-callId', + callUrl: 'test-callUrl', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + answerTime: 'test-answerTime', + tag: 'test-tag', + cause: 'test-cause', + errorMessage: 'test-errorMessage', + errorId: 'test-errorId', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.answerTime).toBe('test-answerTime'); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.cause).toBe('test-cause'); + expect(fixture.errorMessage).toBe('test-errorMessage'); + expect(fixture.errorId).toBe('test-errorId'); + }); +}); diff --git a/tests/unit/models/bridge-target-complete-callback.test.ts b/tests/unit/models/bridge-target-complete-callback.test.ts new file mode 100644 index 0000000..a3c698f --- /dev/null +++ b/tests/unit/models/bridge-target-complete-callback.test.ts @@ -0,0 +1,36 @@ +import { BridgeTargetCompleteCallback } from '../../../models/bridge-target-complete-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; + +describe('BridgeTargetCompleteCallback', () => { + test('should accept the expected shape', () => { + const fixture: BridgeTargetCompleteCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + direction: CallDirectionEnum.Inbound, + callId: 'test-callId', + callUrl: 'test-callUrl', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + answerTime: 'test-answerTime', + tag: 'test-tag', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.answerTime).toBe('test-answerTime'); + expect(fixture.tag).toBe('test-tag'); + }); +}); diff --git a/tests/unit/models/call-recording-metadata.test.ts b/tests/unit/models/call-recording-metadata.test.ts new file mode 100644 index 0000000..c143978 --- /dev/null +++ b/tests/unit/models/call-recording-metadata.test.ts @@ -0,0 +1,50 @@ +import { CallRecordingMetadata } from '../../../models/call-recording-metadata'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; +import { FileFormatEnum } from '../../../models/file-format-enum'; +import { RecordingTranscriptionMetadata } from '../../../models/recording-transcription-metadata'; + +describe('CallRecordingMetadata', () => { + test('should accept the expected shape', () => { + const fixture: CallRecordingMetadata = { + applicationId: 'test-applicationId', + accountId: 'test-accountId', + callId: 'test-callId', + parentCallId: 'test-parentCallId', + recordingId: 'test-recordingId', + to: 'test-to', + from: 'test-from', + transferCallerId: 'test-transferCallerId', + transferTo: 'test-transferTo', + duration: 'test-duration', + direction: CallDirectionEnum.Inbound, + channels: 1.5, + startTime: 'test-startTime', + endTime: 'test-endTime', + fileFormat: FileFormatEnum.Mp3, + status: 'test-status', + mediaUrl: 'test-mediaUrl', + transcription: {} as unknown as RecordingTranscriptionMetadata, + recordingName: 'test-recordingName', + }; + + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.parentCallId).toBe('test-parentCallId'); + expect(fixture.recordingId).toBe('test-recordingId'); + expect(fixture.to).toBe('test-to'); + expect(fixture.from).toBe('test-from'); + expect(fixture.transferCallerId).toBe('test-transferCallerId'); + expect(fixture.transferTo).toBe('test-transferTo'); + expect(fixture.duration).toBe('test-duration'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.channels).toBe(1.5); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.endTime).toBe('test-endTime'); + expect(fixture.fileFormat).toBe(FileFormatEnum.Mp3); + expect(fixture.status).toBe('test-status'); + expect(fixture.mediaUrl).toBe('test-mediaUrl'); + expect(fixture.transcription).toBeDefined(); + expect(fixture.recordingName).toBe('test-recordingName'); + }); +}); diff --git a/tests/unit/models/call-state.test.ts b/tests/unit/models/call-state.test.ts new file mode 100644 index 0000000..1f569d3 --- /dev/null +++ b/tests/unit/models/call-state.test.ts @@ -0,0 +1,46 @@ +import { CallState } from '../../../models/call-state'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; + +describe('CallState', () => { + test('should accept the expected shape', () => { + const fixture: CallState = { + applicationId: 'test-applicationId', + accountId: 'test-accountId', + callId: 'test-callId', + parentCallId: 'test-parentCallId', + to: 'test-to', + from: 'test-from', + direction: CallDirectionEnum.Inbound, + state: 'test-state', + stirShaken: {}, + identity: 'test-identity', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + answerTime: 'test-answerTime', + endTime: 'test-endTime', + disconnectCause: 'test-disconnectCause', + errorMessage: 'test-errorMessage', + errorId: 'test-errorId', + lastUpdate: 'test-lastUpdate', + }; + + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.parentCallId).toBe('test-parentCallId'); + expect(fixture.to).toBe('test-to'); + expect(fixture.from).toBe('test-from'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.state).toBe('test-state'); + expect(fixture.stirShaken).toEqual({}); + expect(fixture.identity).toBe('test-identity'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.answerTime).toBe('test-answerTime'); + expect(fixture.endTime).toBe('test-endTime'); + expect(fixture.disconnectCause).toBe('test-disconnectCause'); + expect(fixture.errorMessage).toBe('test-errorMessage'); + expect(fixture.errorId).toBe('test-errorId'); + expect(fixture.lastUpdate).toBe('test-lastUpdate'); + }); +}); diff --git a/tests/unit/models/call-transcription-metadata.test.ts b/tests/unit/models/call-transcription-metadata.test.ts new file mode 100644 index 0000000..7998ecc --- /dev/null +++ b/tests/unit/models/call-transcription-metadata.test.ts @@ -0,0 +1,15 @@ +import { CallTranscriptionMetadata } from '../../../models/call-transcription-metadata'; + +describe('CallTranscriptionMetadata', () => { + test('should accept the expected shape', () => { + const fixture: CallTranscriptionMetadata = { + transcriptionId: 'test-transcriptionId', + transcriptionName: 'test-transcriptionName', + transcriptionUrl: 'test-transcriptionUrl', + }; + + expect(fixture.transcriptionId).toBe('test-transcriptionId'); + expect(fixture.transcriptionName).toBe('test-transcriptionName'); + expect(fixture.transcriptionUrl).toBe('test-transcriptionUrl'); + }); +}); diff --git a/tests/unit/models/call-transcription-response.test.ts b/tests/unit/models/call-transcription-response.test.ts new file mode 100644 index 0000000..f8c2af0 --- /dev/null +++ b/tests/unit/models/call-transcription-response.test.ts @@ -0,0 +1,17 @@ +import { CallTranscriptionResponse } from '../../../models/call-transcription-response'; + +describe('CallTranscriptionResponse', () => { + test('should accept the expected shape', () => { + const fixture: CallTranscriptionResponse = { + accountId: 'test-accountId', + callId: 'test-callId', + transcriptionId: 'test-transcriptionId', + tracks: [], + }; + + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.transcriptionId).toBe('test-transcriptionId'); + expect(fixture.tracks).toEqual([]); + }); +}); diff --git a/tests/unit/models/call-transcription.test.ts b/tests/unit/models/call-transcription.test.ts new file mode 100644 index 0000000..b21a244 --- /dev/null +++ b/tests/unit/models/call-transcription.test.ts @@ -0,0 +1,19 @@ +import { CallTranscription } from '../../../models/call-transcription'; +import { CallTranscriptionDetectedLanguageEnum } from '../../../models/call-transcription-detected-language-enum'; +import { CallTranscriptionTrackEnum } from '../../../models/call-transcription-track-enum'; + +describe('CallTranscription', () => { + test('should accept the expected shape', () => { + const fixture: CallTranscription = { + detectedLanguage: CallTranscriptionDetectedLanguageEnum.EnUs, + track: CallTranscriptionTrackEnum.Inbound, + transcript: 'test-transcript', + confidence: 1.5, + }; + + expect(fixture.detectedLanguage).toBe(CallTranscriptionDetectedLanguageEnum.EnUs); + expect(fixture.track).toBe(CallTranscriptionTrackEnum.Inbound); + expect(fixture.transcript).toBe('test-transcript'); + expect(fixture.confidence).toBe(1.5); + }); +}); diff --git a/tests/unit/models/code-request.test.ts b/tests/unit/models/code-request.test.ts new file mode 100644 index 0000000..a7e57a3 --- /dev/null +++ b/tests/unit/models/code-request.test.ts @@ -0,0 +1,21 @@ +import { CodeRequest } from '../../../models/code-request'; + +describe('CodeRequest', () => { + test('should accept the expected shape', () => { + const fixture: CodeRequest = { + to: 'test-to', + from: 'test-from', + applicationId: 'test-applicationId', + scope: 'test-scope', + message: 'test-message', + digits: 1.5, + }; + + expect(fixture.to).toBe('test-to'); + expect(fixture.from).toBe('test-from'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.scope).toBe('test-scope'); + expect(fixture.message).toBe('test-message'); + expect(fixture.digits).toBe(1.5); + }); +}); diff --git a/tests/unit/models/conference-completed-callback.test.ts b/tests/unit/models/conference-completed-callback.test.ts new file mode 100644 index 0000000..dbe9712 --- /dev/null +++ b/tests/unit/models/conference-completed-callback.test.ts @@ -0,0 +1,19 @@ +import { ConferenceCompletedCallback } from '../../../models/conference-completed-callback'; + +describe('ConferenceCompletedCallback', () => { + test('should accept the expected shape', () => { + const fixture: ConferenceCompletedCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + conferenceId: 'test-conferenceId', + name: 'test-name', + tag: 'test-tag', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.conferenceId).toBe('test-conferenceId'); + expect(fixture.name).toBe('test-name'); + expect(fixture.tag).toBe('test-tag'); + }); +}); diff --git a/tests/unit/models/conference-created-callback.test.ts b/tests/unit/models/conference-created-callback.test.ts new file mode 100644 index 0000000..6cb7bda --- /dev/null +++ b/tests/unit/models/conference-created-callback.test.ts @@ -0,0 +1,19 @@ +import { ConferenceCreatedCallback } from '../../../models/conference-created-callback'; + +describe('ConferenceCreatedCallback', () => { + test('should accept the expected shape', () => { + const fixture: ConferenceCreatedCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + conferenceId: 'test-conferenceId', + name: 'test-name', + tag: 'test-tag', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.conferenceId).toBe('test-conferenceId'); + expect(fixture.name).toBe('test-name'); + expect(fixture.tag).toBe('test-tag'); + }); +}); diff --git a/tests/unit/models/conference-member-exit-callback.test.ts b/tests/unit/models/conference-member-exit-callback.test.ts new file mode 100644 index 0000000..8b5c386 --- /dev/null +++ b/tests/unit/models/conference-member-exit-callback.test.ts @@ -0,0 +1,25 @@ +import { ConferenceMemberExitCallback } from '../../../models/conference-member-exit-callback'; + +describe('ConferenceMemberExitCallback', () => { + test('should accept the expected shape', () => { + const fixture: ConferenceMemberExitCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + conferenceId: 'test-conferenceId', + name: 'test-name', + from: 'test-from', + to: 'test-to', + callId: 'test-callId', + tag: 'test-tag', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.conferenceId).toBe('test-conferenceId'); + expect(fixture.name).toBe('test-name'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.tag).toBe('test-tag'); + }); +}); diff --git a/tests/unit/models/conference-member-join-callback.test.ts b/tests/unit/models/conference-member-join-callback.test.ts new file mode 100644 index 0000000..d77512a --- /dev/null +++ b/tests/unit/models/conference-member-join-callback.test.ts @@ -0,0 +1,25 @@ +import { ConferenceMemberJoinCallback } from '../../../models/conference-member-join-callback'; + +describe('ConferenceMemberJoinCallback', () => { + test('should accept the expected shape', () => { + const fixture: ConferenceMemberJoinCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + conferenceId: 'test-conferenceId', + name: 'test-name', + from: 'test-from', + to: 'test-to', + callId: 'test-callId', + tag: 'test-tag', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.conferenceId).toBe('test-conferenceId'); + expect(fixture.name).toBe('test-name'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.tag).toBe('test-tag'); + }); +}); diff --git a/tests/unit/models/conference-member.test.ts b/tests/unit/models/conference-member.test.ts new file mode 100644 index 0000000..a4d979b --- /dev/null +++ b/tests/unit/models/conference-member.test.ts @@ -0,0 +1,21 @@ +import { ConferenceMember } from '../../../models/conference-member'; + +describe('ConferenceMember', () => { + test('should accept the expected shape', () => { + const fixture: ConferenceMember = { + callId: 'test-callId', + conferenceId: 'test-conferenceId', + memberUrl: 'test-memberUrl', + mute: true, + hold: true, + callIdsToCoach: [], + }; + + expect(fixture.callId).toBe('test-callId'); + expect(fixture.conferenceId).toBe('test-conferenceId'); + expect(fixture.memberUrl).toBe('test-memberUrl'); + expect(fixture.mute).toBe(true); + expect(fixture.hold).toBe(true); + expect(fixture.callIdsToCoach).toEqual([]); + }); +}); diff --git a/tests/unit/models/conference-recording-available-callback.test.ts b/tests/unit/models/conference-recording-available-callback.test.ts new file mode 100644 index 0000000..3154ba4 --- /dev/null +++ b/tests/unit/models/conference-recording-available-callback.test.ts @@ -0,0 +1,38 @@ +import { ConferenceRecordingAvailableCallback } from '../../../models/conference-recording-available-callback'; +import { FileFormatEnum } from '../../../models/file-format-enum'; + +describe('ConferenceRecordingAvailableCallback', () => { + test('should accept the expected shape', () => { + const fixture: ConferenceRecordingAvailableCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + conferenceId: 'test-conferenceId', + name: 'test-name', + accountId: 'test-accountId', + recordingId: 'test-recordingId', + channels: 1.5, + startTime: 'test-startTime', + endTime: 'test-endTime', + duration: 'test-duration', + fileFormat: FileFormatEnum.Mp3, + mediaUrl: 'test-mediaUrl', + tag: 'test-tag', + status: 'test-status', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.conferenceId).toBe('test-conferenceId'); + expect(fixture.name).toBe('test-name'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.recordingId).toBe('test-recordingId'); + expect(fixture.channels).toBe(1.5); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.endTime).toBe('test-endTime'); + expect(fixture.duration).toBe('test-duration'); + expect(fixture.fileFormat).toBe(FileFormatEnum.Mp3); + expect(fixture.mediaUrl).toBe('test-mediaUrl'); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.status).toBe('test-status'); + }); +}); diff --git a/tests/unit/models/conference-recording-metadata.test.ts b/tests/unit/models/conference-recording-metadata.test.ts new file mode 100644 index 0000000..0e47740 --- /dev/null +++ b/tests/unit/models/conference-recording-metadata.test.ts @@ -0,0 +1,34 @@ +import { ConferenceRecordingMetadata } from '../../../models/conference-recording-metadata'; +import { FileFormatEnum } from '../../../models/file-format-enum'; + +describe('ConferenceRecordingMetadata', () => { + test('should accept the expected shape', () => { + const fixture: ConferenceRecordingMetadata = { + accountId: 'test-accountId', + conferenceId: 'test-conferenceId', + name: 'test-name', + recordingId: 'test-recordingId', + duration: 'test-duration', + channels: 1.5, + startTime: 'test-startTime', + endTime: 'test-endTime', + fileFormat: FileFormatEnum.Mp3, + status: 'test-status', + mediaUrl: 'test-mediaUrl', + recordingName: 'test-recordingName', + }; + + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.conferenceId).toBe('test-conferenceId'); + expect(fixture.name).toBe('test-name'); + expect(fixture.recordingId).toBe('test-recordingId'); + expect(fixture.duration).toBe('test-duration'); + expect(fixture.channels).toBe(1.5); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.endTime).toBe('test-endTime'); + expect(fixture.fileFormat).toBe(FileFormatEnum.Mp3); + expect(fixture.status).toBe('test-status'); + expect(fixture.mediaUrl).toBe('test-mediaUrl'); + expect(fixture.recordingName).toBe('test-recordingName'); + }); +}); diff --git a/tests/unit/models/conference-redirect-callback.test.ts b/tests/unit/models/conference-redirect-callback.test.ts new file mode 100644 index 0000000..9b9e350 --- /dev/null +++ b/tests/unit/models/conference-redirect-callback.test.ts @@ -0,0 +1,19 @@ +import { ConferenceRedirectCallback } from '../../../models/conference-redirect-callback'; + +describe('ConferenceRedirectCallback', () => { + test('should accept the expected shape', () => { + const fixture: ConferenceRedirectCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + conferenceId: 'test-conferenceId', + name: 'test-name', + tag: 'test-tag', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.conferenceId).toBe('test-conferenceId'); + expect(fixture.name).toBe('test-name'); + expect(fixture.tag).toBe('test-tag'); + }); +}); diff --git a/tests/unit/models/conference.test.ts b/tests/unit/models/conference.test.ts new file mode 100644 index 0000000..a1da01b --- /dev/null +++ b/tests/unit/models/conference.test.ts @@ -0,0 +1,26 @@ +import { Conference } from '../../../models/conference'; +import { CallbackMethodEnum } from '../../../models/callback-method-enum'; + +describe('Conference', () => { + test('should accept the expected shape', () => { + const fixture: Conference = { + id: 'test-id', + name: 'test-name', + createdTime: 'test-createdTime', + completedTime: 'test-completedTime', + conferenceEventUrl: 'test-conferenceEventUrl', + conferenceEventMethod: CallbackMethodEnum.Get, + tag: 'test-tag', + activeMembers: [], + }; + + expect(fixture.id).toBe('test-id'); + expect(fixture.name).toBe('test-name'); + expect(fixture.createdTime).toBe('test-createdTime'); + expect(fixture.completedTime).toBe('test-completedTime'); + expect(fixture.conferenceEventUrl).toBe('test-conferenceEventUrl'); + expect(fixture.conferenceEventMethod).toBe(CallbackMethodEnum.Get); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.activeMembers).toEqual([]); + }); +}); diff --git a/tests/unit/models/contact.test.ts b/tests/unit/models/contact.test.ts new file mode 100644 index 0000000..6adc3f9 --- /dev/null +++ b/tests/unit/models/contact.test.ts @@ -0,0 +1,17 @@ +import { Contact } from '../../../models/contact'; + +describe('Contact', () => { + test('should accept the expected shape', () => { + const fixture: Contact = { + firstName: 'test-firstName', + lastName: 'test-lastName', + email: 'test-email', + phoneNumber: 'test-phoneNumber', + }; + + expect(fixture.firstName).toBe('test-firstName'); + expect(fixture.lastName).toBe('test-lastName'); + expect(fixture.email).toBe('test-email'); + expect(fixture.phoneNumber).toBe('test-phoneNumber'); + }); +}); diff --git a/tests/unit/models/create-async-bulk-lookup-response-data.test.ts b/tests/unit/models/create-async-bulk-lookup-response-data.test.ts new file mode 100644 index 0000000..a8131d6 --- /dev/null +++ b/tests/unit/models/create-async-bulk-lookup-response-data.test.ts @@ -0,0 +1,14 @@ +import { CreateAsyncBulkLookupResponseData } from '../../../models/create-async-bulk-lookup-response-data'; +import { InProgressLookupStatusEnum } from '../../../models/in-progress-lookup-status-enum'; + +describe('CreateAsyncBulkLookupResponseData', () => { + test('should accept the expected shape', () => { + const fixture: CreateAsyncBulkLookupResponseData = { + requestId: 'test-requestId', + status: InProgressLookupStatusEnum.InProgress, + }; + + expect(fixture.requestId).toBe('test-requestId'); + expect(fixture.status).toBe(InProgressLookupStatusEnum.InProgress); + }); +}); diff --git a/tests/unit/models/create-async-bulk-lookup-response.test.ts b/tests/unit/models/create-async-bulk-lookup-response.test.ts new file mode 100644 index 0000000..d9457a5 --- /dev/null +++ b/tests/unit/models/create-async-bulk-lookup-response.test.ts @@ -0,0 +1,16 @@ +import { CreateAsyncBulkLookupResponse } from '../../../models/create-async-bulk-lookup-response'; +import { CreateAsyncBulkLookupResponseData } from '../../../models/create-async-bulk-lookup-response-data'; + +describe('CreateAsyncBulkLookupResponse', () => { + test('should accept the expected shape', () => { + const fixture: CreateAsyncBulkLookupResponse = { + links: [], + data: {} as unknown as CreateAsyncBulkLookupResponseData, + errors: [], + }; + + expect(fixture.links).toEqual([]); + expect(fixture.data).toBeDefined(); + expect(fixture.errors).toEqual([]); + }); +}); diff --git a/tests/unit/models/create-call-response.test.ts b/tests/unit/models/create-call-response.test.ts new file mode 100644 index 0000000..09709b2 --- /dev/null +++ b/tests/unit/models/create-call-response.test.ts @@ -0,0 +1,52 @@ +import { CreateCallResponse } from '../../../models/create-call-response'; +import { CallbackMethodEnum } from '../../../models/callback-method-enum'; + +describe('CreateCallResponse', () => { + test('should accept the expected shape', () => { + const fixture: CreateCallResponse = { + applicationId: 'test-applicationId', + accountId: 'test-accountId', + callId: 'test-callId', + to: 'test-to', + from: 'test-from', + enqueuedTime: 'test-enqueuedTime', + callUrl: 'test-callUrl', + callTimeout: 1.5, + callbackTimeout: 1.5, + tag: 'test-tag', + answerMethod: CallbackMethodEnum.Get, + answerUrl: 'test-answerUrl', + answerFallbackMethod: CallbackMethodEnum.Get, + answerFallbackUrl: 'test-answerFallbackUrl', + disconnectMethod: CallbackMethodEnum.Get, + disconnectUrl: 'test-disconnectUrl', + username: 'test-username', + password: 'test-password', + fallbackUsername: 'test-fallbackUsername', + fallbackPassword: 'test-fallbackPassword', + priority: 1.5, + }; + + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.to).toBe('test-to'); + expect(fixture.from).toBe('test-from'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.callTimeout).toBe(1.5); + expect(fixture.callbackTimeout).toBe(1.5); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.answerMethod).toBe(CallbackMethodEnum.Get); + expect(fixture.answerUrl).toBe('test-answerUrl'); + expect(fixture.answerFallbackMethod).toBe(CallbackMethodEnum.Get); + expect(fixture.answerFallbackUrl).toBe('test-answerFallbackUrl'); + expect(fixture.disconnectMethod).toBe(CallbackMethodEnum.Get); + expect(fixture.disconnectUrl).toBe('test-disconnectUrl'); + expect(fixture.username).toBe('test-username'); + expect(fixture.password).toBe('test-password'); + expect(fixture.fallbackUsername).toBe('test-fallbackUsername'); + expect(fixture.fallbackPassword).toBe('test-fallbackPassword'); + expect(fixture.priority).toBe(1.5); + }); +}); diff --git a/tests/unit/models/create-call.test.ts b/tests/unit/models/create-call.test.ts new file mode 100644 index 0000000..91339f6 --- /dev/null +++ b/tests/unit/models/create-call.test.ts @@ -0,0 +1,53 @@ +import { CreateCall } from '../../../models/create-call'; +import { CallbackMethodEnum } from '../../../models/callback-method-enum'; +import { MachineDetectionConfiguration } from '../../../models/machine-detection-configuration'; + +describe('CreateCall', () => { + test('should accept the expected shape', () => { + const fixture: CreateCall = { + to: 'test-to', + from: 'test-from', + privacy: true, + displayName: 'test-displayName', + uui: 'test-uui', + applicationId: 'test-applicationId', + answerUrl: 'test-answerUrl', + answerMethod: CallbackMethodEnum.Get, + username: 'test-username', + password: 'test-password', + answerFallbackUrl: 'test-answerFallbackUrl', + answerFallbackMethod: CallbackMethodEnum.Get, + fallbackUsername: 'test-fallbackUsername', + fallbackPassword: 'test-fallbackPassword', + disconnectUrl: 'test-disconnectUrl', + disconnectMethod: CallbackMethodEnum.Get, + callTimeout: 1.5, + callbackTimeout: 1.5, + machineDetection: {} as unknown as MachineDetectionConfiguration, + priority: 1.5, + tag: 'test-tag', + }; + + expect(fixture.to).toBe('test-to'); + expect(fixture.from).toBe('test-from'); + expect(fixture.privacy).toBe(true); + expect(fixture.displayName).toBe('test-displayName'); + expect(fixture.uui).toBe('test-uui'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.answerUrl).toBe('test-answerUrl'); + expect(fixture.answerMethod).toBe(CallbackMethodEnum.Get); + expect(fixture.username).toBe('test-username'); + expect(fixture.password).toBe('test-password'); + expect(fixture.answerFallbackUrl).toBe('test-answerFallbackUrl'); + expect(fixture.answerFallbackMethod).toBe(CallbackMethodEnum.Get); + expect(fixture.fallbackUsername).toBe('test-fallbackUsername'); + expect(fixture.fallbackPassword).toBe('test-fallbackPassword'); + expect(fixture.disconnectUrl).toBe('test-disconnectUrl'); + expect(fixture.disconnectMethod).toBe(CallbackMethodEnum.Get); + expect(fixture.callTimeout).toBe(1.5); + expect(fixture.callbackTimeout).toBe(1.5); + expect(fixture.machineDetection).toBeDefined(); + expect(fixture.priority).toBe(1.5); + expect(fixture.tag).toBe('test-tag'); + }); +}); diff --git a/tests/unit/models/create-message-request-error.test.ts b/tests/unit/models/create-message-request-error.test.ts new file mode 100644 index 0000000..24d5d28 --- /dev/null +++ b/tests/unit/models/create-message-request-error.test.ts @@ -0,0 +1,15 @@ +import { CreateMessageRequestError } from '../../../models/create-message-request-error'; + +describe('CreateMessageRequestError', () => { + test('should accept the expected shape', () => { + const fixture: CreateMessageRequestError = { + type: 'test-type', + description: 'test-description', + fieldErrors: [], + }; + + expect(fixture.type).toBe('test-type'); + expect(fixture.description).toBe('test-description'); + expect(fixture.fieldErrors).toEqual([]); + }); +}); diff --git a/tests/unit/models/create-multi-channel-message-response.test.ts b/tests/unit/models/create-multi-channel-message-response.test.ts new file mode 100644 index 0000000..b1c95e4 --- /dev/null +++ b/tests/unit/models/create-multi-channel-message-response.test.ts @@ -0,0 +1,16 @@ +import { CreateMultiChannelMessageResponse } from '../../../models/create-multi-channel-message-response'; +import { MultiChannelMessageResponseData } from '../../../models/multi-channel-message-response-data'; + +describe('CreateMultiChannelMessageResponse', () => { + test('should accept the expected shape', () => { + const fixture: CreateMultiChannelMessageResponse = { + links: [], + data: {} as unknown as MultiChannelMessageResponseData, + errors: [], + }; + + expect(fixture.links).toEqual([]); + expect(fixture.data).toBeDefined(); + expect(fixture.errors).toEqual([]); + }); +}); diff --git a/tests/unit/models/create-sync-lookup-response-data.test.ts b/tests/unit/models/create-sync-lookup-response-data.test.ts new file mode 100644 index 0000000..3520e76 --- /dev/null +++ b/tests/unit/models/create-sync-lookup-response-data.test.ts @@ -0,0 +1,16 @@ +import { CreateSyncLookupResponseData } from '../../../models/create-sync-lookup-response-data'; +import { CompletedLookupStatusEnum } from '../../../models/completed-lookup-status-enum'; + +describe('CreateSyncLookupResponseData', () => { + test('should accept the expected shape', () => { + const fixture: CreateSyncLookupResponseData = { + requestId: 'test-requestId', + status: CompletedLookupStatusEnum.Complete, + results: [], + }; + + expect(fixture.requestId).toBe('test-requestId'); + expect(fixture.status).toBe(CompletedLookupStatusEnum.Complete); + expect(fixture.results).toEqual([]); + }); +}); diff --git a/tests/unit/models/create-sync-lookup-response.test.ts b/tests/unit/models/create-sync-lookup-response.test.ts new file mode 100644 index 0000000..2dca766 --- /dev/null +++ b/tests/unit/models/create-sync-lookup-response.test.ts @@ -0,0 +1,16 @@ +import { CreateSyncLookupResponse } from '../../../models/create-sync-lookup-response'; +import { CreateSyncLookupResponseData } from '../../../models/create-sync-lookup-response-data'; + +describe('CreateSyncLookupResponse', () => { + test('should accept the expected shape', () => { + const fixture: CreateSyncLookupResponse = { + links: [], + data: {} as unknown as CreateSyncLookupResponseData, + errors: [], + }; + + expect(fixture.links).toEqual([]); + expect(fixture.data).toBeDefined(); + expect(fixture.errors).toEqual([]); + }); +}); diff --git a/tests/unit/models/disconnect-callback.test.ts b/tests/unit/models/disconnect-callback.test.ts new file mode 100644 index 0000000..6781dda --- /dev/null +++ b/tests/unit/models/disconnect-callback.test.ts @@ -0,0 +1,44 @@ +import { DisconnectCallback } from '../../../models/disconnect-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; + +describe('DisconnectCallback', () => { + test('should accept the expected shape', () => { + const fixture: DisconnectCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + callId: 'test-callId', + direction: CallDirectionEnum.Inbound, + callUrl: 'test-callUrl', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + answerTime: 'test-answerTime', + endTime: 'test-endTime', + cause: 'test-cause', + errorMessage: 'test-errorMessage', + errorId: 'test-errorId', + tag: 'test-tag', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.answerTime).toBe('test-answerTime'); + expect(fixture.endTime).toBe('test-endTime'); + expect(fixture.cause).toBe('test-cause'); + expect(fixture.errorMessage).toBe('test-errorMessage'); + expect(fixture.errorId).toBe('test-errorId'); + expect(fixture.tag).toBe('test-tag'); + }); +}); diff --git a/tests/unit/models/diversion.test.ts b/tests/unit/models/diversion.test.ts new file mode 100644 index 0000000..d2d0e2a --- /dev/null +++ b/tests/unit/models/diversion.test.ts @@ -0,0 +1,23 @@ +import { Diversion } from '../../../models/diversion'; + +describe('Diversion', () => { + test('should accept the expected shape', () => { + const fixture: Diversion = { + reason: 'test-reason', + privacy: 'test-privacy', + screen: 'test-screen', + counter: 'test-counter', + limit: 'test-limit', + unknown: 'test-unknown', + origTo: 'test-origTo', + }; + + expect(fixture.reason).toBe('test-reason'); + expect(fixture.privacy).toBe('test-privacy'); + expect(fixture.screen).toBe('test-screen'); + expect(fixture.counter).toBe('test-counter'); + expect(fixture.limit).toBe('test-limit'); + expect(fixture.unknown).toBe('test-unknown'); + expect(fixture.origTo).toBe('test-origTo'); + }); +}); diff --git a/tests/unit/models/dtmf-callback.test.ts b/tests/unit/models/dtmf-callback.test.ts new file mode 100644 index 0000000..2d787fd --- /dev/null +++ b/tests/unit/models/dtmf-callback.test.ts @@ -0,0 +1,44 @@ +import { DtmfCallback } from '../../../models/dtmf-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; + +describe('DtmfCallback', () => { + test('should accept the expected shape', () => { + const fixture: DtmfCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + callId: 'test-callId', + direction: CallDirectionEnum.Inbound, + digit: 'test-digit', + callUrl: 'test-callUrl', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + answerTime: 'test-answerTime', + parentCallId: 'test-parentCallId', + transferCallerId: 'test-transferCallerId', + transferTo: 'test-transferTo', + tag: 'test-tag', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.digit).toBe('test-digit'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.answerTime).toBe('test-answerTime'); + expect(fixture.parentCallId).toBe('test-parentCallId'); + expect(fixture.transferCallerId).toBe('test-transferCallerId'); + expect(fixture.transferTo).toBe('test-transferTo'); + expect(fixture.tag).toBe('test-tag'); + }); +}); diff --git a/tests/unit/models/error-object.test.ts b/tests/unit/models/error-object.test.ts new file mode 100644 index 0000000..91cb4fd --- /dev/null +++ b/tests/unit/models/error-object.test.ts @@ -0,0 +1,16 @@ +import { ErrorObject } from '../../../models/error-object'; +import { ErrorSource } from '../../../models/error-source'; + +describe('ErrorObject', () => { + test('should accept the expected shape', () => { + const fixture: ErrorObject = { + type: 'test-type', + description: 'test-description', + source: {} as unknown as ErrorSource, + }; + + expect(fixture.type).toBe('test-type'); + expect(fixture.description).toBe('test-description'); + expect(fixture.source).toBeDefined(); + }); +}); diff --git a/tests/unit/models/error-source.test.ts b/tests/unit/models/error-source.test.ts new file mode 100644 index 0000000..d2f40ab --- /dev/null +++ b/tests/unit/models/error-source.test.ts @@ -0,0 +1,17 @@ +import { ErrorSource } from '../../../models/error-source'; + +describe('ErrorSource', () => { + test('should accept the expected shape', () => { + const fixture: ErrorSource = { + parameter: 'test-parameter', + field: 'test-field', + header: 'test-header', + reference: 'test-reference', + }; + + expect(fixture.parameter).toBe('test-parameter'); + expect(fixture.field).toBe('test-field'); + expect(fixture.header).toBe('test-header'); + expect(fixture.reference).toBe('test-reference'); + }); +}); diff --git a/tests/unit/models/failure-webhook.test.ts b/tests/unit/models/failure-webhook.test.ts new file mode 100644 index 0000000..7e12530 --- /dev/null +++ b/tests/unit/models/failure-webhook.test.ts @@ -0,0 +1,21 @@ +import { FailureWebhook } from '../../../models/failure-webhook'; + +describe('FailureWebhook', () => { + test('should accept the expected shape', () => { + const fixture: FailureWebhook = { + accountId: 'test-accountId', + phoneNumber: 'test-phoneNumber', + errorCode: 'test-errorCode', + errorMessage: 'test-errorMessage', + errors: [], + internalTicketNumber: 'test-internalTicketNumber', + }; + + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.phoneNumber).toBe('test-phoneNumber'); + expect(fixture.errorCode).toBe('test-errorCode'); + expect(fixture.errorMessage).toBe('test-errorMessage'); + expect(fixture.errors).toEqual([]); + expect(fixture.internalTicketNumber).toBe('test-internalTicketNumber'); + }); +}); diff --git a/tests/unit/models/field-error.test.ts b/tests/unit/models/field-error.test.ts new file mode 100644 index 0000000..ff045a2 --- /dev/null +++ b/tests/unit/models/field-error.test.ts @@ -0,0 +1,13 @@ +import { FieldError } from '../../../models/field-error'; + +describe('FieldError', () => { + test('should accept the expected shape', () => { + const fixture: FieldError = { + fieldName: 'test-fieldName', + description: 'test-description', + }; + + expect(fixture.fieldName).toBe('test-fieldName'); + expect(fixture.description).toBe('test-description'); + }); +}); diff --git a/tests/unit/models/gather-callback.test.ts b/tests/unit/models/gather-callback.test.ts new file mode 100644 index 0000000..ae1b7d3 --- /dev/null +++ b/tests/unit/models/gather-callback.test.ts @@ -0,0 +1,46 @@ +import { GatherCallback } from '../../../models/gather-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; + +describe('GatherCallback', () => { + test('should accept the expected shape', () => { + const fixture: GatherCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + direction: CallDirectionEnum.Inbound, + callId: 'test-callId', + digits: 'test-digits', + callUrl: 'test-callUrl', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + answerTime: 'test-answerTime', + parentCallId: 'test-parentCallId', + terminatingDigit: 'test-terminatingDigit', + transferCallerId: 'test-transferCallerId', + transferTo: 'test-transferTo', + tag: 'test-tag', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.digits).toBe('test-digits'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.answerTime).toBe('test-answerTime'); + expect(fixture.parentCallId).toBe('test-parentCallId'); + expect(fixture.terminatingDigit).toBe('test-terminatingDigit'); + expect(fixture.transferCallerId).toBe('test-transferCallerId'); + expect(fixture.transferTo).toBe('test-transferTo'); + expect(fixture.tag).toBe('test-tag'); + }); +}); diff --git a/tests/unit/models/get-async-bulk-lookup-response-data.test.ts b/tests/unit/models/get-async-bulk-lookup-response-data.test.ts new file mode 100644 index 0000000..42d3e76 --- /dev/null +++ b/tests/unit/models/get-async-bulk-lookup-response-data.test.ts @@ -0,0 +1,16 @@ +import { GetAsyncBulkLookupResponseData } from '../../../models/get-async-bulk-lookup-response-data'; +import { InProgressLookupStatusEnum } from '../../../models/in-progress-lookup-status-enum'; + +describe('GetAsyncBulkLookupResponseData', () => { + test('should accept the expected shape', () => { + const fixture: GetAsyncBulkLookupResponseData = { + requestId: 'test-requestId', + status: InProgressLookupStatusEnum.InProgress, + results: [], + }; + + expect(fixture.requestId).toBe('test-requestId'); + expect(fixture.status).toBe(InProgressLookupStatusEnum.InProgress); + expect(fixture.results).toEqual([]); + }); +}); diff --git a/tests/unit/models/get-async-bulk-lookup-response.test.ts b/tests/unit/models/get-async-bulk-lookup-response.test.ts new file mode 100644 index 0000000..6b9fead --- /dev/null +++ b/tests/unit/models/get-async-bulk-lookup-response.test.ts @@ -0,0 +1,16 @@ +import { GetAsyncBulkLookupResponse } from '../../../models/get-async-bulk-lookup-response'; +import { GetAsyncBulkLookupResponseData } from '../../../models/get-async-bulk-lookup-response-data'; + +describe('GetAsyncBulkLookupResponse', () => { + test('should accept the expected shape', () => { + const fixture: GetAsyncBulkLookupResponse = { + links: [], + data: {} as unknown as GetAsyncBulkLookupResponseData, + errors: [], + }; + + expect(fixture.links).toEqual([]); + expect(fixture.data).toBeDefined(); + expect(fixture.errors).toEqual([]); + }); +}); diff --git a/tests/unit/models/inbound-callback-message.test.ts b/tests/unit/models/inbound-callback-message.test.ts new file mode 100644 index 0000000..2be69ce --- /dev/null +++ b/tests/unit/models/inbound-callback-message.test.ts @@ -0,0 +1,48 @@ +import { InboundCallbackMessage } from '../../../models/inbound-callback-message'; +import { MessageDirectionEnum } from '../../../models/message-direction-enum'; +import { PriorityEnum } from '../../../models/priority-enum'; +import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum'; +import { MultiChannelMessageContent } from '../../../models/multi-channel-message-content'; +import { RbmSuggestionResponse } from '../../../models/rbm-suggestion-response'; +import { RbmLocationResponse } from '../../../models/rbm-location-response'; + +describe('InboundCallbackMessage', () => { + test('should accept the expected shape', () => { + const fixture: InboundCallbackMessage = { + id: 'test-id', + owner: 'test-owner', + applicationId: 'test-applicationId', + time: 'test-time', + segmentCount: 1.5, + direction: MessageDirectionEnum.In, + // @ts-expect-error + to: [], + from: 'test-from', + text: 'test-text', + tag: 'test-tag', + media: [], + priority: PriorityEnum.Default, + channel: MultiChannelMessageChannelEnum.Rbm, + content: {} as unknown as MultiChannelMessageContent, + suggestionResponse: {} as unknown as RbmSuggestionResponse, + locationResponse: {} as unknown as RbmLocationResponse, + }; + + expect(fixture.id).toBe('test-id'); + expect(fixture.owner).toBe('test-owner'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.time).toBe('test-time'); + expect(fixture.segmentCount).toBe(1.5); + expect(fixture.direction).toBe(MessageDirectionEnum.In); + expect(fixture.to).toEqual([]); + expect(fixture.from).toBe('test-from'); + expect(fixture.text).toBe('test-text'); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.media).toEqual([]); + expect(fixture.priority).toBe(PriorityEnum.Default); + expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm); + expect(fixture.content).toBeDefined(); + expect(fixture.suggestionResponse).toBeDefined(); + expect(fixture.locationResponse).toBeDefined(); + }); +}); diff --git a/tests/unit/models/inbound-callback.test.ts b/tests/unit/models/inbound-callback.test.ts new file mode 100644 index 0000000..86399d9 --- /dev/null +++ b/tests/unit/models/inbound-callback.test.ts @@ -0,0 +1,23 @@ +import { InboundCallback } from '../../../models/inbound-callback'; +import { InboundCallbackTypeEnum } from '../../../models/inbound-callback-type-enum'; +import { InboundCallbackMessage } from '../../../models/inbound-callback-message'; + +describe('InboundCallback', () => { + test('should accept the expected shape', () => { + const fixture: InboundCallback = { + time: 'test-time', + type: InboundCallbackTypeEnum.MessageReceived, + to: 'test-to', + description: 'test-description', + message: {} as unknown as InboundCallbackMessage, + carrierName: 'test-carrierName', + }; + + expect(fixture.time).toBe('test-time'); + expect(fixture.type).toBe(InboundCallbackTypeEnum.MessageReceived); + expect(fixture.to).toBe('test-to'); + expect(fixture.description).toBe('test-description'); + expect(fixture.message).toBeDefined(); + expect(fixture.carrierName).toBe('test-carrierName'); + }); +}); diff --git a/tests/unit/models/initiate-callback.test.ts b/tests/unit/models/initiate-callback.test.ts new file mode 100644 index 0000000..3360fe4 --- /dev/null +++ b/tests/unit/models/initiate-callback.test.ts @@ -0,0 +1,38 @@ +import { InitiateCallback } from '../../../models/initiate-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; +import { Diversion } from '../../../models/diversion'; +import { StirShaken } from '../../../models/stir-shaken'; + +describe('InitiateCallback', () => { + test('should accept the expected shape', () => { + const fixture: InitiateCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + direction: CallDirectionEnum.Inbound, + callId: 'test-callId', + callUrl: 'test-callUrl', + startTime: 'test-startTime', + diversion: {} as unknown as Diversion, + stirShaken: {} as unknown as StirShaken, + uui: 'test-uui', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.diversion).toBeDefined(); + expect(fixture.stirShaken).toBeDefined(); + expect(fixture.uui).toBe('test-uui'); + }); +}); diff --git a/tests/unit/models/link-schema.test.ts b/tests/unit/models/link-schema.test.ts new file mode 100644 index 0000000..8288903 --- /dev/null +++ b/tests/unit/models/link-schema.test.ts @@ -0,0 +1,15 @@ +import { LinkSchema } from '../../../models/link-schema'; + +describe('LinkSchema', () => { + test('should accept the expected shape', () => { + const fixture: LinkSchema = { + href: 'test-href', + rel: 'test-rel', + method: 'test-method', + }; + + expect(fixture.href).toBe('test-href'); + expect(fixture.rel).toBe('test-rel'); + expect(fixture.method).toBe('test-method'); + }); +}); diff --git a/tests/unit/models/link.test.ts b/tests/unit/models/link.test.ts new file mode 100644 index 0000000..3673dbe --- /dev/null +++ b/tests/unit/models/link.test.ts @@ -0,0 +1,13 @@ +import { Link } from '../../../models/link'; + +describe('Link', () => { + test('should accept the expected shape', () => { + const fixture: Link = { + rel: 'test-rel', + href: 'test-href', + }; + + expect(fixture.rel).toBe('test-rel'); + expect(fixture.href).toBe('test-href'); + }); +}); diff --git a/tests/unit/models/links-object.test.ts b/tests/unit/models/links-object.test.ts new file mode 100644 index 0000000..19b575e --- /dev/null +++ b/tests/unit/models/links-object.test.ts @@ -0,0 +1,17 @@ +import { LinksObject } from '../../../models/links-object'; + +describe('LinksObject', () => { + test('should accept the expected shape', () => { + const fixture: LinksObject = { + first: 'test-first', + next: 'test-next', + previous: 'test-previous', + last: 'test-last', + }; + + expect(fixture.first).toBe('test-first'); + expect(fixture.next).toBe('test-next'); + expect(fixture.previous).toBe('test-previous'); + expect(fixture.last).toBe('test-last'); + }); +}); diff --git a/tests/unit/models/list-message-item.test.ts b/tests/unit/models/list-message-item.test.ts new file mode 100644 index 0000000..a8e66b9 --- /dev/null +++ b/tests/unit/models/list-message-item.test.ts @@ -0,0 +1,58 @@ +import { ListMessageItem } from '../../../models/list-message-item'; +import { MessageStatusEnum } from '../../../models/message-status-enum'; +import { ListMessageDirectionEnum } from '../../../models/list-message-direction-enum'; +import { MessageTypeEnum } from '../../../models/message-type-enum'; + +describe('ListMessageItem', () => { + test('should accept the expected shape', () => { + const fixture: ListMessageItem = { + messageId: 'test-messageId', + accountId: 'test-accountId', + sourceTn: 'test-sourceTn', + destinationTn: 'test-destinationTn', + messageStatus: MessageStatusEnum.Received, + messageDirection: ListMessageDirectionEnum.Inbound, + messageType: MessageTypeEnum.Sms, + segmentCount: 1.5, + errorCode: 1.5, + receiveTime: 'test-receiveTime', + carrierName: 'test-carrierName', + messageSize: 1.5, + messageLength: 1.5, + attachmentCount: 1.5, + recipientCount: 1.5, + campaignClass: 'test-campaignClass', + campaignId: 'test-campaignId', + bwLatency: 1.5, + carrierLatency: 1.5, + callingNumberCountryA3: 'test-callingNumberCountryA3', + calledNumberCountryA3: 'test-calledNumberCountryA3', + product: 'test-product', + location: 'test-location', + }; + + expect(fixture.messageId).toBe('test-messageId'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.sourceTn).toBe('test-sourceTn'); + expect(fixture.destinationTn).toBe('test-destinationTn'); + expect(fixture.messageStatus).toBe(MessageStatusEnum.Received); + expect(fixture.messageDirection).toBe(ListMessageDirectionEnum.Inbound); + expect(fixture.messageType).toBe(MessageTypeEnum.Sms); + expect(fixture.segmentCount).toBe(1.5); + expect(fixture.errorCode).toBe(1.5); + expect(fixture.receiveTime).toBe('test-receiveTime'); + expect(fixture.carrierName).toBe('test-carrierName'); + expect(fixture.messageSize).toBe(1.5); + expect(fixture.messageLength).toBe(1.5); + expect(fixture.attachmentCount).toBe(1.5); + expect(fixture.recipientCount).toBe(1.5); + expect(fixture.campaignClass).toBe('test-campaignClass'); + expect(fixture.campaignId).toBe('test-campaignId'); + expect(fixture.bwLatency).toBe(1.5); + expect(fixture.carrierLatency).toBe(1.5); + expect(fixture.callingNumberCountryA3).toBe('test-callingNumberCountryA3'); + expect(fixture.calledNumberCountryA3).toBe('test-calledNumberCountryA3'); + expect(fixture.product).toBe('test-product'); + expect(fixture.location).toBe('test-location'); + }); +}); diff --git a/tests/unit/models/lookup-error-response.test.ts b/tests/unit/models/lookup-error-response.test.ts new file mode 100644 index 0000000..4915ce9 --- /dev/null +++ b/tests/unit/models/lookup-error-response.test.ts @@ -0,0 +1,13 @@ +import { LookupErrorResponse } from '../../../models/lookup-error-response'; + +describe('LookupErrorResponse', () => { + test('should accept the expected shape', () => { + const fixture: LookupErrorResponse = { + links: [], + errors: [], + }; + + expect(fixture.links).toEqual([]); + expect(fixture.errors).toEqual([]); + }); +}); diff --git a/tests/unit/models/lookup-error-schema-meta.test.ts b/tests/unit/models/lookup-error-schema-meta.test.ts new file mode 100644 index 0000000..08f27ed --- /dev/null +++ b/tests/unit/models/lookup-error-schema-meta.test.ts @@ -0,0 +1,15 @@ +import { LookupErrorSchemaMeta } from '../../../models/lookup-error-schema-meta'; + +describe('LookupErrorSchemaMeta', () => { + test('should accept the expected shape', () => { + const fixture: LookupErrorSchemaMeta = { + phoneNumbers: [], + message: 'test-message', + code: 1.5, + }; + + expect(fixture.phoneNumbers).toEqual([]); + expect(fixture.message).toBe('test-message'); + expect(fixture.code).toBe(1.5); + }); +}); diff --git a/tests/unit/models/lookup-error-schema.test.ts b/tests/unit/models/lookup-error-schema.test.ts new file mode 100644 index 0000000..c7e7e7f --- /dev/null +++ b/tests/unit/models/lookup-error-schema.test.ts @@ -0,0 +1,18 @@ +import { LookupErrorSchema } from '../../../models/lookup-error-schema'; +import { LookupErrorSchemaMeta } from '../../../models/lookup-error-schema-meta'; + +describe('LookupErrorSchema', () => { + test('should accept the expected shape', () => { + const fixture: LookupErrorSchema = { + code: 'test-code', + description: 'test-description', + type: 'test-type', + meta: {} as unknown as LookupErrorSchemaMeta, + }; + + expect(fixture.code).toBe('test-code'); + expect(fixture.description).toBe('test-description'); + expect(fixture.type).toBe('test-type'); + expect(fixture.meta).toBeDefined(); + }); +}); diff --git a/tests/unit/models/lookup-result.test.ts b/tests/unit/models/lookup-result.test.ts new file mode 100644 index 0000000..1c33c9e --- /dev/null +++ b/tests/unit/models/lookup-result.test.ts @@ -0,0 +1,36 @@ +import { LookupResult } from '../../../models/lookup-result'; +import { LineTypeEnum } from '../../../models/line-type-enum'; +import { DeactivationEventEnum } from '../../../models/deactivation-event-enum'; +import { LatestMessageDeliveryStatusEnum } from '../../../models/latest-message-delivery-status-enum'; + +describe('LookupResult', () => { + test('should accept the expected shape', () => { + const fixture: LookupResult = { + phoneNumber: 'test-phoneNumber', + lineType: LineTypeEnum.Fixed, + messagingProvider: 'test-messagingProvider', + voiceProvider: 'test-voiceProvider', + countryCodeA3: 'test-countryCodeA3', + deactivationReporter: 'test-deactivationReporter', + deactivationDate: 'test-deactivationDate', + deactivationEvent: DeactivationEventEnum.Deactivated, + latestMessageDeliveryStatus: LatestMessageDeliveryStatusEnum.Active, + initialMessageDeliveryStatusDate: 'test-initialMessageDeliveryStatusDate', + latestMessageDeliveryStatusDate: 'test-latestMessageDeliveryStatusDate', + rcsEnabled: true, + }; + + expect(fixture.phoneNumber).toBe('test-phoneNumber'); + expect(fixture.lineType).toBe(LineTypeEnum.Fixed); + expect(fixture.messagingProvider).toBe('test-messagingProvider'); + expect(fixture.voiceProvider).toBe('test-voiceProvider'); + expect(fixture.countryCodeA3).toBe('test-countryCodeA3'); + expect(fixture.deactivationReporter).toBe('test-deactivationReporter'); + expect(fixture.deactivationDate).toBe('test-deactivationDate'); + expect(fixture.deactivationEvent).toBe(DeactivationEventEnum.Deactivated); + expect(fixture.latestMessageDeliveryStatus).toBe(LatestMessageDeliveryStatusEnum.Active); + expect(fixture.initialMessageDeliveryStatusDate).toBe('test-initialMessageDeliveryStatusDate'); + expect(fixture.latestMessageDeliveryStatusDate).toBe('test-latestMessageDeliveryStatusDate'); + expect(fixture.rcsEnabled).toBe(true); + }); +}); diff --git a/tests/unit/models/machine-detection-complete-callback.test.ts b/tests/unit/models/machine-detection-complete-callback.test.ts new file mode 100644 index 0000000..c7d5d86 --- /dev/null +++ b/tests/unit/models/machine-detection-complete-callback.test.ts @@ -0,0 +1,39 @@ +import { MachineDetectionCompleteCallback } from '../../../models/machine-detection-complete-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; +import { MachineDetectionResult } from '../../../models/machine-detection-result'; + +describe('MachineDetectionCompleteCallback', () => { + test('should accept the expected shape', () => { + const fixture: MachineDetectionCompleteCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + direction: CallDirectionEnum.Inbound, + callId: 'test-callId', + callUrl: 'test-callUrl', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + answerTime: 'test-answerTime', + tag: 'test-tag', + machineDetectionResult: {} as unknown as MachineDetectionResult, + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.answerTime).toBe('test-answerTime'); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.machineDetectionResult).toBeDefined(); + }); +}); diff --git a/tests/unit/models/machine-detection-configuration.test.ts b/tests/unit/models/machine-detection-configuration.test.ts new file mode 100644 index 0000000..3af1760 --- /dev/null +++ b/tests/unit/models/machine-detection-configuration.test.ts @@ -0,0 +1,41 @@ +import { MachineDetectionConfiguration } from '../../../models/machine-detection-configuration'; +import { MachineDetectionModeEnum } from '../../../models/machine-detection-mode-enum'; +import { CallbackMethodEnum } from '../../../models/callback-method-enum'; + +describe('MachineDetectionConfiguration', () => { + test('should accept the expected shape', () => { + const fixture: MachineDetectionConfiguration = { + mode: MachineDetectionModeEnum.Sync, + detectionTimeout: 1.5, + silenceTimeout: 1.5, + speechThreshold: 1.5, + speechEndThreshold: 1.5, + machineSpeechEndThreshold: 1.5, + delayResult: true, + callbackUrl: 'test-callbackUrl', + callbackMethod: CallbackMethodEnum.Get, + username: 'test-username', + password: 'test-password', + fallbackUrl: 'test-fallbackUrl', + fallbackMethod: CallbackMethodEnum.Get, + fallbackUsername: 'test-fallbackUsername', + fallbackPassword: 'test-fallbackPassword', + }; + + expect(fixture.mode).toBe(MachineDetectionModeEnum.Sync); + expect(fixture.detectionTimeout).toBe(1.5); + expect(fixture.silenceTimeout).toBe(1.5); + expect(fixture.speechThreshold).toBe(1.5); + expect(fixture.speechEndThreshold).toBe(1.5); + expect(fixture.machineSpeechEndThreshold).toBe(1.5); + expect(fixture.delayResult).toBe(true); + expect(fixture.callbackUrl).toBe('test-callbackUrl'); + expect(fixture.callbackMethod).toBe(CallbackMethodEnum.Get); + expect(fixture.username).toBe('test-username'); + expect(fixture.password).toBe('test-password'); + expect(fixture.fallbackUrl).toBe('test-fallbackUrl'); + expect(fixture.fallbackMethod).toBe(CallbackMethodEnum.Get); + expect(fixture.fallbackUsername).toBe('test-fallbackUsername'); + expect(fixture.fallbackPassword).toBe('test-fallbackPassword'); + }); +}); diff --git a/tests/unit/models/machine-detection-result.test.ts b/tests/unit/models/machine-detection-result.test.ts new file mode 100644 index 0000000..b022afa --- /dev/null +++ b/tests/unit/models/machine-detection-result.test.ts @@ -0,0 +1,13 @@ +import { MachineDetectionResult } from '../../../models/machine-detection-result'; + +describe('MachineDetectionResult', () => { + test('should accept the expected shape', () => { + const fixture: MachineDetectionResult = { + value: 'test-value', + duration: 'test-duration', + }; + + expect(fixture.value).toBe('test-value'); + expect(fixture.duration).toBe('test-duration'); + }); +}); diff --git a/tests/unit/models/media.test.ts b/tests/unit/models/media.test.ts new file mode 100644 index 0000000..253267a --- /dev/null +++ b/tests/unit/models/media.test.ts @@ -0,0 +1,15 @@ +import { Media } from '../../../models/media'; + +describe('Media', () => { + test('should accept the expected shape', () => { + const fixture: Media = { + content: 'test-content', + contentLength: 1.5, + mediaName: 'test-mediaName', + }; + + expect(fixture.content).toBe('test-content'); + expect(fixture.contentLength).toBe(1.5); + expect(fixture.mediaName).toBe('test-mediaName'); + }); +}); diff --git a/tests/unit/models/message-request.test.ts b/tests/unit/models/message-request.test.ts new file mode 100644 index 0000000..30d215e --- /dev/null +++ b/tests/unit/models/message-request.test.ts @@ -0,0 +1,27 @@ +import { MessageRequest } from '../../../models/message-request'; +import { PriorityEnum } from '../../../models/priority-enum'; + +describe('MessageRequest', () => { + test('should accept the expected shape', () => { + const fixture: MessageRequest = { + applicationId: 'test-applicationId', + // @ts-expect-error SWI-11047: typed as Set but runtime is Array + to: [], + from: 'test-from', + text: 'test-text', + media: [], + tag: 'test-tag', + priority: PriorityEnum.Default, + expiration: 'test-expiration', + }; + + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.to).toEqual([]); + expect(fixture.from).toBe('test-from'); + expect(fixture.text).toBe('test-text'); + expect(fixture.media).toEqual([]); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.priority).toBe(PriorityEnum.Default); + expect(fixture.expiration).toBe('test-expiration'); + }); +}); diff --git a/tests/unit/models/message.test.ts b/tests/unit/models/message.test.ts new file mode 100644 index 0000000..f619233 --- /dev/null +++ b/tests/unit/models/message.test.ts @@ -0,0 +1,39 @@ +import { Message } from '../../../models/message'; +import { MessageDirectionEnum } from '../../../models/message-direction-enum'; +import { PriorityEnum } from '../../../models/priority-enum'; + +describe('Message', () => { + test('should accept the expected shape', () => { + const fixture: Message = { + id: 'test-id', + owner: 'test-owner', + applicationId: 'test-applicationId', + time: 'test-time', + segmentCount: 1.5, + direction: MessageDirectionEnum.In, + // @ts-expect-error SWI-11047: typed as Set but runtime is Array + to: [], + from: 'test-from', + // @ts-expect-error SWI-11047: typed as Set but runtime is Array + media: [], + text: 'test-text', + tag: 'test-tag', + priority: PriorityEnum.Default, + expiration: 'test-expiration', + }; + + expect(fixture.id).toBe('test-id'); + expect(fixture.owner).toBe('test-owner'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.time).toBe('test-time'); + expect(fixture.segmentCount).toBe(1.5); + expect(fixture.direction).toBe(MessageDirectionEnum.In); + expect(fixture.to).toEqual([]); + expect(fixture.from).toBe('test-from'); + expect(fixture.media).toEqual([]); + expect(fixture.text).toBe('test-text'); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.priority).toBe(PriorityEnum.Default); + expect(fixture.expiration).toBe('test-expiration'); + }); +}); diff --git a/tests/unit/models/messages-list.test.ts b/tests/unit/models/messages-list.test.ts new file mode 100644 index 0000000..34f43b2 --- /dev/null +++ b/tests/unit/models/messages-list.test.ts @@ -0,0 +1,16 @@ +import { MessagesList } from '../../../models/messages-list'; +import { PageInfo } from '../../../models/page-info'; + +describe('MessagesList', () => { + test('should accept the expected shape', () => { + const fixture: MessagesList = { + totalCount: 1.5, + pageInfo: {} as unknown as PageInfo, + messages: [], + }; + + expect(fixture.totalCount).toBe(1.5); + expect(fixture.pageInfo).toBeDefined(); + expect(fixture.messages).toEqual([]); + }); +}); diff --git a/tests/unit/models/messaging-code-response.test.ts b/tests/unit/models/messaging-code-response.test.ts new file mode 100644 index 0000000..0f5c13f --- /dev/null +++ b/tests/unit/models/messaging-code-response.test.ts @@ -0,0 +1,11 @@ +import { MessagingCodeResponse } from '../../../models/messaging-code-response'; + +describe('MessagingCodeResponse', () => { + test('should accept the expected shape', () => { + const fixture: MessagingCodeResponse = { + messageId: 'test-messageId', + }; + + expect(fixture.messageId).toBe('test-messageId'); + }); +}); diff --git a/tests/unit/models/messaging-request-error.test.ts b/tests/unit/models/messaging-request-error.test.ts new file mode 100644 index 0000000..43456bc --- /dev/null +++ b/tests/unit/models/messaging-request-error.test.ts @@ -0,0 +1,13 @@ +import { MessagingRequestError } from '../../../models/messaging-request-error'; + +describe('MessagingRequestError', () => { + test('should accept the expected shape', () => { + const fixture: MessagingRequestError = { + type: 'test-type', + description: 'test-description', + }; + + expect(fixture.type).toBe('test-type'); + expect(fixture.description).toBe('test-description'); + }); +}); diff --git a/tests/unit/models/mfa-forbidden-request-error.test.ts b/tests/unit/models/mfa-forbidden-request-error.test.ts new file mode 100644 index 0000000..116cd0c --- /dev/null +++ b/tests/unit/models/mfa-forbidden-request-error.test.ts @@ -0,0 +1,11 @@ +import { MfaForbiddenRequestError } from '../../../models/mfa-forbidden-request-error'; + +describe('MfaForbiddenRequestError', () => { + test('should accept the expected shape', () => { + const fixture: MfaForbiddenRequestError = { + message: 'test-message', + }; + + expect(fixture.message).toBe('test-message'); + }); +}); diff --git a/tests/unit/models/mfa-request-error.test.ts b/tests/unit/models/mfa-request-error.test.ts new file mode 100644 index 0000000..0362f39 --- /dev/null +++ b/tests/unit/models/mfa-request-error.test.ts @@ -0,0 +1,13 @@ +import { MfaRequestError } from '../../../models/mfa-request-error'; + +describe('MfaRequestError', () => { + test('should accept the expected shape', () => { + const fixture: MfaRequestError = { + error: 'test-error', + requestId: 'test-requestId', + }; + + expect(fixture.error).toBe('test-error'); + expect(fixture.requestId).toBe('test-requestId'); + }); +}); diff --git a/tests/unit/models/mfa-unauthorized-request-error.test.ts b/tests/unit/models/mfa-unauthorized-request-error.test.ts new file mode 100644 index 0000000..92c9080 --- /dev/null +++ b/tests/unit/models/mfa-unauthorized-request-error.test.ts @@ -0,0 +1,11 @@ +import { MfaUnauthorizedRequestError } from '../../../models/mfa-unauthorized-request-error'; + +describe('MfaUnauthorizedRequestError', () => { + test('should accept the expected shape', () => { + const fixture: MfaUnauthorizedRequestError = { + message: 'test-message', + }; + + expect(fixture.message).toBe('test-message'); + }); +}); diff --git a/tests/unit/models/mms-message-content-file.test.ts b/tests/unit/models/mms-message-content-file.test.ts new file mode 100644 index 0000000..a14f537 --- /dev/null +++ b/tests/unit/models/mms-message-content-file.test.ts @@ -0,0 +1,11 @@ +import { MmsMessageContentFile } from '../../../models/mms-message-content-file'; + +describe('MmsMessageContentFile', () => { + test('should accept the expected shape', () => { + const fixture: MmsMessageContentFile = { + fileUrl: 'test-fileUrl', + }; + + expect(fixture.fileUrl).toBe('test-fileUrl'); + }); +}); diff --git a/tests/unit/models/mms-message-content.test.ts b/tests/unit/models/mms-message-content.test.ts new file mode 100644 index 0000000..93010f4 --- /dev/null +++ b/tests/unit/models/mms-message-content.test.ts @@ -0,0 +1,13 @@ +import { MmsMessageContent } from '../../../models/mms-message-content'; + +describe('MmsMessageContent', () => { + test('should accept the expected shape', () => { + const fixture: MmsMessageContent = { + text: 'test-text', + media: [], + }; + + expect(fixture.text).toBe('test-text'); + expect(fixture.media).toEqual([]); + }); +}); diff --git a/tests/unit/models/multi-channel-action-calendar-event.test.ts b/tests/unit/models/multi-channel-action-calendar-event.test.ts new file mode 100644 index 0000000..f934aee --- /dev/null +++ b/tests/unit/models/multi-channel-action-calendar-event.test.ts @@ -0,0 +1,24 @@ +import { MultiChannelActionCalendarEvent } from '../../../models/multi-channel-action-calendar-event'; +import { RbmActionTypeEnum } from '../../../models/rbm-action-type-enum'; + +describe('MultiChannelActionCalendarEvent', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelActionCalendarEvent = { + type: RbmActionTypeEnum.Reply, + text: 'test-text', + postbackData: 'test-postbackData', + title: 'test-title', + startTime: 'test-startTime', + endTime: 'test-endTime', + description: 'test-description', + }; + + expect(fixture.type).toBe(RbmActionTypeEnum.Reply); + expect(fixture.text).toBe('test-text'); + expect(fixture.postbackData).toBe('test-postbackData'); + expect(fixture.title).toBe('test-title'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.endTime).toBe('test-endTime'); + expect(fixture.description).toBe('test-description'); + }); +}); diff --git a/tests/unit/models/multi-channel-action.test.ts b/tests/unit/models/multi-channel-action.test.ts new file mode 100644 index 0000000..b95a372 --- /dev/null +++ b/tests/unit/models/multi-channel-action.test.ts @@ -0,0 +1,40 @@ +import { MultiChannelAction } from '../../../models/multi-channel-action'; +import { RbmActionTypeEnum } from '../../../models/rbm-action-type-enum'; +import { RbmOpenUrlEnum } from '../../../models/rbm-open-url-enum'; +import { RbmWebViewEnum } from '../../../models/rbm-web-view-enum'; + +describe('MultiChannelAction', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelAction = { + type: RbmActionTypeEnum.Reply, + text: 'test-text', + postbackData: 'test-postbackData', + phoneNumber: 'test-phoneNumber', + latitude: 1.5, + longitude: 1.5, + label: 'test-label', + title: 'test-title', + startTime: 'test-startTime', + endTime: 'test-endTime', + description: 'test-description', + url: 'test-url', + application: RbmOpenUrlEnum.Browser, + webviewViewMode: RbmWebViewEnum.Full, + }; + + expect(fixture.type).toBe(RbmActionTypeEnum.Reply); + expect(fixture.text).toBe('test-text'); + expect(fixture.postbackData).toBe('test-postbackData'); + expect(fixture.phoneNumber).toBe('test-phoneNumber'); + expect(fixture.latitude).toBe(1.5); + expect(fixture.longitude).toBe(1.5); + expect(fixture.label).toBe('test-label'); + expect(fixture.title).toBe('test-title'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.endTime).toBe('test-endTime'); + expect(fixture.description).toBe('test-description'); + expect(fixture.url).toBe('test-url'); + expect(fixture.application).toBe(RbmOpenUrlEnum.Browser); + expect(fixture.webviewViewMode).toBe(RbmWebViewEnum.Full); + }); +}); diff --git a/tests/unit/models/multi-channel-channel-list-mmsobject.test.ts b/tests/unit/models/multi-channel-channel-list-mmsobject.test.ts new file mode 100644 index 0000000..02261d6 --- /dev/null +++ b/tests/unit/models/multi-channel-channel-list-mmsobject.test.ts @@ -0,0 +1,19 @@ +import { MultiChannelChannelListMMSObject } from '../../../models/multi-channel-channel-list-mmsobject'; +import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum'; +import { MmsMessageContent } from '../../../models/mms-message-content'; + +describe('MultiChannelChannelListMMSObject', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelChannelListMMSObject = { + from: 'test-from', + applicationId: 'test-applicationId', + channel: MultiChannelMessageChannelEnum.Rbm, + content: {} as unknown as MmsMessageContent, + }; + + expect(fixture.from).toBe('test-from'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm); + expect(fixture.content).toBeDefined(); + }); +}); diff --git a/tests/unit/models/multi-channel-channel-list-mmsresponse-object.test.ts b/tests/unit/models/multi-channel-channel-list-mmsresponse-object.test.ts new file mode 100644 index 0000000..052499f --- /dev/null +++ b/tests/unit/models/multi-channel-channel-list-mmsresponse-object.test.ts @@ -0,0 +1,21 @@ +import { MultiChannelChannelListMMSResponseObject } from '../../../models/multi-channel-channel-list-mmsresponse-object'; +import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum'; +import { MmsMessageContent } from '../../../models/mms-message-content'; + +describe('MultiChannelChannelListMMSResponseObject', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelChannelListMMSResponseObject = { + from: 'test-from', + applicationId: 'test-applicationId', + channel: MultiChannelMessageChannelEnum.Rbm, + content: {} as unknown as MmsMessageContent, + owner: 'test-owner', + }; + + expect(fixture.from).toBe('test-from'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm); + expect(fixture.content).toBeDefined(); + expect(fixture.owner).toBe('test-owner'); + }); +}); diff --git a/tests/unit/models/multi-channel-channel-list-object-base.test.ts b/tests/unit/models/multi-channel-channel-list-object-base.test.ts new file mode 100644 index 0000000..1d428e9 --- /dev/null +++ b/tests/unit/models/multi-channel-channel-list-object-base.test.ts @@ -0,0 +1,16 @@ +import { MultiChannelChannelListObjectBase } from '../../../models/multi-channel-channel-list-object-base'; +import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum'; + +describe('MultiChannelChannelListObjectBase', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelChannelListObjectBase = { + from: 'test-from', + applicationId: 'test-applicationId', + channel: MultiChannelMessageChannelEnum.Rbm, + }; + + expect(fixture.from).toBe('test-from'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm); + }); +}); diff --git a/tests/unit/models/multi-channel-channel-list-owner-object.test.ts b/tests/unit/models/multi-channel-channel-list-owner-object.test.ts new file mode 100644 index 0000000..0b6e192 --- /dev/null +++ b/tests/unit/models/multi-channel-channel-list-owner-object.test.ts @@ -0,0 +1,11 @@ +import { MultiChannelChannelListOwnerObject } from '../../../models/multi-channel-channel-list-owner-object'; + +describe('MultiChannelChannelListOwnerObject', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelChannelListOwnerObject = { + owner: 'test-owner', + }; + + expect(fixture.owner).toBe('test-owner'); + }); +}); diff --git a/tests/unit/models/multi-channel-channel-list-rbmobject.test.ts b/tests/unit/models/multi-channel-channel-list-rbmobject.test.ts new file mode 100644 index 0000000..915c261 --- /dev/null +++ b/tests/unit/models/multi-channel-channel-list-rbmobject.test.ts @@ -0,0 +1,19 @@ +import { MultiChannelChannelListRBMObject } from '../../../models/multi-channel-channel-list-rbmobject'; +import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum'; +import { MultiChannelChannelListRBMObjectAllOfContent } from '../../../models/multi-channel-channel-list-rbmobject-all-of-content'; + +describe('MultiChannelChannelListRBMObject', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelChannelListRBMObject = { + from: 'test-from', + applicationId: 'test-applicationId', + channel: MultiChannelMessageChannelEnum.Rbm, + content: {} as unknown as MultiChannelChannelListRBMObjectAllOfContent, + }; + + expect(fixture.from).toBe('test-from'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm); + expect(fixture.content).toBeDefined(); + }); +}); diff --git a/tests/unit/models/multi-channel-channel-list-rbmresponse-object.test.ts b/tests/unit/models/multi-channel-channel-list-rbmresponse-object.test.ts new file mode 100644 index 0000000..a010572 --- /dev/null +++ b/tests/unit/models/multi-channel-channel-list-rbmresponse-object.test.ts @@ -0,0 +1,21 @@ +import { MultiChannelChannelListRBMResponseObject } from '../../../models/multi-channel-channel-list-rbmresponse-object'; +import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum'; +import { MultiChannelChannelListRBMObjectAllOfContent } from '../../../models/multi-channel-channel-list-rbmobject-all-of-content'; + +describe('MultiChannelChannelListRBMResponseObject', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelChannelListRBMResponseObject = { + from: 'test-from', + applicationId: 'test-applicationId', + channel: MultiChannelMessageChannelEnum.Rbm, + content: {} as unknown as MultiChannelChannelListRBMObjectAllOfContent, + owner: 'test-owner', + }; + + expect(fixture.from).toBe('test-from'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm); + expect(fixture.content).toBeDefined(); + expect(fixture.owner).toBe('test-owner'); + }); +}); diff --git a/tests/unit/models/multi-channel-channel-list-request-object.test.ts b/tests/unit/models/multi-channel-channel-list-request-object.test.ts new file mode 100644 index 0000000..1efdcd3 --- /dev/null +++ b/tests/unit/models/multi-channel-channel-list-request-object.test.ts @@ -0,0 +1,19 @@ +import { MultiChannelChannelListRequestObject } from '../../../models/multi-channel-channel-list-request-object'; +import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum'; +import { MmsMessageContent } from '../../../models/mms-message-content'; + +describe('MultiChannelChannelListRequestObject', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelChannelListRequestObject = { + from: 'test-from', + applicationId: 'test-applicationId', + channel: MultiChannelMessageChannelEnum.Rbm, + content: {} as unknown as MmsMessageContent, + }; + + expect(fixture.from).toBe('test-from'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm); + expect(fixture.content).toBeDefined(); + }); +}); diff --git a/tests/unit/models/multi-channel-channel-list-response-object.test.ts b/tests/unit/models/multi-channel-channel-list-response-object.test.ts new file mode 100644 index 0000000..1e9f782 --- /dev/null +++ b/tests/unit/models/multi-channel-channel-list-response-object.test.ts @@ -0,0 +1,21 @@ +import { MultiChannelChannelListResponseObject } from '../../../models/multi-channel-channel-list-response-object'; +import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum'; +import { MmsMessageContent } from '../../../models/mms-message-content'; + +describe('MultiChannelChannelListResponseObject', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelChannelListResponseObject = { + from: 'test-from', + applicationId: 'test-applicationId', + channel: MultiChannelMessageChannelEnum.Rbm, + content: {} as unknown as MmsMessageContent, + owner: 'test-owner', + }; + + expect(fixture.from).toBe('test-from'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm); + expect(fixture.content).toBeDefined(); + expect(fixture.owner).toBe('test-owner'); + }); +}); diff --git a/tests/unit/models/multi-channel-channel-list-smsobject.test.ts b/tests/unit/models/multi-channel-channel-list-smsobject.test.ts new file mode 100644 index 0000000..86aa0b9 --- /dev/null +++ b/tests/unit/models/multi-channel-channel-list-smsobject.test.ts @@ -0,0 +1,19 @@ +import { MultiChannelChannelListSMSObject } from '../../../models/multi-channel-channel-list-smsobject'; +import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum'; +import { SmsMessageContent } from '../../../models/sms-message-content'; + +describe('MultiChannelChannelListSMSObject', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelChannelListSMSObject = { + from: 'test-from', + applicationId: 'test-applicationId', + channel: MultiChannelMessageChannelEnum.Rbm, + content: {} as unknown as SmsMessageContent, + }; + + expect(fixture.from).toBe('test-from'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm); + expect(fixture.content).toBeDefined(); + }); +}); diff --git a/tests/unit/models/multi-channel-channel-list-smsresponse-object.test.ts b/tests/unit/models/multi-channel-channel-list-smsresponse-object.test.ts new file mode 100644 index 0000000..70caaba --- /dev/null +++ b/tests/unit/models/multi-channel-channel-list-smsresponse-object.test.ts @@ -0,0 +1,21 @@ +import { MultiChannelChannelListSMSResponseObject } from '../../../models/multi-channel-channel-list-smsresponse-object'; +import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum'; +import { SmsMessageContent } from '../../../models/sms-message-content'; + +describe('MultiChannelChannelListSMSResponseObject', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelChannelListSMSResponseObject = { + from: 'test-from', + applicationId: 'test-applicationId', + channel: MultiChannelMessageChannelEnum.Rbm, + content: {} as unknown as SmsMessageContent, + owner: 'test-owner', + }; + + expect(fixture.from).toBe('test-from'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm); + expect(fixture.content).toBeDefined(); + expect(fixture.owner).toBe('test-owner'); + }); +}); diff --git a/tests/unit/models/multi-channel-error.test.ts b/tests/unit/models/multi-channel-error.test.ts new file mode 100644 index 0000000..fe1c635 --- /dev/null +++ b/tests/unit/models/multi-channel-error.test.ts @@ -0,0 +1,13 @@ +import { MultiChannelError } from '../../../models/multi-channel-error'; + +describe('MultiChannelError', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelError = { + links: [], + errors: [], + }; + + expect(fixture.links).toEqual([]); + expect(fixture.errors).toEqual([]); + }); +}); diff --git a/tests/unit/models/multi-channel-message-content.test.ts b/tests/unit/models/multi-channel-message-content.test.ts new file mode 100644 index 0000000..ec68604 --- /dev/null +++ b/tests/unit/models/multi-channel-message-content.test.ts @@ -0,0 +1,14 @@ +import { MultiChannelMessageContent } from '../../../models/multi-channel-message-content'; +import { RbmMessageContentFile } from '../../../models/rbm-message-content-file'; + +describe('MultiChannelMessageContent', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelMessageContent = { + text: 'test-text', + media: {} as unknown as RbmMessageContentFile, + }; + + expect(fixture.text).toBe('test-text'); + expect(fixture.media).toBeDefined(); + }); +}); diff --git a/tests/unit/models/multi-channel-message-request.test.ts b/tests/unit/models/multi-channel-message-request.test.ts new file mode 100644 index 0000000..84765a9 --- /dev/null +++ b/tests/unit/models/multi-channel-message-request.test.ts @@ -0,0 +1,20 @@ +import { MultiChannelMessageRequest } from '../../../models/multi-channel-message-request'; +import { PriorityEnum } from '../../../models/priority-enum'; + +describe('MultiChannelMessageRequest', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelMessageRequest = { + to: 'test-to', + channelList: [], + tag: 'test-tag', + priority: PriorityEnum.Default, + expiration: 'test-expiration', + }; + + expect(fixture.to).toBe('test-to'); + expect(fixture.channelList).toEqual([]); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.priority).toBe(PriorityEnum.Default); + expect(fixture.expiration).toBe('test-expiration'); + }); +}); diff --git a/tests/unit/models/multi-channel-message-response-data.test.ts b/tests/unit/models/multi-channel-message-response-data.test.ts new file mode 100644 index 0000000..fa572e9 --- /dev/null +++ b/tests/unit/models/multi-channel-message-response-data.test.ts @@ -0,0 +1,28 @@ +import { MultiChannelMessageResponseData } from '../../../models/multi-channel-message-response-data'; +import { MessageDirectionEnum } from '../../../models/message-direction-enum'; +import { PriorityEnum } from '../../../models/priority-enum'; + +describe('MultiChannelMessageResponseData', () => { + test('should accept the expected shape', () => { + const fixture: MultiChannelMessageResponseData = { + id: 'test-id', + time: 'test-time', + direction: MessageDirectionEnum.In, + // @ts-expect-error SWI-11047: typed as Set but runtime is Array + to: [], + channelList: [], + tag: 'test-tag', + priority: PriorityEnum.Default, + expiration: 'test-expiration', + }; + + expect(fixture.id).toBe('test-id'); + expect(fixture.time).toBe('test-time'); + expect(fixture.direction).toBe(MessageDirectionEnum.In); + expect(fixture.to).toEqual([]); + expect(fixture.channelList).toEqual([]); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.priority).toBe(PriorityEnum.Default); + expect(fixture.expiration).toBe('test-expiration'); + }); +}); diff --git a/tests/unit/models/opt-in-workflow.test.ts b/tests/unit/models/opt-in-workflow.test.ts new file mode 100644 index 0000000..368d7a9 --- /dev/null +++ b/tests/unit/models/opt-in-workflow.test.ts @@ -0,0 +1,15 @@ +import { OptInWorkflow } from '../../../models/opt-in-workflow'; + +describe('OptInWorkflow', () => { + test('should accept the expected shape', () => { + const fixture: OptInWorkflow = { + description: 'test-description', + imageUrls: [], + confirmationResponse: 'test-confirmationResponse', + }; + + expect(fixture.description).toBe('test-description'); + expect(fixture.imageUrls).toEqual([]); + expect(fixture.confirmationResponse).toBe('test-confirmationResponse'); + }); +}); diff --git a/tests/unit/models/page-info.test.ts b/tests/unit/models/page-info.test.ts new file mode 100644 index 0000000..27b6c9a --- /dev/null +++ b/tests/unit/models/page-info.test.ts @@ -0,0 +1,17 @@ +import { PageInfo } from '../../../models/page-info'; + +describe('PageInfo', () => { + test('should accept the expected shape', () => { + const fixture: PageInfo = { + prevPage: 'test-prevPage', + nextPage: 'test-nextPage', + prevPageToken: 'test-prevPageToken', + nextPageToken: 'test-nextPageToken', + }; + + expect(fixture.prevPage).toBe('test-prevPage'); + expect(fixture.nextPage).toBe('test-nextPage'); + expect(fixture.prevPageToken).toBe('test-prevPageToken'); + expect(fixture.nextPageToken).toBe('test-nextPageToken'); + }); +}); diff --git a/tests/unit/models/rbm-action-base.test.ts b/tests/unit/models/rbm-action-base.test.ts new file mode 100644 index 0000000..35d7564 --- /dev/null +++ b/tests/unit/models/rbm-action-base.test.ts @@ -0,0 +1,16 @@ +import { RbmActionBase } from '../../../models/rbm-action-base'; +import { RbmActionTypeEnum } from '../../../models/rbm-action-type-enum'; + +describe('RbmActionBase', () => { + test('should accept the expected shape', () => { + const fixture: RbmActionBase = { + type: RbmActionTypeEnum.Reply, + text: 'test-text', + postbackData: 'test-postbackData', + }; + + expect(fixture.type).toBe(RbmActionTypeEnum.Reply); + expect(fixture.text).toBe('test-text'); + expect(fixture.postbackData).toBe('test-postbackData'); + }); +}); diff --git a/tests/unit/models/rbm-action-dial.test.ts b/tests/unit/models/rbm-action-dial.test.ts new file mode 100644 index 0000000..1bc27b2 --- /dev/null +++ b/tests/unit/models/rbm-action-dial.test.ts @@ -0,0 +1,18 @@ +import { RbmActionDial } from '../../../models/rbm-action-dial'; +import { RbmActionTypeEnum } from '../../../models/rbm-action-type-enum'; + +describe('RbmActionDial', () => { + test('should accept the expected shape', () => { + const fixture: RbmActionDial = { + type: RbmActionTypeEnum.Reply, + text: 'test-text', + postbackData: 'test-postbackData', + phoneNumber: 'test-phoneNumber', + }; + + expect(fixture.type).toBe(RbmActionTypeEnum.Reply); + expect(fixture.text).toBe('test-text'); + expect(fixture.postbackData).toBe('test-postbackData'); + expect(fixture.phoneNumber).toBe('test-phoneNumber'); + }); +}); diff --git a/tests/unit/models/rbm-action-open-url.test.ts b/tests/unit/models/rbm-action-open-url.test.ts new file mode 100644 index 0000000..2d10ade --- /dev/null +++ b/tests/unit/models/rbm-action-open-url.test.ts @@ -0,0 +1,24 @@ +import { RbmActionOpenUrl } from '../../../models/rbm-action-open-url'; +import { RbmActionTypeEnum } from '../../../models/rbm-action-type-enum'; +import { RbmOpenUrlEnum } from '../../../models/rbm-open-url-enum'; +import { RbmWebViewEnum } from '../../../models/rbm-web-view-enum'; + +describe('RbmActionOpenUrl', () => { + test('should accept the expected shape', () => { + const fixture: RbmActionOpenUrl = { + type: RbmActionTypeEnum.Reply, + text: 'test-text', + postbackData: 'test-postbackData', + url: 'test-url', + application: RbmOpenUrlEnum.Browser, + webviewViewMode: RbmWebViewEnum.Full, + }; + + expect(fixture.type).toBe(RbmActionTypeEnum.Reply); + expect(fixture.text).toBe('test-text'); + expect(fixture.postbackData).toBe('test-postbackData'); + expect(fixture.url).toBe('test-url'); + expect(fixture.application).toBe(RbmOpenUrlEnum.Browser); + expect(fixture.webviewViewMode).toBe(RbmWebViewEnum.Full); + }); +}); diff --git a/tests/unit/models/rbm-action-view-location.test.ts b/tests/unit/models/rbm-action-view-location.test.ts new file mode 100644 index 0000000..7744734 --- /dev/null +++ b/tests/unit/models/rbm-action-view-location.test.ts @@ -0,0 +1,22 @@ +import { RbmActionViewLocation } from '../../../models/rbm-action-view-location'; +import { RbmActionTypeEnum } from '../../../models/rbm-action-type-enum'; + +describe('RbmActionViewLocation', () => { + test('should accept the expected shape', () => { + const fixture: RbmActionViewLocation = { + type: RbmActionTypeEnum.Reply, + text: 'test-text', + postbackData: 'test-postbackData', + latitude: 1.5, + longitude: 1.5, + label: 'test-label', + }; + + expect(fixture.type).toBe(RbmActionTypeEnum.Reply); + expect(fixture.text).toBe('test-text'); + expect(fixture.postbackData).toBe('test-postbackData'); + expect(fixture.latitude).toBe(1.5); + expect(fixture.longitude).toBe(1.5); + expect(fixture.label).toBe('test-label'); + }); +}); diff --git a/tests/unit/models/rbm-card-content-media.test.ts b/tests/unit/models/rbm-card-content-media.test.ts new file mode 100644 index 0000000..d6d7db1 --- /dev/null +++ b/tests/unit/models/rbm-card-content-media.test.ts @@ -0,0 +1,16 @@ +import { RbmCardContentMedia } from '../../../models/rbm-card-content-media'; +import { RbmMediaHeightEnum } from '../../../models/rbm-media-height-enum'; + +describe('RbmCardContentMedia', () => { + test('should accept the expected shape', () => { + const fixture: RbmCardContentMedia = { + fileUrl: 'test-fileUrl', + thumbnailUrl: 'test-thumbnailUrl', + height: RbmMediaHeightEnum.Short, + }; + + expect(fixture.fileUrl).toBe('test-fileUrl'); + expect(fixture.thumbnailUrl).toBe('test-thumbnailUrl'); + expect(fixture.height).toBe(RbmMediaHeightEnum.Short); + }); +}); diff --git a/tests/unit/models/rbm-card-content.test.ts b/tests/unit/models/rbm-card-content.test.ts new file mode 100644 index 0000000..2b8702a --- /dev/null +++ b/tests/unit/models/rbm-card-content.test.ts @@ -0,0 +1,18 @@ +import { RbmCardContent } from '../../../models/rbm-card-content'; +import { RbmCardContentMedia } from '../../../models/rbm-card-content-media'; + +describe('RbmCardContent', () => { + test('should accept the expected shape', () => { + const fixture: RbmCardContent = { + title: 'test-title', + description: 'test-description', + media: {} as unknown as RbmCardContentMedia, + suggestions: [], + }; + + expect(fixture.title).toBe('test-title'); + expect(fixture.description).toBe('test-description'); + expect(fixture.media).toBeDefined(); + expect(fixture.suggestions).toEqual([]); + }); +}); diff --git a/tests/unit/models/rbm-location-response.test.ts b/tests/unit/models/rbm-location-response.test.ts new file mode 100644 index 0000000..eb4d14b --- /dev/null +++ b/tests/unit/models/rbm-location-response.test.ts @@ -0,0 +1,13 @@ +import { RbmLocationResponse } from '../../../models/rbm-location-response'; + +describe('RbmLocationResponse', () => { + test('should accept the expected shape', () => { + const fixture: RbmLocationResponse = { + latitude: 1.5, + longitude: 1.5, + }; + + expect(fixture.latitude).toBe(1.5); + expect(fixture.longitude).toBe(1.5); + }); +}); diff --git a/tests/unit/models/rbm-message-carousel-card.test.ts b/tests/unit/models/rbm-message-carousel-card.test.ts new file mode 100644 index 0000000..4143f67 --- /dev/null +++ b/tests/unit/models/rbm-message-carousel-card.test.ts @@ -0,0 +1,16 @@ +import { RbmMessageCarouselCard } from '../../../models/rbm-message-carousel-card'; +import { CardWidthEnum } from '../../../models/card-width-enum'; + +describe('RbmMessageCarouselCard', () => { + test('should accept the expected shape', () => { + const fixture: RbmMessageCarouselCard = { + cardWidth: CardWidthEnum.Small, + cardContents: [], + suggestions: [], + }; + + expect(fixture.cardWidth).toBe(CardWidthEnum.Small); + expect(fixture.cardContents).toEqual([]); + expect(fixture.suggestions).toEqual([]); + }); +}); diff --git a/tests/unit/models/rbm-message-content-file.test.ts b/tests/unit/models/rbm-message-content-file.test.ts new file mode 100644 index 0000000..010f3db --- /dev/null +++ b/tests/unit/models/rbm-message-content-file.test.ts @@ -0,0 +1,13 @@ +import { RbmMessageContentFile } from '../../../models/rbm-message-content-file'; + +describe('RbmMessageContentFile', () => { + test('should accept the expected shape', () => { + const fixture: RbmMessageContentFile = { + fileUrl: 'test-fileUrl', + thumbnailUrl: 'test-thumbnailUrl', + }; + + expect(fixture.fileUrl).toBe('test-fileUrl'); + expect(fixture.thumbnailUrl).toBe('test-thumbnailUrl'); + }); +}); diff --git a/tests/unit/models/rbm-message-content-text.test.ts b/tests/unit/models/rbm-message-content-text.test.ts new file mode 100644 index 0000000..658fb28 --- /dev/null +++ b/tests/unit/models/rbm-message-content-text.test.ts @@ -0,0 +1,13 @@ +import { RbmMessageContentText } from '../../../models/rbm-message-content-text'; + +describe('RbmMessageContentText', () => { + test('should accept the expected shape', () => { + const fixture: RbmMessageContentText = { + text: 'test-text', + suggestions: [], + }; + + expect(fixture.text).toBe('test-text'); + expect(fixture.suggestions).toEqual([]); + }); +}); diff --git a/tests/unit/models/rbm-message-media.test.ts b/tests/unit/models/rbm-message-media.test.ts new file mode 100644 index 0000000..8e67288 --- /dev/null +++ b/tests/unit/models/rbm-message-media.test.ts @@ -0,0 +1,13 @@ +import { RbmMessageMedia } from '../../../models/rbm-message-media'; + +describe('RbmMessageMedia', () => { + test('should accept the expected shape', () => { + const fixture: RbmMessageMedia = { + media: [], + suggestions: [], + }; + + expect(fixture.media).toEqual([]); + expect(fixture.suggestions).toEqual([]); + }); +}); diff --git a/tests/unit/models/rbm-standalone-card.test.ts b/tests/unit/models/rbm-standalone-card.test.ts new file mode 100644 index 0000000..34a770f --- /dev/null +++ b/tests/unit/models/rbm-standalone-card.test.ts @@ -0,0 +1,20 @@ +import { RbmStandaloneCard } from '../../../models/rbm-standalone-card'; +import { StandaloneCardOrientationEnum } from '../../../models/standalone-card-orientation-enum'; +import { ThumbnailAlignmentEnum } from '../../../models/thumbnail-alignment-enum'; +import { RbmCardContent } from '../../../models/rbm-card-content'; + +describe('RbmStandaloneCard', () => { + test('should accept the expected shape', () => { + const fixture: RbmStandaloneCard = { + orientation: StandaloneCardOrientationEnum.Horizontal, + thumbnailImageAlignment: ThumbnailAlignmentEnum.Left, + cardContent: {} as unknown as RbmCardContent, + suggestions: [], + }; + + expect(fixture.orientation).toBe(StandaloneCardOrientationEnum.Horizontal); + expect(fixture.thumbnailImageAlignment).toBe(ThumbnailAlignmentEnum.Left); + expect(fixture.cardContent).toBeDefined(); + expect(fixture.suggestions).toEqual([]); + }); +}); diff --git a/tests/unit/models/rbm-suggestion-response.test.ts b/tests/unit/models/rbm-suggestion-response.test.ts new file mode 100644 index 0000000..ff2ac5e --- /dev/null +++ b/tests/unit/models/rbm-suggestion-response.test.ts @@ -0,0 +1,13 @@ +import { RbmSuggestionResponse } from '../../../models/rbm-suggestion-response'; + +describe('RbmSuggestionResponse', () => { + test('should accept the expected shape', () => { + const fixture: RbmSuggestionResponse = { + text: 'test-text', + postbackData: 'test-postbackData', + }; + + expect(fixture.text).toBe('test-text'); + expect(fixture.postbackData).toBe('test-postbackData'); + }); +}); diff --git a/tests/unit/models/recording-available-callback.test.ts b/tests/unit/models/recording-available-callback.test.ts new file mode 100644 index 0000000..01bd45b --- /dev/null +++ b/tests/unit/models/recording-available-callback.test.ts @@ -0,0 +1,55 @@ +import { RecordingAvailableCallback } from '../../../models/recording-available-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; +import { FileFormatEnum } from '../../../models/file-format-enum'; + +describe('RecordingAvailableCallback', () => { + test('should accept the expected shape', () => { + const fixture: RecordingAvailableCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + direction: CallDirectionEnum.Inbound, + callId: 'test-callId', + callUrl: 'test-callUrl', + parentCallId: 'test-parentCallId', + recordingId: 'test-recordingId', + mediaUrl: 'test-mediaUrl', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + endTime: 'test-endTime', + duration: 'test-duration', + fileFormat: FileFormatEnum.Mp3, + channels: 1.5, + tag: 'test-tag', + status: 'test-status', + transferCallerId: 'test-transferCallerId', + transferTo: 'test-transferTo', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.parentCallId).toBe('test-parentCallId'); + expect(fixture.recordingId).toBe('test-recordingId'); + expect(fixture.mediaUrl).toBe('test-mediaUrl'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.endTime).toBe('test-endTime'); + expect(fixture.duration).toBe('test-duration'); + expect(fixture.fileFormat).toBe(FileFormatEnum.Mp3); + expect(fixture.channels).toBe(1.5); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.status).toBe('test-status'); + expect(fixture.transferCallerId).toBe('test-transferCallerId'); + expect(fixture.transferTo).toBe('test-transferTo'); + }); +}); diff --git a/tests/unit/models/recording-complete-callback.test.ts b/tests/unit/models/recording-complete-callback.test.ts new file mode 100644 index 0000000..467cb3f --- /dev/null +++ b/tests/unit/models/recording-complete-callback.test.ts @@ -0,0 +1,55 @@ +import { RecordingCompleteCallback } from '../../../models/recording-complete-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; +import { FileFormatEnum } from '../../../models/file-format-enum'; + +describe('RecordingCompleteCallback', () => { + test('should accept the expected shape', () => { + const fixture: RecordingCompleteCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + direction: CallDirectionEnum.Inbound, + callId: 'test-callId', + callUrl: 'test-callUrl', + parentCallId: 'test-parentCallId', + recordingId: 'test-recordingId', + mediaUrl: 'test-mediaUrl', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + answerTime: 'test-answerTime', + endTime: 'test-endTime', + duration: 'test-duration', + fileFormat: FileFormatEnum.Mp3, + channels: 1.5, + tag: 'test-tag', + transferCallerId: 'test-transferCallerId', + transferTo: 'test-transferTo', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.parentCallId).toBe('test-parentCallId'); + expect(fixture.recordingId).toBe('test-recordingId'); + expect(fixture.mediaUrl).toBe('test-mediaUrl'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.answerTime).toBe('test-answerTime'); + expect(fixture.endTime).toBe('test-endTime'); + expect(fixture.duration).toBe('test-duration'); + expect(fixture.fileFormat).toBe(FileFormatEnum.Mp3); + expect(fixture.channels).toBe(1.5); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.transferCallerId).toBe('test-transferCallerId'); + expect(fixture.transferTo).toBe('test-transferTo'); + }); +}); diff --git a/tests/unit/models/recording-transcription-metadata.test.ts b/tests/unit/models/recording-transcription-metadata.test.ts new file mode 100644 index 0000000..3685c4c --- /dev/null +++ b/tests/unit/models/recording-transcription-metadata.test.ts @@ -0,0 +1,17 @@ +import { RecordingTranscriptionMetadata } from '../../../models/recording-transcription-metadata'; + +describe('RecordingTranscriptionMetadata', () => { + test('should accept the expected shape', () => { + const fixture: RecordingTranscriptionMetadata = { + id: 'test-id', + status: 'test-status', + completedTime: 'test-completedTime', + url: 'test-url', + }; + + expect(fixture.id).toBe('test-id'); + expect(fixture.status).toBe('test-status'); + expect(fixture.completedTime).toBe('test-completedTime'); + expect(fixture.url).toBe('test-url'); + }); +}); diff --git a/tests/unit/models/recording-transcriptions.test.ts b/tests/unit/models/recording-transcriptions.test.ts new file mode 100644 index 0000000..f128f04 --- /dev/null +++ b/tests/unit/models/recording-transcriptions.test.ts @@ -0,0 +1,11 @@ +import { RecordingTranscriptions } from '../../../models/recording-transcriptions'; + +describe('RecordingTranscriptions', () => { + test('should accept the expected shape', () => { + const fixture: RecordingTranscriptions = { + transcripts: [], + }; + + expect(fixture.transcripts).toEqual([]); + }); +}); diff --git a/tests/unit/models/redirect-callback.test.ts b/tests/unit/models/redirect-callback.test.ts new file mode 100644 index 0000000..8f07097 --- /dev/null +++ b/tests/unit/models/redirect-callback.test.ts @@ -0,0 +1,42 @@ +import { RedirectCallback } from '../../../models/redirect-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; + +describe('RedirectCallback', () => { + test('should accept the expected shape', () => { + const fixture: RedirectCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + direction: CallDirectionEnum.Inbound, + callId: 'test-callId', + callUrl: 'test-callUrl', + parentCallId: 'test-parentCallId', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + answerTime: 'test-answerTime', + tag: 'test-tag', + transferCallerId: 'test-transferCallerId', + transferTo: 'test-transferTo', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.parentCallId).toBe('test-parentCallId'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.answerTime).toBe('test-answerTime'); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.transferCallerId).toBe('test-transferCallerId'); + expect(fixture.transferTo).toBe('test-transferTo'); + }); +}); diff --git a/tests/unit/models/sms-message-content.test.ts b/tests/unit/models/sms-message-content.test.ts new file mode 100644 index 0000000..40109a6 --- /dev/null +++ b/tests/unit/models/sms-message-content.test.ts @@ -0,0 +1,11 @@ +import { SmsMessageContent } from '../../../models/sms-message-content'; + +describe('SmsMessageContent', () => { + test('should accept the expected shape', () => { + const fixture: SmsMessageContent = { + text: 'test-text', + }; + + expect(fixture.text).toBe('test-text'); + }); +}); diff --git a/tests/unit/models/status-callback-message.test.ts b/tests/unit/models/status-callback-message.test.ts new file mode 100644 index 0000000..1d32800 --- /dev/null +++ b/tests/unit/models/status-callback-message.test.ts @@ -0,0 +1,39 @@ +import { StatusCallbackMessage } from '../../../models/status-callback-message'; +import { MessageDirectionEnum } from '../../../models/message-direction-enum'; +import { PriorityEnum } from '../../../models/priority-enum'; +import { MultiChannelMessageChannelEnum } from '../../../models/multi-channel-message-channel-enum'; + +describe('StatusCallbackMessage', () => { + test('should accept the expected shape', () => { + const fixture: StatusCallbackMessage = { + id: 'test-id', + owner: 'test-owner', + applicationId: 'test-applicationId', + time: 'test-time', + segmentCount: 1.5, + direction: MessageDirectionEnum.In, + // @ts-expect-error SWI-11047: typed as Set but runtime is Array + to: [], + from: 'test-from', + text: 'test-text', + tag: 'test-tag', + media: [], + priority: PriorityEnum.Default, + channel: MultiChannelMessageChannelEnum.Rbm, + }; + + expect(fixture.id).toBe('test-id'); + expect(fixture.owner).toBe('test-owner'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.time).toBe('test-time'); + expect(fixture.segmentCount).toBe(1.5); + expect(fixture.direction).toBe(MessageDirectionEnum.In); + expect(fixture.to).toEqual([]); + expect(fixture.from).toBe('test-from'); + expect(fixture.text).toBe('test-text'); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.media).toEqual([]); + expect(fixture.priority).toBe(PriorityEnum.Default); + expect(fixture.channel).toBe(MultiChannelMessageChannelEnum.Rbm); + }); +}); diff --git a/tests/unit/models/status-callback.test.ts b/tests/unit/models/status-callback.test.ts new file mode 100644 index 0000000..a8055a2 --- /dev/null +++ b/tests/unit/models/status-callback.test.ts @@ -0,0 +1,27 @@ +import { StatusCallback } from '../../../models/status-callback'; +import { StatusCallbackTypeEnum } from '../../../models/status-callback-type-enum'; +import { StatusCallbackMessage } from '../../../models/status-callback-message'; + +describe('StatusCallback', () => { + test('should accept the expected shape', () => { + const fixture: StatusCallback = { + time: 'test-time', + eventTime: 'test-eventTime', + type: StatusCallbackTypeEnum.MessageSending, + to: 'test-to', + description: 'test-description', + message: {} as unknown as StatusCallbackMessage, + errorCode: 1.5, + carrierName: 'test-carrierName', + }; + + expect(fixture.time).toBe('test-time'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.type).toBe(StatusCallbackTypeEnum.MessageSending); + expect(fixture.to).toBe('test-to'); + expect(fixture.description).toBe('test-description'); + expect(fixture.message).toBeDefined(); + expect(fixture.errorCode).toBe(1.5); + expect(fixture.carrierName).toBe('test-carrierName'); + }); +}); diff --git a/tests/unit/models/stir-shaken.test.ts b/tests/unit/models/stir-shaken.test.ts new file mode 100644 index 0000000..a88ea8e --- /dev/null +++ b/tests/unit/models/stir-shaken.test.ts @@ -0,0 +1,15 @@ +import { StirShaken } from '../../../models/stir-shaken'; + +describe('StirShaken', () => { + test('should accept the expected shape', () => { + const fixture: StirShaken = { + verstat: 'test-verstat', + attestationIndicator: 'test-attestationIndicator', + originatingId: 'test-originatingId', + }; + + expect(fixture.verstat).toBe('test-verstat'); + expect(fixture.attestationIndicator).toBe('test-attestationIndicator'); + expect(fixture.originatingId).toBe('test-originatingId'); + }); +}); diff --git a/tests/unit/models/sync-lookup-request.test.ts b/tests/unit/models/sync-lookup-request.test.ts new file mode 100644 index 0000000..2081fd0 --- /dev/null +++ b/tests/unit/models/sync-lookup-request.test.ts @@ -0,0 +1,13 @@ +import { SyncLookupRequest } from '../../../models/sync-lookup-request'; + +describe('SyncLookupRequest', () => { + test('should accept the expected shape', () => { + const fixture: SyncLookupRequest = { + phoneNumbers: [], + rcsAgent: 'test-rcsAgent', + }; + + expect(fixture.phoneNumbers).toEqual([]); + expect(fixture.rcsAgent).toBe('test-rcsAgent'); + }); +}); diff --git a/tests/unit/models/telephone-number.test.ts b/tests/unit/models/telephone-number.test.ts new file mode 100644 index 0000000..57d93c9 --- /dev/null +++ b/tests/unit/models/telephone-number.test.ts @@ -0,0 +1,11 @@ +import { TelephoneNumber } from '../../../models/telephone-number'; + +describe('TelephoneNumber', () => { + test('should accept the expected shape', () => { + const fixture: TelephoneNumber = { + telephoneNumber: 'test-telephoneNumber', + }; + + expect(fixture.telephoneNumber).toBe('test-telephoneNumber'); + }); +}); diff --git a/tests/unit/models/tfv-basic-authentication.test.ts b/tests/unit/models/tfv-basic-authentication.test.ts new file mode 100644 index 0000000..95af27d --- /dev/null +++ b/tests/unit/models/tfv-basic-authentication.test.ts @@ -0,0 +1,13 @@ +import { TfvBasicAuthentication } from '../../../models/tfv-basic-authentication'; + +describe('TfvBasicAuthentication', () => { + test('should accept the expected shape', () => { + const fixture: TfvBasicAuthentication = { + username: 'test-username', + password: 'test-password', + }; + + expect(fixture.username).toBe('test-username'); + expect(fixture.password).toBe('test-password'); + }); +}); diff --git a/tests/unit/models/tfv-error.test.ts b/tests/unit/models/tfv-error.test.ts new file mode 100644 index 0000000..bf6a246 --- /dev/null +++ b/tests/unit/models/tfv-error.test.ts @@ -0,0 +1,13 @@ +import { TfvError } from '../../../models/tfv-error'; + +describe('TfvError', () => { + test('should accept the expected shape', () => { + const fixture: TfvError = { + type: 'test-type', + description: 'test-description', + }; + + expect(fixture.type).toBe('test-type'); + expect(fixture.description).toBe('test-description'); + }); +}); diff --git a/tests/unit/models/tfv-status.test.ts b/tests/unit/models/tfv-status.test.ts new file mode 100644 index 0000000..88d9933 --- /dev/null +++ b/tests/unit/models/tfv-status.test.ts @@ -0,0 +1,33 @@ +import { TfvStatus } from '../../../models/tfv-status'; +import { TfvStatusEnum } from '../../../models/tfv-status-enum'; +import { TfvSubmissionInfo } from '../../../models/tfv-submission-info'; + +describe('TfvStatus', () => { + test('should accept the expected shape', () => { + const fixture: TfvStatus = { + phoneNumber: 'test-phoneNumber', + status: TfvStatusEnum.Verified, + internalTicketNumber: 'test-internalTicketNumber', + declineReasonDescription: 'test-declineReasonDescription', + resubmitAllowed: true, + createdDateTime: 'test-createdDateTime', + modifiedDateTime: 'test-modifiedDateTime', + submission: {} as unknown as TfvSubmissionInfo, + blocked: true, + blockedReason: 'test-blockedReason', + cvToken: 'test-cvToken', + }; + + expect(fixture.phoneNumber).toBe('test-phoneNumber'); + expect(fixture.status).toBe(TfvStatusEnum.Verified); + expect(fixture.internalTicketNumber).toBe('test-internalTicketNumber'); + expect(fixture.declineReasonDescription).toBe('test-declineReasonDescription'); + expect(fixture.resubmitAllowed).toBe(true); + expect(fixture.createdDateTime).toBe('test-createdDateTime'); + expect(fixture.modifiedDateTime).toBe('test-modifiedDateTime'); + expect(fixture.submission).toBeDefined(); + expect(fixture.blocked).toBe(true); + expect(fixture.blockedReason).toBe('test-blockedReason'); + expect(fixture.cvToken).toBe('test-cvToken'); + }); +}); diff --git a/tests/unit/models/tfv-submission-info.test.ts b/tests/unit/models/tfv-submission-info.test.ts new file mode 100644 index 0000000..b23f98a --- /dev/null +++ b/tests/unit/models/tfv-submission-info.test.ts @@ -0,0 +1,46 @@ +import { TfvSubmissionInfo } from '../../../models/tfv-submission-info'; +import { Address } from '../../../models/address'; +import { Contact } from '../../../models/contact'; +import { OptInWorkflow } from '../../../models/opt-in-workflow'; +import { BusinessRegistrationTypeEnum } from '../../../models/business-registration-type-enum'; +import { BusinessEntityTypeEnum } from '../../../models/business-entity-type-enum'; + +describe('TfvSubmissionInfo', () => { + test('should accept the expected shape', () => { + const fixture: TfvSubmissionInfo = { + businessAddress: {} as unknown as Address, + businessContact: {} as unknown as Contact, + messageVolume: 1.5, + useCase: 'test-useCase', + useCaseSummary: 'test-useCaseSummary', + productionMessageContent: 'test-productionMessageContent', + optInWorkflow: {} as unknown as OptInWorkflow, + additionalInformation: 'test-additionalInformation', + isvReseller: 'test-isvReseller', + privacyPolicyUrl: 'test-privacyPolicyUrl', + termsAndConditionsUrl: 'test-termsAndConditionsUrl', + businessDba: 'test-businessDba', + businessRegistrationNumber: 'test-businessRegistrationNumber', + businessRegistrationType: BusinessRegistrationTypeEnum.Ein, + businessRegistrationIssuingCountry: 'test-businessRegistrationIssuingCountry', + businessEntityType: BusinessEntityTypeEnum.SoleProprietor, + }; + + expect(fixture.businessAddress).toBeDefined(); + expect(fixture.businessContact).toBeDefined(); + expect(fixture.messageVolume).toBe(1.5); + expect(fixture.useCase).toBe('test-useCase'); + expect(fixture.useCaseSummary).toBe('test-useCaseSummary'); + expect(fixture.productionMessageContent).toBe('test-productionMessageContent'); + expect(fixture.optInWorkflow).toBeDefined(); + expect(fixture.additionalInformation).toBe('test-additionalInformation'); + expect(fixture.isvReseller).toBe('test-isvReseller'); + expect(fixture.privacyPolicyUrl).toBe('test-privacyPolicyUrl'); + expect(fixture.termsAndConditionsUrl).toBe('test-termsAndConditionsUrl'); + expect(fixture.businessDba).toBe('test-businessDba'); + expect(fixture.businessRegistrationNumber).toBe('test-businessRegistrationNumber'); + expect(fixture.businessRegistrationType).toBe(BusinessRegistrationTypeEnum.Ein); + expect(fixture.businessRegistrationIssuingCountry).toBe('test-businessRegistrationIssuingCountry'); + expect(fixture.businessEntityType).toBe(BusinessEntityTypeEnum.SoleProprietor); + }); +}); diff --git a/tests/unit/models/tfv-submission-wrapper.test.ts b/tests/unit/models/tfv-submission-wrapper.test.ts new file mode 100644 index 0000000..95bdb92 --- /dev/null +++ b/tests/unit/models/tfv-submission-wrapper.test.ts @@ -0,0 +1,12 @@ +import { TfvSubmissionWrapper } from '../../../models/tfv-submission-wrapper'; +import { VerificationUpdateRequest } from '../../../models/verification-update-request'; + +describe('TfvSubmissionWrapper', () => { + test('should accept the expected shape', () => { + const fixture: TfvSubmissionWrapper = { + submission: {} as unknown as VerificationUpdateRequest, + }; + + expect(fixture.submission).toBeDefined(); + }); +}); diff --git a/tests/unit/models/transcribe-recording.test.ts b/tests/unit/models/transcribe-recording.test.ts new file mode 100644 index 0000000..652d6f6 --- /dev/null +++ b/tests/unit/models/transcribe-recording.test.ts @@ -0,0 +1,24 @@ +import { TranscribeRecording } from '../../../models/transcribe-recording'; +import { CallbackMethodEnum } from '../../../models/callback-method-enum'; + +describe('TranscribeRecording', () => { + test('should accept the expected shape', () => { + const fixture: TranscribeRecording = { + callbackUrl: 'test-callbackUrl', + callbackMethod: CallbackMethodEnum.Get, + username: 'test-username', + password: 'test-password', + tag: 'test-tag', + callbackTimeout: 1.5, + detectLanguage: true, + }; + + expect(fixture.callbackUrl).toBe('test-callbackUrl'); + expect(fixture.callbackMethod).toBe(CallbackMethodEnum.Get); + expect(fixture.username).toBe('test-username'); + expect(fixture.password).toBe('test-password'); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.callbackTimeout).toBe(1.5); + expect(fixture.detectLanguage).toBe(true); + }); +}); diff --git a/tests/unit/models/transcription-available-callback.test.ts b/tests/unit/models/transcription-available-callback.test.ts new file mode 100644 index 0000000..0e57b7d --- /dev/null +++ b/tests/unit/models/transcription-available-callback.test.ts @@ -0,0 +1,54 @@ +import { TranscriptionAvailableCallback } from '../../../models/transcription-available-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; +import { FileFormatEnum } from '../../../models/file-format-enum'; +import { Transcription } from '../../../models/transcription'; + +describe('TranscriptionAvailableCallback', () => { + test('should accept the expected shape', () => { + const fixture: TranscriptionAvailableCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + direction: CallDirectionEnum.Inbound, + callId: 'test-callId', + callUrl: 'test-callUrl', + mediaUrl: 'test-mediaUrl', + parentCallId: 'test-parentCallId', + recordingId: 'test-recordingId', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + endTime: 'test-endTime', + duration: 'test-duration', + fileFormat: FileFormatEnum.Mp3, + tag: 'test-tag', + transcription: {} as unknown as Transcription, + transferCallerId: 'test-transferCallerId', + transferTo: 'test-transferTo', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.mediaUrl).toBe('test-mediaUrl'); + expect(fixture.parentCallId).toBe('test-parentCallId'); + expect(fixture.recordingId).toBe('test-recordingId'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.endTime).toBe('test-endTime'); + expect(fixture.duration).toBe('test-duration'); + expect(fixture.fileFormat).toBe(FileFormatEnum.Mp3); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.transcription).toBeDefined(); + expect(fixture.transferCallerId).toBe('test-transferCallerId'); + expect(fixture.transferTo).toBe('test-transferTo'); + }); +}); diff --git a/tests/unit/models/transcription.test.ts b/tests/unit/models/transcription.test.ts new file mode 100644 index 0000000..f1ea3e1 --- /dev/null +++ b/tests/unit/models/transcription.test.ts @@ -0,0 +1,13 @@ +import { Transcription } from '../../../models/transcription'; + +describe('Transcription', () => { + test('should accept the expected shape', () => { + const fixture: Transcription = { + text: 'test-text', + confidence: 1.5, + }; + + expect(fixture.text).toBe('test-text'); + expect(fixture.confidence).toBe(1.5); + }); +}); diff --git a/tests/unit/models/transfer-answer-callback.test.ts b/tests/unit/models/transfer-answer-callback.test.ts new file mode 100644 index 0000000..ae45ddc --- /dev/null +++ b/tests/unit/models/transfer-answer-callback.test.ts @@ -0,0 +1,40 @@ +import { TransferAnswerCallback } from '../../../models/transfer-answer-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; + +describe('TransferAnswerCallback', () => { + test('should accept the expected shape', () => { + const fixture: TransferAnswerCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + direction: CallDirectionEnum.Inbound, + callId: 'test-callId', + callUrl: 'test-callUrl', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + answerTime: 'test-answerTime', + tag: 'test-tag', + transferCallerId: 'test-transferCallerId', + transferTo: 'test-transferTo', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.answerTime).toBe('test-answerTime'); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.transferCallerId).toBe('test-transferCallerId'); + expect(fixture.transferTo).toBe('test-transferTo'); + }); +}); diff --git a/tests/unit/models/transfer-complete-callback.test.ts b/tests/unit/models/transfer-complete-callback.test.ts new file mode 100644 index 0000000..6d00c06 --- /dev/null +++ b/tests/unit/models/transfer-complete-callback.test.ts @@ -0,0 +1,46 @@ +import { TransferCompleteCallback } from '../../../models/transfer-complete-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; + +describe('TransferCompleteCallback', () => { + test('should accept the expected shape', () => { + const fixture: TransferCompleteCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + direction: CallDirectionEnum.Inbound, + callId: 'test-callId', + callUrl: 'test-callUrl', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + answerTime: 'test-answerTime', + tag: 'test-tag', + transferCallerId: 'test-transferCallerId', + transferTo: 'test-transferTo', + cause: 'test-cause', + errorMessage: 'test-errorMessage', + errorId: 'test-errorId', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.answerTime).toBe('test-answerTime'); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.transferCallerId).toBe('test-transferCallerId'); + expect(fixture.transferTo).toBe('test-transferTo'); + expect(fixture.cause).toBe('test-cause'); + expect(fixture.errorMessage).toBe('test-errorMessage'); + expect(fixture.errorId).toBe('test-errorId'); + }); +}); diff --git a/tests/unit/models/transfer-disconnect-callback.test.ts b/tests/unit/models/transfer-disconnect-callback.test.ts new file mode 100644 index 0000000..20a879b --- /dev/null +++ b/tests/unit/models/transfer-disconnect-callback.test.ts @@ -0,0 +1,50 @@ +import { TransferDisconnectCallback } from '../../../models/transfer-disconnect-callback'; +import { CallDirectionEnum } from '../../../models/call-direction-enum'; + +describe('TransferDisconnectCallback', () => { + test('should accept the expected shape', () => { + const fixture: TransferDisconnectCallback = { + eventType: 'test-eventType', + eventTime: 'test-eventTime', + accountId: 'test-accountId', + applicationId: 'test-applicationId', + from: 'test-from', + to: 'test-to', + direction: CallDirectionEnum.Inbound, + callId: 'test-callId', + callUrl: 'test-callUrl', + parentCallId: 'test-parentCallId', + enqueuedTime: 'test-enqueuedTime', + startTime: 'test-startTime', + answerTime: 'test-answerTime', + endTime: 'test-endTime', + tag: 'test-tag', + transferCallerId: 'test-transferCallerId', + transferTo: 'test-transferTo', + cause: 'test-cause', + errorMessage: 'test-errorMessage', + errorId: 'test-errorId', + }; + + expect(fixture.eventType).toBe('test-eventType'); + expect(fixture.eventTime).toBe('test-eventTime'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.applicationId).toBe('test-applicationId'); + expect(fixture.from).toBe('test-from'); + expect(fixture.to).toBe('test-to'); + expect(fixture.direction).toBe(CallDirectionEnum.Inbound); + expect(fixture.callId).toBe('test-callId'); + expect(fixture.callUrl).toBe('test-callUrl'); + expect(fixture.parentCallId).toBe('test-parentCallId'); + expect(fixture.enqueuedTime).toBe('test-enqueuedTime'); + expect(fixture.startTime).toBe('test-startTime'); + expect(fixture.answerTime).toBe('test-answerTime'); + expect(fixture.endTime).toBe('test-endTime'); + expect(fixture.tag).toBe('test-tag'); + expect(fixture.transferCallerId).toBe('test-transferCallerId'); + expect(fixture.transferTo).toBe('test-transferTo'); + expect(fixture.cause).toBe('test-cause'); + expect(fixture.errorMessage).toBe('test-errorMessage'); + expect(fixture.errorId).toBe('test-errorId'); + }); +}); diff --git a/tests/unit/models/update-call-recording.test.ts b/tests/unit/models/update-call-recording.test.ts new file mode 100644 index 0000000..3612339 --- /dev/null +++ b/tests/unit/models/update-call-recording.test.ts @@ -0,0 +1,12 @@ +import { UpdateCallRecording } from '../../../models/update-call-recording'; +import { RecordingStateEnum } from '../../../models/recording-state-enum'; + +describe('UpdateCallRecording', () => { + test('should accept the expected shape', () => { + const fixture: UpdateCallRecording = { + state: RecordingStateEnum.Paused, + }; + + expect(fixture.state).toBe(RecordingStateEnum.Paused); + }); +}); diff --git a/tests/unit/models/update-call.test.ts b/tests/unit/models/update-call.test.ts new file mode 100644 index 0000000..abad9c2 --- /dev/null +++ b/tests/unit/models/update-call.test.ts @@ -0,0 +1,31 @@ +import { UpdateCall } from '../../../models/update-call'; +import { CallStateEnum } from '../../../models/call-state-enum'; +import { RedirectMethodEnum } from '../../../models/redirect-method-enum'; + +describe('UpdateCall', () => { + test('should accept the expected shape', () => { + const fixture: UpdateCall = { + state: CallStateEnum.Active, + redirectUrl: 'test-redirectUrl', + redirectMethod: RedirectMethodEnum.Get, + username: 'test-username', + password: 'test-password', + redirectFallbackUrl: 'test-redirectFallbackUrl', + redirectFallbackMethod: RedirectMethodEnum.Get, + fallbackUsername: 'test-fallbackUsername', + fallbackPassword: 'test-fallbackPassword', + tag: 'test-tag', + }; + + expect(fixture.state).toBe(CallStateEnum.Active); + expect(fixture.redirectUrl).toBe('test-redirectUrl'); + expect(fixture.redirectMethod).toBe(RedirectMethodEnum.Get); + expect(fixture.username).toBe('test-username'); + expect(fixture.password).toBe('test-password'); + expect(fixture.redirectFallbackUrl).toBe('test-redirectFallbackUrl'); + expect(fixture.redirectFallbackMethod).toBe(RedirectMethodEnum.Get); + expect(fixture.fallbackUsername).toBe('test-fallbackUsername'); + expect(fixture.fallbackPassword).toBe('test-fallbackPassword'); + expect(fixture.tag).toBe('test-tag'); + }); +}); diff --git a/tests/unit/models/update-conference-member.test.ts b/tests/unit/models/update-conference-member.test.ts new file mode 100644 index 0000000..6d682b1 --- /dev/null +++ b/tests/unit/models/update-conference-member.test.ts @@ -0,0 +1,15 @@ +import { UpdateConferenceMember } from '../../../models/update-conference-member'; + +describe('UpdateConferenceMember', () => { + test('should accept the expected shape', () => { + const fixture: UpdateConferenceMember = { + mute: true, + hold: true, + callIdsToCoach: [], + }; + + expect(fixture.mute).toBe(true); + expect(fixture.hold).toBe(true); + expect(fixture.callIdsToCoach).toEqual([]); + }); +}); diff --git a/tests/unit/models/update-conference.test.ts b/tests/unit/models/update-conference.test.ts new file mode 100644 index 0000000..f743858 --- /dev/null +++ b/tests/unit/models/update-conference.test.ts @@ -0,0 +1,29 @@ +import { UpdateConference } from '../../../models/update-conference'; +import { ConferenceStateEnum } from '../../../models/conference-state-enum'; +import { RedirectMethodEnum } from '../../../models/redirect-method-enum'; + +describe('UpdateConference', () => { + test('should accept the expected shape', () => { + const fixture: UpdateConference = { + status: ConferenceStateEnum.Active, + redirectUrl: 'test-redirectUrl', + redirectMethod: RedirectMethodEnum.Get, + username: 'test-username', + password: 'test-password', + redirectFallbackUrl: 'test-redirectFallbackUrl', + redirectFallbackMethod: RedirectMethodEnum.Get, + fallbackUsername: 'test-fallbackUsername', + fallbackPassword: 'test-fallbackPassword', + }; + + expect(fixture.status).toBe(ConferenceStateEnum.Active); + expect(fixture.redirectUrl).toBe('test-redirectUrl'); + expect(fixture.redirectMethod).toBe(RedirectMethodEnum.Get); + expect(fixture.username).toBe('test-username'); + expect(fixture.password).toBe('test-password'); + expect(fixture.redirectFallbackUrl).toBe('test-redirectFallbackUrl'); + expect(fixture.redirectFallbackMethod).toBe(RedirectMethodEnum.Get); + expect(fixture.fallbackUsername).toBe('test-fallbackUsername'); + expect(fixture.fallbackPassword).toBe('test-fallbackPassword'); + }); +}); diff --git a/tests/unit/models/verification-denial-webhook.test.ts b/tests/unit/models/verification-denial-webhook.test.ts new file mode 100644 index 0000000..1b823c2 --- /dev/null +++ b/tests/unit/models/verification-denial-webhook.test.ts @@ -0,0 +1,29 @@ +import { VerificationDenialWebhook } from '../../../models/verification-denial-webhook'; + +describe('VerificationDenialWebhook', () => { + test('should accept the expected shape', () => { + const fixture: VerificationDenialWebhook = { + accountId: 'test-accountId', + additionalDenialReasons: [], + declineReasonDescription: 'test-declineReasonDescription', + denialStatusCode: 1.5, + internalTicketNumber: 'test-internalTicketNumber', + phoneNumber: 'test-phoneNumber', + resubmitAllowed: true, + status: 'test-status', + blocked: true, + blockedReason: 'test-blockedReason', + }; + + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.additionalDenialReasons).toEqual([]); + expect(fixture.declineReasonDescription).toBe('test-declineReasonDescription'); + expect(fixture.denialStatusCode).toBe(1.5); + expect(fixture.internalTicketNumber).toBe('test-internalTicketNumber'); + expect(fixture.phoneNumber).toBe('test-phoneNumber'); + expect(fixture.resubmitAllowed).toBe(true); + expect(fixture.status).toBe('test-status'); + expect(fixture.blocked).toBe(true); + expect(fixture.blockedReason).toBe('test-blockedReason'); + }); +}); diff --git a/tests/unit/models/verification-request.test.ts b/tests/unit/models/verification-request.test.ts new file mode 100644 index 0000000..ca782d8 --- /dev/null +++ b/tests/unit/models/verification-request.test.ts @@ -0,0 +1,54 @@ +import { VerificationRequest } from '../../../models/verification-request'; +import { Address } from '../../../models/address'; +import { Contact } from '../../../models/contact'; +import { OptInWorkflow } from '../../../models/opt-in-workflow'; +import { BusinessRegistrationTypeEnum } from '../../../models/business-registration-type-enum'; +import { BusinessEntityTypeEnum } from '../../../models/business-entity-type-enum'; + +describe('VerificationRequest', () => { + test('should accept the expected shape', () => { + const fixture: VerificationRequest = { + businessAddress: {} as unknown as Address, + businessContact: {} as unknown as Contact, + messageVolume: 1.5, + phoneNumbers: [], + useCase: 'test-useCase', + useCaseSummary: 'test-useCaseSummary', + productionMessageContent: 'test-productionMessageContent', + optInWorkflow: {} as unknown as OptInWorkflow, + additionalInformation: 'test-additionalInformation', + isvReseller: 'test-isvReseller', + privacyPolicyUrl: 'test-privacyPolicyUrl', + termsAndConditionsUrl: 'test-termsAndConditionsUrl', + businessDba: 'test-businessDba', + businessRegistrationNumber: 'test-businessRegistrationNumber', + businessRegistrationType: BusinessRegistrationTypeEnum.Ein, + businessRegistrationIssuingCountry: 'test-businessRegistrationIssuingCountry', + businessEntityType: BusinessEntityTypeEnum.SoleProprietor, + helpMessageResponse: 'test-helpMessageResponse', + ageGatedContent: true, + cvToken: 'test-cvToken', + }; + + expect(fixture.businessAddress).toBeDefined(); + expect(fixture.businessContact).toBeDefined(); + expect(fixture.messageVolume).toBe(1.5); + expect(fixture.phoneNumbers).toEqual([]); + expect(fixture.useCase).toBe('test-useCase'); + expect(fixture.useCaseSummary).toBe('test-useCaseSummary'); + expect(fixture.productionMessageContent).toBe('test-productionMessageContent'); + expect(fixture.optInWorkflow).toBeDefined(); + expect(fixture.additionalInformation).toBe('test-additionalInformation'); + expect(fixture.isvReseller).toBe('test-isvReseller'); + expect(fixture.privacyPolicyUrl).toBe('test-privacyPolicyUrl'); + expect(fixture.termsAndConditionsUrl).toBe('test-termsAndConditionsUrl'); + expect(fixture.businessDba).toBe('test-businessDba'); + expect(fixture.businessRegistrationNumber).toBe('test-businessRegistrationNumber'); + expect(fixture.businessRegistrationType).toBe(BusinessRegistrationTypeEnum.Ein); + expect(fixture.businessRegistrationIssuingCountry).toBe('test-businessRegistrationIssuingCountry'); + expect(fixture.businessEntityType).toBe(BusinessEntityTypeEnum.SoleProprietor); + expect(fixture.helpMessageResponse).toBe('test-helpMessageResponse'); + expect(fixture.ageGatedContent).toBe(true); + expect(fixture.cvToken).toBe('test-cvToken'); + }); +}); diff --git a/tests/unit/models/verification-update-request.test.ts b/tests/unit/models/verification-update-request.test.ts new file mode 100644 index 0000000..3ac0148 --- /dev/null +++ b/tests/unit/models/verification-update-request.test.ts @@ -0,0 +1,52 @@ +import { VerificationUpdateRequest } from '../../../models/verification-update-request'; +import { Address } from '../../../models/address'; +import { Contact } from '../../../models/contact'; +import { OptInWorkflow } from '../../../models/opt-in-workflow'; +import { BusinessRegistrationTypeEnum } from '../../../models/business-registration-type-enum'; +import { BusinessEntityTypeEnum } from '../../../models/business-entity-type-enum'; + +describe('VerificationUpdateRequest', () => { + test('should accept the expected shape', () => { + const fixture: VerificationUpdateRequest = { + businessAddress: {} as unknown as Address, + businessContact: {} as unknown as Contact, + messageVolume: 1.5, + useCase: 'test-useCase', + useCaseSummary: 'test-useCaseSummary', + productionMessageContent: 'test-productionMessageContent', + optInWorkflow: {} as unknown as OptInWorkflow, + additionalInformation: 'test-additionalInformation', + isvReseller: 'test-isvReseller', + privacyPolicyUrl: 'test-privacyPolicyUrl', + termsAndConditionsUrl: 'test-termsAndConditionsUrl', + businessDba: 'test-businessDba', + businessRegistrationNumber: 'test-businessRegistrationNumber', + businessRegistrationType: BusinessRegistrationTypeEnum.Ein, + businessEntityType: BusinessEntityTypeEnum.SoleProprietor, + businessRegistrationIssuingCountry: 'test-businessRegistrationIssuingCountry', + helpMessageResponse: 'test-helpMessageResponse', + ageGatedContent: true, + cvToken: 'test-cvToken', + }; + + expect(fixture.businessAddress).toBeDefined(); + expect(fixture.businessContact).toBeDefined(); + expect(fixture.messageVolume).toBe(1.5); + expect(fixture.useCase).toBe('test-useCase'); + expect(fixture.useCaseSummary).toBe('test-useCaseSummary'); + expect(fixture.productionMessageContent).toBe('test-productionMessageContent'); + expect(fixture.optInWorkflow).toBeDefined(); + expect(fixture.additionalInformation).toBe('test-additionalInformation'); + expect(fixture.isvReseller).toBe('test-isvReseller'); + expect(fixture.privacyPolicyUrl).toBe('test-privacyPolicyUrl'); + expect(fixture.termsAndConditionsUrl).toBe('test-termsAndConditionsUrl'); + expect(fixture.businessDba).toBe('test-businessDba'); + expect(fixture.businessRegistrationNumber).toBe('test-businessRegistrationNumber'); + expect(fixture.businessRegistrationType).toBe(BusinessRegistrationTypeEnum.Ein); + expect(fixture.businessEntityType).toBe(BusinessEntityTypeEnum.SoleProprietor); + expect(fixture.businessRegistrationIssuingCountry).toBe('test-businessRegistrationIssuingCountry'); + expect(fixture.helpMessageResponse).toBe('test-helpMessageResponse'); + expect(fixture.ageGatedContent).toBe(true); + expect(fixture.cvToken).toBe('test-cvToken'); + }); +}); diff --git a/tests/unit/models/verification-webhook.test.ts b/tests/unit/models/verification-webhook.test.ts new file mode 100644 index 0000000..2c50158 --- /dev/null +++ b/tests/unit/models/verification-webhook.test.ts @@ -0,0 +1,18 @@ +import { VerificationWebhook } from '../../../models/verification-webhook'; +import { TfvCallbackStatusEnum } from '../../../models/tfv-callback-status-enum'; + +describe('VerificationWebhook', () => { + test('should accept the expected shape', () => { + const fixture: VerificationWebhook = { + accountId: 'test-accountId', + phoneNumber: 'test-phoneNumber', + status: TfvCallbackStatusEnum.Verified, + internalTicketNumber: 'test-internalTicketNumber', + }; + + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.phoneNumber).toBe('test-phoneNumber'); + expect(fixture.status).toBe(TfvCallbackStatusEnum.Verified); + expect(fixture.internalTicketNumber).toBe('test-internalTicketNumber'); + }); +}); diff --git a/tests/unit/models/verify-code-request.test.ts b/tests/unit/models/verify-code-request.test.ts new file mode 100644 index 0000000..54a3904 --- /dev/null +++ b/tests/unit/models/verify-code-request.test.ts @@ -0,0 +1,17 @@ +import { VerifyCodeRequest } from '../../../models/verify-code-request'; + +describe('VerifyCodeRequest', () => { + test('should accept the expected shape', () => { + const fixture: VerifyCodeRequest = { + to: 'test-to', + scope: 'test-scope', + expirationTimeInMinutes: 1.5, + code: 'test-code', + }; + + expect(fixture.to).toBe('test-to'); + expect(fixture.scope).toBe('test-scope'); + expect(fixture.expirationTimeInMinutes).toBe(1.5); + expect(fixture.code).toBe('test-code'); + }); +}); diff --git a/tests/unit/models/verify-code-response.test.ts b/tests/unit/models/verify-code-response.test.ts new file mode 100644 index 0000000..61a0ed3 --- /dev/null +++ b/tests/unit/models/verify-code-response.test.ts @@ -0,0 +1,11 @@ +import { VerifyCodeResponse } from '../../../models/verify-code-response'; + +describe('VerifyCodeResponse', () => { + test('should accept the expected shape', () => { + const fixture: VerifyCodeResponse = { + valid: true, + }; + + expect(fixture.valid).toBe(true); + }); +}); diff --git a/tests/unit/models/voice-api-error.test.ts b/tests/unit/models/voice-api-error.test.ts new file mode 100644 index 0000000..1ac54a4 --- /dev/null +++ b/tests/unit/models/voice-api-error.test.ts @@ -0,0 +1,15 @@ +import { VoiceApiError } from '../../../models/voice-api-error'; + +describe('VoiceApiError', () => { + test('should accept the expected shape', () => { + const fixture: VoiceApiError = { + type: 'test-type', + description: 'test-description', + id: 'test-id', + }; + + expect(fixture.type).toBe('test-type'); + expect(fixture.description).toBe('test-description'); + expect(fixture.id).toBe('test-id'); + }); +}); diff --git a/tests/unit/models/voice-code-response.test.ts b/tests/unit/models/voice-code-response.test.ts new file mode 100644 index 0000000..013abb8 --- /dev/null +++ b/tests/unit/models/voice-code-response.test.ts @@ -0,0 +1,11 @@ +import { VoiceCodeResponse } from '../../../models/voice-code-response'; + +describe('VoiceCodeResponse', () => { + test('should accept the expected shape', () => { + const fixture: VoiceCodeResponse = { + callId: 'test-callId', + }; + + expect(fixture.callId).toBe('test-callId'); + }); +}); diff --git a/tests/unit/models/webhook-subscription-basic-authentication.test.ts b/tests/unit/models/webhook-subscription-basic-authentication.test.ts new file mode 100644 index 0000000..618be23 --- /dev/null +++ b/tests/unit/models/webhook-subscription-basic-authentication.test.ts @@ -0,0 +1,13 @@ +import { WebhookSubscriptionBasicAuthentication } from '../../../models/webhook-subscription-basic-authentication'; + +describe('WebhookSubscriptionBasicAuthentication', () => { + test('should accept the expected shape', () => { + const fixture: WebhookSubscriptionBasicAuthentication = { + username: 'test-username', + password: 'test-password', + }; + + expect(fixture.username).toBe('test-username'); + expect(fixture.password).toBe('test-password'); + }); +}); diff --git a/tests/unit/models/webhook-subscription-error.test.ts b/tests/unit/models/webhook-subscription-error.test.ts new file mode 100644 index 0000000..3b15d27 --- /dev/null +++ b/tests/unit/models/webhook-subscription-error.test.ts @@ -0,0 +1,15 @@ +import { WebhookSubscriptionError } from '../../../models/webhook-subscription-error'; + +describe('WebhookSubscriptionError', () => { + test('should accept the expected shape', () => { + const fixture: WebhookSubscriptionError = { + code: 1.5, + description: 'test-description', + telephoneNumbers: [], + }; + + expect(fixture.code).toBe(1.5); + expect(fixture.description).toBe('test-description'); + expect(fixture.telephoneNumbers).toEqual([]); + }); +}); diff --git a/tests/unit/models/webhook-subscription-request-schema.test.ts b/tests/unit/models/webhook-subscription-request-schema.test.ts new file mode 100644 index 0000000..d4f6281 --- /dev/null +++ b/tests/unit/models/webhook-subscription-request-schema.test.ts @@ -0,0 +1,16 @@ +import { WebhookSubscriptionRequestSchema } from '../../../models/webhook-subscription-request-schema'; +import { TfvBasicAuthentication } from '../../../models/tfv-basic-authentication'; + +describe('WebhookSubscriptionRequestSchema', () => { + test('should accept the expected shape', () => { + const fixture: WebhookSubscriptionRequestSchema = { + basicAuthentication: {} as unknown as TfvBasicAuthentication, + callbackUrl: 'test-callbackUrl', + sharedSecretKey: 'test-sharedSecretKey', + }; + + expect(fixture.basicAuthentication).toBeDefined(); + expect(fixture.callbackUrl).toBe('test-callbackUrl'); + expect(fixture.sharedSecretKey).toBe('test-sharedSecretKey'); + }); +}); diff --git a/tests/unit/models/webhook-subscription.test.ts b/tests/unit/models/webhook-subscription.test.ts new file mode 100644 index 0000000..a015cff --- /dev/null +++ b/tests/unit/models/webhook-subscription.test.ts @@ -0,0 +1,25 @@ +import { WebhookSubscription } from '../../../models/webhook-subscription'; +import { WebhookSubscriptionTypeEnum } from '../../../models/webhook-subscription-type-enum'; +import { WebhookSubscriptionBasicAuthentication } from '../../../models/webhook-subscription-basic-authentication'; + +describe('WebhookSubscription', () => { + test('should accept the expected shape', () => { + const fixture: WebhookSubscription = { + id: 'test-id', + accountId: 'test-accountId', + callbackUrl: 'test-callbackUrl', + type: WebhookSubscriptionTypeEnum.TollfreeVerificationStatus, + basicAuthentication: {} as unknown as WebhookSubscriptionBasicAuthentication, + createdDate: 'test-createdDate', + modifiedDate: 'test-modifiedDate', + }; + + expect(fixture.id).toBe('test-id'); + expect(fixture.accountId).toBe('test-accountId'); + expect(fixture.callbackUrl).toBe('test-callbackUrl'); + expect(fixture.type).toBe(WebhookSubscriptionTypeEnum.TollfreeVerificationStatus); + expect(fixture.basicAuthentication).toBeDefined(); + expect(fixture.createdDate).toBe('test-createdDate'); + expect(fixture.modifiedDate).toBe('test-modifiedDate'); + }); +}); diff --git a/tests/unit/models/webhook-subscriptions-list-body.test.ts b/tests/unit/models/webhook-subscriptions-list-body.test.ts new file mode 100644 index 0000000..204d1ae --- /dev/null +++ b/tests/unit/models/webhook-subscriptions-list-body.test.ts @@ -0,0 +1,16 @@ +import { WebhookSubscriptionsListBody } from '../../../models/webhook-subscriptions-list-body'; +import { LinksObject } from '../../../models/links-object'; + +describe('WebhookSubscriptionsListBody', () => { + test('should accept the expected shape', () => { + const fixture: WebhookSubscriptionsListBody = { + links: {} as unknown as LinksObject, + errors: [], + data: [], + }; + + expect(fixture.links).toBeDefined(); + expect(fixture.errors).toEqual([]); + expect(fixture.data).toEqual([]); + }); +}); From 1bd2e0f969f074e5e8d92f385e91376e712384e5 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 19 May 2026 14:18:59 -0400 Subject: [PATCH 6/6] oauth test --- tests/unit/configuration.test.ts | 84 ++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 tests/unit/configuration.test.ts diff --git a/tests/unit/configuration.test.ts b/tests/unit/configuration.test.ts new file mode 100644 index 0000000..a568b4f --- /dev/null +++ b/tests/unit/configuration.test.ts @@ -0,0 +1,84 @@ +import axios from 'axios'; +import { Configuration } from '../../configuration'; + +jest.mock('axios'); +const mockedAxios = axios as jest.Mocked; + +describe('Configuration OAuth', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + test('fetches an access token from the oauth endpoint using client credentials', async () => { + mockedAxios.request.mockResolvedValueOnce({ + data: { access_token: 'fresh-token', expires_in: 3600 } + }); + + const config = new Configuration({ + clientId: 'my-id', + clientSecret: 'my-secret' + }); + const token = await (config.accessToken as () => Promise)(); + + expect(token).toBe('fresh-token'); + expect(mockedAxios.request).toHaveBeenCalledTimes(1); + expect(mockedAxios.request).toHaveBeenCalledWith({ + method: 'POST', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + auth: { username: 'my-id', password: 'my-secret' }, + data: 'grant_type=client_credentials', + url: 'https://api.bandwidth.com/api/v1/oauth2/token' + }); + }); + + test('caches the token across calls within the expiration window', async () => { + mockedAxios.request.mockResolvedValueOnce({ + data: { access_token: 'cached-token', expires_in: 3600 } + }); + + const config = new Configuration({ + clientId: 'my-id', + clientSecret: 'my-secret' + }); + const token1 = await (config.accessToken as () => Promise)(); + const token2 = await (config.accessToken as () => Promise)(); + + expect(token1).toBe('cached-token'); + expect(token2).toBe('cached-token'); + expect(mockedAxios.request).toHaveBeenCalledTimes(1); + }); + + test('refreshes the token when within the 60-second pre-expiry buffer', async () => { + mockedAxios.request + .mockResolvedValueOnce({ data: { access_token: 'first-token', expires_in: 30 } }) + .mockResolvedValueOnce({ data: { access_token: 'second-token', expires_in: 3600 } }); + + const config = new Configuration({ + clientId: 'my-id', + clientSecret: 'my-secret' + }); + const token1 = await (config.accessToken as () => Promise)(); + const token2 = await (config.accessToken as () => Promise)(); + + expect(token1).toBe('first-token'); + expect(token2).toBe('second-token'); + expect(mockedAxios.request).toHaveBeenCalledTimes(2); + }); + + test('respects an explicitly provided accessToken string', async () => { + const config = new Configuration({ + accessToken: 'preset-token' + }); + + expect(config.accessToken).toBe('preset-token'); + expect(mockedAxios.request).not.toHaveBeenCalled(); + }); + + test('returns undefined when neither client credentials nor accessToken are set', async () => { + const config = new Configuration({}); + const token = await (config.accessToken as () => Promise)(); + + expect(token).toBeUndefined(); + expect(mockedAxios.request).not.toHaveBeenCalled(); + }); +});