diff --git a/CHANGELOG.md b/CHANGELOG.md
index 301c10f..b63bd27 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
None
+
+
+## [4.1.2] - 2025-06-30
+
+### Changed
+
+- Change all model constructors to check for user provided values and assign the values accordingly
+
## [4.1.1] - 2025-02-18
diff --git a/README.md b/README.md
index cfc632c..1ca4718 100644
--- a/README.md
+++ b/README.md
@@ -14,9 +14,9 @@ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-g
## Installing
```sh
-npm install @freeclimb/sdk@4.1.1
+npm install @freeclimb/sdk@4.1.2
or
-yarn add @freeclimb/sdk@4.1.1
+yarn add @freeclimb/sdk@4.1.2
```
## Getting Started
diff --git a/__tests__/models/AccountRequest.spec.ts b/__tests__/models/AccountRequest.spec.ts
index 68de954..c2cab4f 100644
--- a/__tests__/models/AccountRequest.spec.ts
+++ b/__tests__/models/AccountRequest.spec.ts
@@ -2,25 +2,76 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("AccountRequest", () => {
- let model: freeclimb.AccountRequest = new freeclimb.AccountRequest({
- alias: "test_alias",
- label: "test_label",
- });
- describe("AccountRequest class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.AccountRequest);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.AccountRequest;
+ let model: freeclimb.AccountRequest = new freeclimb.AccountRequest({
+ alias: "test_alias",
+ label: "test_label",
+ });
+ describe("AccountRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.AccountRequest);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_alias";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".label", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_label";
+ expect(model.label).toBe(value);
+ });
});
});
- describe(".alias", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_alias";
- expect(model.alias).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.AccountRequest;
+ let model: freeclimb.AccountRequest = new freeclimb.AccountRequest({
+ alias: "",
+ label: "",
+ });
+ describe("AccountRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.AccountRequest);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".label", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.label).toBe(value);
+ });
});
});
- describe(".label", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_label";
- expect(model.label).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.AccountRequest;
+ let constructorArguments = {};
+ let model: freeclimb.AccountRequest = new freeclimb.AccountRequest(
+ constructorArguments,
+ );
+
+ describe("#alias", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "alias",
+ )?.defaultValue;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe("#label", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "label",
+ )?.defaultValue;
+ expect(model.label).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/AccountResult.spec.ts b/__tests__/models/AccountResult.spec.ts
index 5bed6bc..c63e0a0 100644
--- a/__tests__/models/AccountResult.spec.ts
+++ b/__tests__/models/AccountResult.spec.ts
@@ -2,91 +2,253 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("AccountResult", () => {
- let model: freeclimb.AccountResult = new freeclimb.AccountResult({
- uri: "test_uri",
- dateCreated: "test_dateCreated",
- dateUpdated: "test_dateUpdated",
- revision: 1,
- accountId: "test_accountId",
- apiKey: "test_apiKey",
- alias: "test_alias",
- label: "test_label",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.AccountResult;
+ let model: freeclimb.AccountResult = new freeclimb.AccountResult({
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ accountId: "test_accountId",
+ apiKey: "test_apiKey",
+ alias: "test_alias",
+ label: "test_label",
- type: freeclimb.AccountType.TRIAL,
+ type: freeclimb.AccountType.TRIAL,
- status: freeclimb.AccountStatus.CLOSED,
- subresourceUris: {},
- });
- describe("AccountResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.AccountResult);
+ status: freeclimb.AccountStatus.CLOSED,
+ subresourceUris: {},
});
- });
- describe(".uri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_uri";
- expect(model.uri).toBe(value);
+ describe("AccountResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.AccountResult);
+ });
});
- });
- describe(".dateCreated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreated";
- expect(model.dateCreated).toBe(value);
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_uri";
+ expect(model.uri).toBe(value);
+ });
});
- });
- describe(".dateUpdated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdated";
- expect(model.dateUpdated).toBe(value);
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreated";
+ expect(model.dateCreated).toBe(value);
+ });
});
- });
- describe(".revision", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.revision).toBe(value);
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdated";
+ expect(model.dateUpdated).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.revision).toBe(value);
+ });
});
- });
- describe(".apiKey", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_apiKey";
- expect(model.apiKey).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".alias", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_alias";
- expect(model.alias).toBe(value);
+ describe(".apiKey", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_apiKey";
+ expect(model.apiKey).toBe(value);
+ });
});
- });
- describe(".label", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_label";
- expect(model.label).toBe(value);
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_alias";
+ expect(model.alias).toBe(value);
+ });
});
- });
- describe(".type", () => {
- it("resolves to particular value on initialization", () => {
- const value = "trial";
- expect(model.type).toBe(value);
+ describe(".label", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_label";
+ expect(model.label).toBe(value);
+ });
+ });
+ describe(".type", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "trial";
+ expect(model.type).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "closed";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".subresourceUris", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = {};
+ const receivedValue: any = model.subresourceUris;
+ expect(receivedValue).toStrictEqual(value);
+ });
});
});
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "closed";
- expect(model.status).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.AccountResult;
+ let model: freeclimb.AccountResult = new freeclimb.AccountResult({
+ uri: "",
+ dateCreated: "",
+ dateUpdated: "",
+ revision: 0,
+ accountId: "",
+ apiKey: "",
+ alias: "",
+ label: "",
+
+ type: freeclimb.AccountType.TRIAL,
+
+ status: freeclimb.AccountStatus.CLOSED,
+ subresourceUris: {},
+ });
+ describe("AccountResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.AccountResult);
+ });
+ });
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.revision).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".apiKey", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.apiKey).toBe(value);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".label", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.label).toBe(value);
+ });
+ });
+ describe(".type", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "trial";
+ expect(model.type).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "closed";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".subresourceUris", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = {};
+ const receivedValue: any = model.subresourceUris;
+ expect(receivedValue).toStrictEqual(value);
+ });
});
});
- describe(".subresourceUris", () => {
- it("resolves to particular value on initialization", () => {
- const value = {};
- const receivedValue: any = model.subresourceUris;
- expect(receivedValue).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.AccountResult;
+ let constructorArguments = {
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ };
+ let model: freeclimb.AccountResult = new freeclimb.AccountResult(
+ constructorArguments,
+ );
+
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#apiKey", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "apiKey",
+ )?.defaultValue;
+ expect(model.apiKey).toBe(value);
+ });
+ });
+ describe("#alias", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "alias",
+ )?.defaultValue;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe("#label", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "label",
+ )?.defaultValue;
+ expect(model.label).toBe(value);
+ });
+ });
+ describe("#type", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "type",
+ )?.defaultValue;
+ expect(model.type).toBe(value);
+ });
+ });
+ describe("#status", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "status",
+ )?.defaultValue;
+ expect(model.status).toBe(value);
+ });
+ });
+ describe("#subresourceUris", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "subresourceUris",
+ )?.defaultValue;
+ expect(model.subresourceUris).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/AccountStatus.spec.ts b/__tests__/models/AccountStatus.spec.ts
index d17e15f..415745b 100644
--- a/__tests__/models/AccountStatus.spec.ts
+++ b/__tests__/models/AccountStatus.spec.ts
@@ -2,19 +2,21 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("AccountStatus", () => {
- describe(".CLOSED", () => {
- it("resolves to correct value for CLOSED enum property", () => {
- expect(freeclimb.AccountStatus.CLOSED).toBe("closed");
+ describe("Test with truthy values", () => {
+ describe(".CLOSED", () => {
+ it("resolves to correct value for CLOSED enum property", () => {
+ expect(freeclimb.AccountStatus.CLOSED).toBe("closed");
+ });
});
- });
- describe(".SUSPENDED", () => {
- it("resolves to correct value for SUSPENDED enum property", () => {
- expect(freeclimb.AccountStatus.SUSPENDED).toBe("suspended");
+ describe(".SUSPENDED", () => {
+ it("resolves to correct value for SUSPENDED enum property", () => {
+ expect(freeclimb.AccountStatus.SUSPENDED).toBe("suspended");
+ });
});
- });
- describe(".ACTIVE", () => {
- it("resolves to correct value for ACTIVE enum property", () => {
- expect(freeclimb.AccountStatus.ACTIVE).toBe("active");
+ describe(".ACTIVE", () => {
+ it("resolves to correct value for ACTIVE enum property", () => {
+ expect(freeclimb.AccountStatus.ACTIVE).toBe("active");
+ });
});
});
});
diff --git a/__tests__/models/AccountType.spec.ts b/__tests__/models/AccountType.spec.ts
index e9cc4da..ae26d14 100644
--- a/__tests__/models/AccountType.spec.ts
+++ b/__tests__/models/AccountType.spec.ts
@@ -2,14 +2,16 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("AccountType", () => {
- describe(".TRIAL", () => {
- it("resolves to correct value for TRIAL enum property", () => {
- expect(freeclimb.AccountType.TRIAL).toBe("trial");
+ describe("Test with truthy values", () => {
+ describe(".TRIAL", () => {
+ it("resolves to correct value for TRIAL enum property", () => {
+ expect(freeclimb.AccountType.TRIAL).toBe("trial");
+ });
});
- });
- describe(".FULL", () => {
- it("resolves to correct value for FULL enum property", () => {
- expect(freeclimb.AccountType.FULL).toBe("full");
+ describe(".FULL", () => {
+ it("resolves to correct value for FULL enum property", () => {
+ expect(freeclimb.AccountType.FULL).toBe("full");
+ });
});
});
});
diff --git a/__tests__/models/AddToConference.spec.ts b/__tests__/models/AddToConference.spec.ts
index f523510..8ba1c98 100644
--- a/__tests__/models/AddToConference.spec.ts
+++ b/__tests__/models/AddToConference.spec.ts
@@ -2,82 +2,253 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("AddToConference", () => {
- let model: freeclimb.AddToConference = new freeclimb.AddToConference({
- allowCallControl: true,
- callControlSequence: "test_callControlSequence",
- callControlUrl: "https://123.abc",
- conferenceId: "test_conferenceId",
- leaveConferenceUrl: "https://123.abc",
- listen: true,
- notificationUrl: "https://123.abc",
- startConfOnEnter: true,
- talk: true,
- dtmfPassThrough: true,
- });
- describe("AddToConference class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.AddToConference);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.AddToConference;
+ let model: freeclimb.AddToConference = new freeclimb.AddToConference({
+ allowCallControl: true,
+ callControlSequence: "test_callControlSequence",
+ callControlUrl: "https://123.abc",
+ conferenceId: "test_conferenceId",
+ leaveConferenceUrl: "https://123.abc",
+ listen: true,
+ notificationUrl: "https://123.abc",
+ startConfOnEnter: true,
+ talk: true,
+ dtmfPassThrough: true,
+ });
+ describe("AddToConference class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.AddToConference);
+ });
});
- });
- describe(".allowCallControl", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.allowCallControl).toBe(value);
+ describe(".allowCallControl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.allowCallControl).toBe(value);
+ });
});
- });
- describe(".callControlSequence", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callControlSequence";
- expect(model.callControlSequence).toBe(value);
+ describe(".callControlSequence", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callControlSequence";
+ expect(model.callControlSequence).toBe(value);
+ });
});
- });
- describe(".callControlUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.callControlUrl).toBe(value);
+ describe(".callControlUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.callControlUrl).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".leaveConferenceUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.leaveConferenceUrl).toBe(value);
+ describe(".leaveConferenceUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.leaveConferenceUrl).toBe(value);
+ });
});
- });
- describe(".listen", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.listen).toBe(value);
+ describe(".listen", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.listen).toBe(value);
+ });
});
- });
- describe(".notificationUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.notificationUrl).toBe(value);
+ describe(".notificationUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.notificationUrl).toBe(value);
+ });
});
- });
- describe(".startConfOnEnter", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.startConfOnEnter).toBe(value);
+ describe(".startConfOnEnter", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.startConfOnEnter).toBe(value);
+ });
+ });
+ describe(".talk", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.talk).toBe(value);
+ });
+ });
+ describe(".dtmfPassThrough", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.dtmfPassThrough).toBe(value);
+ });
});
});
- describe(".talk", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.talk).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.AddToConference;
+ let model: freeclimb.AddToConference = new freeclimb.AddToConference({
+ allowCallControl: false,
+ callControlSequence: "",
+ callControlUrl: "",
+ conferenceId: "",
+ leaveConferenceUrl: "",
+ listen: false,
+ notificationUrl: "",
+ startConfOnEnter: false,
+ talk: false,
+ dtmfPassThrough: false,
+ });
+ describe("AddToConference class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.AddToConference);
+ });
+ });
+
+ describe(".allowCallControl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.allowCallControl).toBe(value);
+ });
+ });
+ describe(".callControlSequence", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callControlSequence).toBe(value);
+ });
+ });
+ describe(".callControlUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callControlUrl).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".leaveConferenceUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.leaveConferenceUrl).toBe(value);
+ });
+ });
+ describe(".listen", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.listen).toBe(value);
+ });
+ });
+ describe(".notificationUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.notificationUrl).toBe(value);
+ });
+ });
+ describe(".startConfOnEnter", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.startConfOnEnter).toBe(value);
+ });
+ });
+ describe(".talk", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.talk).toBe(value);
+ });
+ });
+ describe(".dtmfPassThrough", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.dtmfPassThrough).toBe(value);
+ });
});
});
- describe(".dtmfPassThrough", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.dtmfPassThrough).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.AddToConference;
+ let constructorArguments = {
+ conferenceId: "test_conferenceId",
+ };
+ let model: freeclimb.AddToConference = new freeclimb.AddToConference(
+ constructorArguments,
+ );
+
+ describe("#allowCallControl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "allowCallControl",
+ )?.defaultValue;
+ expect(model.allowCallControl).toBe(value);
+ });
+ });
+ describe("#callControlSequence", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callControlSequence",
+ )?.defaultValue;
+ expect(model.callControlSequence).toBe(value);
+ });
+ });
+ describe("#callControlUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callControlUrl",
+ )?.defaultValue;
+ expect(model.callControlUrl).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to initialization value", () => {
+ expect(model.conferenceId).toBe(constructorArguments["conferenceId"]);
+ });
+ });
+ describe("#leaveConferenceUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "leaveConferenceUrl",
+ )?.defaultValue;
+ expect(model.leaveConferenceUrl).toBe(value);
+ });
+ });
+ describe("#listen", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "listen",
+ )?.defaultValue;
+ expect(model.listen).toBe(value);
+ });
+ });
+ describe("#notificationUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "notificationUrl",
+ )?.defaultValue;
+ expect(model.notificationUrl).toBe(value);
+ });
+ });
+ describe("#startConfOnEnter", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "startConfOnEnter",
+ )?.defaultValue;
+ expect(model.startConfOnEnter).toBe(value);
+ });
+ });
+ describe("#talk", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "talk",
+ )?.defaultValue;
+ expect(model.talk).toBe(value);
+ });
+ });
+ describe("#dtmfPassThrough", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "dtmfPassThrough",
+ )?.defaultValue;
+ expect(model.dtmfPassThrough).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/AddToConferenceNotificationWebhook.spec.ts b/__tests__/models/AddToConferenceNotificationWebhook.spec.ts
index f63e17f..0c76d3a 100644
--- a/__tests__/models/AddToConferenceNotificationWebhook.spec.ts
+++ b/__tests__/models/AddToConferenceNotificationWebhook.spec.ts
@@ -2,118 +2,349 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("AddToConferenceNotificationWebhook", () => {
- let model: freeclimb.AddToConferenceNotificationWebhook =
- new freeclimb.AddToConferenceNotificationWebhook({
- requestType: "test_requestType",
- callId: "test_callId",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.AddToConferenceNotificationWebhook;
+ let model: freeclimb.AddToConferenceNotificationWebhook =
+ new freeclimb.AddToConferenceNotificationWebhook({
+ requestType: "test_requestType",
+ callId: "test_callId",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
- status: freeclimb.ConferenceStatus.EMPTY,
- recordingUrl: "https://123.abc",
- recordingId: "test_recordingId",
- recordingDurationSec: 1,
+ status: freeclimb.ConferenceStatus.EMPTY,
+ recordingUrl: "https://123.abc",
+ recordingId: "test_recordingId",
+ recordingDurationSec: 1,
+ });
+ describe("AddToConferenceNotificationWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(
+ freeclimb.AddToConferenceNotificationWebhook,
+ );
+ });
});
- describe("AddToConferenceNotificationWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(
- freeclimb.AddToConferenceNotificationWebhook,
- );
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "empty";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".recordingUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.recordingUrl).toBe(value);
+ });
+ });
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_recordingId";
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe(".recordingDurationSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.recordingDurationSec).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of AddToConferenceNotificationWebhook", () => {
+ expect(
+ freeclimb.AddToConferenceNotificationWebhook.deserialize(
+ '{ "requestType": "addToConferenceNotification"}',
+ ),
+ ).toBeInstanceOf(freeclimb.AddToConferenceNotificationWebhook);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.AddToConferenceNotificationWebhook;
+ let model: freeclimb.AddToConferenceNotificationWebhook =
+ new freeclimb.AddToConferenceNotificationWebhook({
+ requestType: "",
+ callId: "",
+ accountId: "",
+ from: "",
+ to: "",
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+
+ status: freeclimb.ConferenceStatus.EMPTY,
+ recordingUrl: "",
+ recordingId: "",
+ recordingDurationSec: 0,
+ });
+ describe("AddToConferenceNotificationWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(
+ freeclimb.AddToConferenceNotificationWebhook,
+ );
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "empty";
- expect(model.status).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
});
- });
- describe(".recordingUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.recordingUrl).toBe(value);
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "empty";
+ expect(model.status).toBe(value);
+ });
});
- });
- describe(".recordingId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_recordingId";
- expect(model.recordingId).toBe(value);
+ describe(".recordingUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingUrl).toBe(value);
+ });
});
- });
- describe(".recordingDurationSec", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.recordingDurationSec).toBe(value);
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe(".recordingDurationSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.recordingDurationSec).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of AddToConferenceNotificationWebhook", () => {
+ expect(
+ freeclimb.AddToConferenceNotificationWebhook.deserialize(
+ '{ "requestType": "addToConferenceNotification"}',
+ ),
+ ).toBeInstanceOf(freeclimb.AddToConferenceNotificationWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of AddToConferenceNotificationWebhook", () => {
- expect(
- freeclimb.AddToConferenceNotificationWebhook.deserialize(
- '{ "requestType": "addToConferenceNotification"}',
- ),
- ).toBeInstanceOf(freeclimb.AddToConferenceNotificationWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.AddToConferenceNotificationWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.AddToConferenceNotificationWebhook =
+ new freeclimb.AddToConferenceNotificationWebhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#status", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "status",
+ )?.defaultValue;
+ expect(model.status).toBe(value);
+ });
+ });
+ describe("#recordingUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingUrl",
+ )?.defaultValue;
+ expect(model.recordingUrl).toBe(value);
+ });
+ });
+ describe("#recordingId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingId",
+ )?.defaultValue;
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe("#recordingDurationSec", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingDurationSec",
+ )?.defaultValue;
+ expect(model.recordingDurationSec).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/AddToQueueNotificationWebhook.spec.ts b/__tests__/models/AddToQueueNotificationWebhook.spec.ts
index aa4da0b..d19df85 100644
--- a/__tests__/models/AddToQueueNotificationWebhook.spec.ts
+++ b/__tests__/models/AddToQueueNotificationWebhook.spec.ts
@@ -2,87 +2,255 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("AddToQueueNotificationWebhook", () => {
- let model: freeclimb.AddToQueueNotificationWebhook =
- new freeclimb.AddToQueueNotificationWebhook({
- requestType: "test_requestType",
- callId: "test_callId",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.AddToQueueNotificationWebhook;
+ let model: freeclimb.AddToQueueNotificationWebhook =
+ new freeclimb.AddToQueueNotificationWebhook({
+ requestType: "test_requestType",
+ callId: "test_callId",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
+ });
+ describe("AddToQueueNotificationWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.AddToQueueNotificationWebhook);
+ });
});
- describe("AddToQueueNotificationWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.AddToQueueNotificationWebhook);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of AddToQueueNotificationWebhook", () => {
+ expect(
+ freeclimb.AddToQueueNotificationWebhook.deserialize(
+ '{ "requestType": "addToQueueNotification"}',
+ ),
+ ).toBeInstanceOf(freeclimb.AddToQueueNotificationWebhook);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.AddToQueueNotificationWebhook;
+ let model: freeclimb.AddToQueueNotificationWebhook =
+ new freeclimb.AddToQueueNotificationWebhook({
+ requestType: "",
+ callId: "",
+ accountId: "",
+ from: "",
+ to: "",
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+ });
+ describe("AddToQueueNotificationWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.AddToQueueNotificationWebhook);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of AddToQueueNotificationWebhook", () => {
+ expect(
+ freeclimb.AddToQueueNotificationWebhook.deserialize(
+ '{ "requestType": "addToQueueNotification"}',
+ ),
+ ).toBeInstanceOf(freeclimb.AddToQueueNotificationWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of AddToQueueNotificationWebhook", () => {
- expect(
- freeclimb.AddToQueueNotificationWebhook.deserialize(
- '{ "requestType": "addToQueueNotification"}',
- ),
- ).toBeInstanceOf(freeclimb.AddToQueueNotificationWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.AddToQueueNotificationWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.AddToQueueNotificationWebhook =
+ new freeclimb.AddToQueueNotificationWebhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/AnsweredBy.spec.ts b/__tests__/models/AnsweredBy.spec.ts
index 8cd5f6c..d2b2f14 100644
--- a/__tests__/models/AnsweredBy.spec.ts
+++ b/__tests__/models/AnsweredBy.spec.ts
@@ -2,14 +2,16 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("AnsweredBy", () => {
- describe(".HUMAN", () => {
- it("resolves to correct value for HUMAN enum property", () => {
- expect(freeclimb.AnsweredBy.HUMAN).toBe("human");
+ describe("Test with truthy values", () => {
+ describe(".HUMAN", () => {
+ it("resolves to correct value for HUMAN enum property", () => {
+ expect(freeclimb.AnsweredBy.HUMAN).toBe("human");
+ });
});
- });
- describe(".MACHINE", () => {
- it("resolves to correct value for MACHINE enum property", () => {
- expect(freeclimb.AnsweredBy.MACHINE).toBe("machine");
+ describe(".MACHINE", () => {
+ it("resolves to correct value for MACHINE enum property", () => {
+ expect(freeclimb.AnsweredBy.MACHINE).toBe("machine");
+ });
});
});
});
diff --git a/__tests__/models/ApplicationList.spec.ts b/__tests__/models/ApplicationList.spec.ts
index ded5e90..64311f2 100644
--- a/__tests__/models/ApplicationList.spec.ts
+++ b/__tests__/models/ApplicationList.spec.ts
@@ -2,67 +2,160 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("ApplicationList", () => {
- let model: freeclimb.ApplicationList = new freeclimb.ApplicationList({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- applications: [],
- });
- describe("ApplicationList class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.ApplicationList);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.ApplicationList;
+ let model: freeclimb.ApplicationList = new freeclimb.ApplicationList({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ applications: [],
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe("ApplicationList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ApplicationList);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".applications", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.ApplicationResult[] = [];
+ expect(model.applications).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.ApplicationList;
+ let model: freeclimb.ApplicationList = new freeclimb.ApplicationList({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ applications: [],
+ });
+ describe("ApplicationList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ApplicationList);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".applications", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.ApplicationResult[] = [];
+ expect(model.applications).toStrictEqual(value);
+ });
});
});
- describe(".applications", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.ApplicationResult[] = [];
- expect(model.applications).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.ApplicationList;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.ApplicationList = new freeclimb.ApplicationList(
+ constructorArguments,
+ );
+
+ describe("#applications", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "applications",
+ )?.defaultValue;
+ expect(model.applications).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/ApplicationRequest.spec.ts b/__tests__/models/ApplicationRequest.spec.ts
index f80e26c..cef9fe4 100644
--- a/__tests__/models/ApplicationRequest.spec.ts
+++ b/__tests__/models/ApplicationRequest.spec.ts
@@ -2,60 +2,186 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("ApplicationRequest", () => {
- let model: freeclimb.ApplicationRequest = new freeclimb.ApplicationRequest({
- alias: "test_alias",
- voiceUrl: "https://123.abc",
- voiceFallbackUrl: "https://123.abc",
- callConnectUrl: "https://123.abc",
- statusCallbackUrl: "https://123.abc",
- smsUrl: "https://123.abc",
- smsFallbackUrl: "https://123.abc",
- });
- describe("ApplicationRequest class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.ApplicationRequest);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.ApplicationRequest;
+ let model: freeclimb.ApplicationRequest = new freeclimb.ApplicationRequest({
+ alias: "test_alias",
+ voiceUrl: "https://123.abc",
+ voiceFallbackUrl: "https://123.abc",
+ callConnectUrl: "https://123.abc",
+ statusCallbackUrl: "https://123.abc",
+ smsUrl: "https://123.abc",
+ smsFallbackUrl: "https://123.abc",
});
- });
- describe(".alias", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_alias";
- expect(model.alias).toBe(value);
+ describe("ApplicationRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ApplicationRequest);
+ });
});
- });
- describe(".voiceUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.voiceUrl).toBe(value);
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_alias";
+ expect(model.alias).toBe(value);
+ });
});
- });
- describe(".voiceFallbackUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.voiceFallbackUrl).toBe(value);
+ describe(".voiceUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.voiceUrl).toBe(value);
+ });
});
- });
- describe(".callConnectUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.callConnectUrl).toBe(value);
+ describe(".voiceFallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.voiceFallbackUrl).toBe(value);
+ });
});
- });
- describe(".statusCallbackUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.statusCallbackUrl).toBe(value);
+ describe(".callConnectUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.callConnectUrl).toBe(value);
+ });
+ });
+ describe(".statusCallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe(".smsUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.smsUrl).toBe(value);
+ });
+ });
+ describe(".smsFallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.smsFallbackUrl).toBe(value);
+ });
});
});
- describe(".smsUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.smsUrl).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.ApplicationRequest;
+ let model: freeclimb.ApplicationRequest = new freeclimb.ApplicationRequest({
+ alias: "",
+ voiceUrl: "",
+ voiceFallbackUrl: "",
+ callConnectUrl: "",
+ statusCallbackUrl: "",
+ smsUrl: "",
+ smsFallbackUrl: "",
+ });
+ describe("ApplicationRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ApplicationRequest);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".voiceUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.voiceUrl).toBe(value);
+ });
+ });
+ describe(".voiceFallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.voiceFallbackUrl).toBe(value);
+ });
+ });
+ describe(".callConnectUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callConnectUrl).toBe(value);
+ });
+ });
+ describe(".statusCallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe(".smsUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.smsUrl).toBe(value);
+ });
+ });
+ describe(".smsFallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.smsFallbackUrl).toBe(value);
+ });
});
});
- describe(".smsFallbackUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.smsFallbackUrl).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.ApplicationRequest;
+ let constructorArguments = {};
+ let model: freeclimb.ApplicationRequest = new freeclimb.ApplicationRequest(
+ constructorArguments,
+ );
+
+ describe("#alias", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "alias",
+ )?.defaultValue;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe("#voiceUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "voiceUrl",
+ )?.defaultValue;
+ expect(model.voiceUrl).toBe(value);
+ });
+ });
+ describe("#voiceFallbackUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "voiceFallbackUrl",
+ )?.defaultValue;
+ expect(model.voiceFallbackUrl).toBe(value);
+ });
+ });
+ describe("#callConnectUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callConnectUrl",
+ )?.defaultValue;
+ expect(model.callConnectUrl).toBe(value);
+ });
+ });
+ describe("#statusCallbackUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "statusCallbackUrl",
+ )?.defaultValue;
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe("#smsUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "smsUrl",
+ )?.defaultValue;
+ expect(model.smsUrl).toBe(value);
+ });
+ });
+ describe("#smsFallbackUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "smsFallbackUrl",
+ )?.defaultValue;
+ expect(model.smsFallbackUrl).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/ApplicationResult.spec.ts b/__tests__/models/ApplicationResult.spec.ts
index 442f7e1..93a10cb 100644
--- a/__tests__/models/ApplicationResult.spec.ts
+++ b/__tests__/models/ApplicationResult.spec.ts
@@ -2,102 +2,291 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("ApplicationResult", () => {
- let model: freeclimb.ApplicationResult = new freeclimb.ApplicationResult({
- uri: "test_uri",
- dateCreated: "test_dateCreated",
- dateUpdated: "test_dateUpdated",
- revision: 1,
- accountId: "test_accountId",
- applicationId: "test_applicationId",
- alias: "test_alias",
- voiceUrl: "https://123.abc",
- voiceFallbackUrl: "https://123.abc",
- callConnectUrl: "https://123.abc",
- statusCallbackUrl: "https://123.abc",
- smsUrl: "https://123.abc",
- smsFallbackUrl: "https://123.abc",
- });
- describe("ApplicationResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.ApplicationResult);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.ApplicationResult;
+ let model: freeclimb.ApplicationResult = new freeclimb.ApplicationResult({
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ accountId: "test_accountId",
+ applicationId: "test_applicationId",
+ alias: "test_alias",
+ voiceUrl: "https://123.abc",
+ voiceFallbackUrl: "https://123.abc",
+ callConnectUrl: "https://123.abc",
+ statusCallbackUrl: "https://123.abc",
+ smsUrl: "https://123.abc",
+ smsFallbackUrl: "https://123.abc",
});
- });
- describe(".uri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_uri";
- expect(model.uri).toBe(value);
+ describe("ApplicationResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ApplicationResult);
+ });
});
- });
- describe(".dateCreated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreated";
- expect(model.dateCreated).toBe(value);
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_uri";
+ expect(model.uri).toBe(value);
+ });
});
- });
- describe(".dateUpdated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdated";
- expect(model.dateUpdated).toBe(value);
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreated";
+ expect(model.dateCreated).toBe(value);
+ });
});
- });
- describe(".revision", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.revision).toBe(value);
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdated";
+ expect(model.dateUpdated).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.revision).toBe(value);
+ });
});
- });
- describe(".applicationId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_applicationId";
- expect(model.applicationId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".alias", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_alias";
- expect(model.alias).toBe(value);
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_applicationId";
+ expect(model.applicationId).toBe(value);
+ });
});
- });
- describe(".voiceUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.voiceUrl).toBe(value);
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_alias";
+ expect(model.alias).toBe(value);
+ });
});
- });
- describe(".voiceFallbackUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.voiceFallbackUrl).toBe(value);
+ describe(".voiceUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.voiceUrl).toBe(value);
+ });
});
- });
- describe(".callConnectUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.callConnectUrl).toBe(value);
+ describe(".voiceFallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.voiceFallbackUrl).toBe(value);
+ });
});
- });
- describe(".statusCallbackUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.statusCallbackUrl).toBe(value);
+ describe(".callConnectUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.callConnectUrl).toBe(value);
+ });
+ });
+ describe(".statusCallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe(".smsUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.smsUrl).toBe(value);
+ });
+ });
+ describe(".smsFallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.smsFallbackUrl).toBe(value);
+ });
});
});
- describe(".smsUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.smsUrl).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.ApplicationResult;
+ let model: freeclimb.ApplicationResult = new freeclimb.ApplicationResult({
+ uri: "",
+ dateCreated: "",
+ dateUpdated: "",
+ revision: 0,
+ accountId: "",
+ applicationId: "",
+ alias: "",
+ voiceUrl: "",
+ voiceFallbackUrl: "",
+ callConnectUrl: "",
+ statusCallbackUrl: "",
+ smsUrl: "",
+ smsFallbackUrl: "",
+ });
+ describe("ApplicationResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ApplicationResult);
+ });
+ });
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.revision).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.applicationId).toBe(value);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".voiceUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.voiceUrl).toBe(value);
+ });
+ });
+ describe(".voiceFallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.voiceFallbackUrl).toBe(value);
+ });
+ });
+ describe(".callConnectUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callConnectUrl).toBe(value);
+ });
+ });
+ describe(".statusCallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe(".smsUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.smsUrl).toBe(value);
+ });
+ });
+ describe(".smsFallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.smsFallbackUrl).toBe(value);
+ });
});
});
- describe(".smsFallbackUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.smsFallbackUrl).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.ApplicationResult;
+ let constructorArguments = {
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ };
+ let model: freeclimb.ApplicationResult = new freeclimb.ApplicationResult(
+ constructorArguments,
+ );
+
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#applicationId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "applicationId",
+ )?.defaultValue;
+ expect(model.applicationId).toBe(value);
+ });
+ });
+ describe("#alias", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "alias",
+ )?.defaultValue;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe("#voiceUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "voiceUrl",
+ )?.defaultValue;
+ expect(model.voiceUrl).toBe(value);
+ });
+ });
+ describe("#voiceFallbackUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "voiceFallbackUrl",
+ )?.defaultValue;
+ expect(model.voiceFallbackUrl).toBe(value);
+ });
+ });
+ describe("#callConnectUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callConnectUrl",
+ )?.defaultValue;
+ expect(model.callConnectUrl).toBe(value);
+ });
+ });
+ describe("#statusCallbackUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "statusCallbackUrl",
+ )?.defaultValue;
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe("#smsUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "smsUrl",
+ )?.defaultValue;
+ expect(model.smsUrl).toBe(value);
+ });
+ });
+ describe("#smsFallbackUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "smsFallbackUrl",
+ )?.defaultValue;
+ expect(model.smsFallbackUrl).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/AvailableNumber.spec.ts b/__tests__/models/AvailableNumber.spec.ts
index 41b2add..916dd2a 100644
--- a/__tests__/models/AvailableNumber.spec.ts
+++ b/__tests__/models/AvailableNumber.spec.ts
@@ -2,72 +2,210 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("AvailableNumber", () => {
- let model: freeclimb.AvailableNumber = new freeclimb.AvailableNumber({
- capabilities: new freeclimb.Capabilities({
- voice: null as any,
- sms: null as any,
- tollFree: null as any,
- tenDLC: null as any,
- shortCode: null as any,
- }),
- campaignId: "test_campaignId",
- phoneNumber: "test_phoneNumber",
- voiceEnabled: true,
- smsEnabled: true,
- region: "test_region",
- country: "test_country",
- });
- describe("AvailableNumber class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.AvailableNumber);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.AvailableNumber;
+ let model: freeclimb.AvailableNumber = new freeclimb.AvailableNumber({
+ capabilities: new freeclimb.Capabilities({
+ voice: null as any,
+ sms: null as any,
+ tollFree: null as any,
+ tenDLC: null as any,
+ shortCode: null as any,
+ }),
+ campaignId: "test_campaignId",
+ phoneNumber: "test_phoneNumber",
+ voiceEnabled: true,
+ smsEnabled: true,
+ region: "test_region",
+ country: "test_country",
+ });
+ describe("AvailableNumber class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.AvailableNumber);
+ });
+ });
+ describe(".capabilities", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new freeclimb.Capabilities({
+ voice: null as any,
+ sms: null as any,
+ tollFree: null as any,
+ tenDLC: null as any,
+ shortCode: null as any,
+ });
+ expect(model.capabilities).toStrictEqual(value);
+ });
+ });
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_campaignId";
+ expect(model.campaignId).toBe(value);
+ });
+ });
+ describe(".phoneNumber", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_phoneNumber";
+ expect(model.phoneNumber).toBe(value);
+ });
+ });
+ describe(".voiceEnabled", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.voiceEnabled).toBe(value);
+ });
+ });
+ describe(".smsEnabled", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.smsEnabled).toBe(value);
+ });
+ });
+ describe(".region", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_region";
+ expect(model.region).toBe(value);
+ });
+ });
+ describe(".country", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_country";
+ expect(model.country).toBe(value);
+ });
});
});
- describe(".capabilities", () => {
- it("resolves to particular value on initialization", () => {
- const value = new freeclimb.Capabilities({
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.AvailableNumber;
+ let model: freeclimb.AvailableNumber = new freeclimb.AvailableNumber({
+ capabilities: new freeclimb.Capabilities({
voice: null as any,
sms: null as any,
tollFree: null as any,
tenDLC: null as any,
shortCode: null as any,
+ }),
+ campaignId: "",
+ phoneNumber: "",
+ voiceEnabled: false,
+ smsEnabled: false,
+ region: "",
+ country: "",
+ });
+ describe("AvailableNumber class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.AvailableNumber);
});
- expect(model.capabilities).toStrictEqual(value);
});
- });
- describe(".campaignId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_campaignId";
- expect(model.campaignId).toBe(value);
+ describe(".capabilities", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new freeclimb.Capabilities({
+ voice: null as any,
+ sms: null as any,
+ tollFree: null as any,
+ tenDLC: null as any,
+ shortCode: null as any,
+ });
+ expect(model.capabilities).toStrictEqual(value);
+ });
});
- });
- describe(".phoneNumber", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_phoneNumber";
- expect(model.phoneNumber).toBe(value);
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.campaignId).toBe(value);
+ });
});
- });
- describe(".voiceEnabled", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.voiceEnabled).toBe(value);
+ describe(".phoneNumber", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.phoneNumber).toBe(value);
+ });
});
- });
- describe(".smsEnabled", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.smsEnabled).toBe(value);
+ describe(".voiceEnabled", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.voiceEnabled).toBe(value);
+ });
});
- });
- describe(".region", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_region";
- expect(model.region).toBe(value);
+ describe(".smsEnabled", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.smsEnabled).toBe(value);
+ });
+ });
+ describe(".region", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.region).toBe(value);
+ });
+ });
+ describe(".country", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.country).toBe(value);
+ });
});
});
- describe(".country", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_country";
- expect(model.country).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.AvailableNumber;
+ let constructorArguments = {};
+ let model: freeclimb.AvailableNumber = new freeclimb.AvailableNumber(
+ constructorArguments,
+ );
+
+ describe("#capabilities", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "capabilities",
+ )?.defaultValue;
+ expect(model.capabilities).toBe(value);
+ });
+ });
+ describe("#campaignId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "campaignId",
+ )?.defaultValue;
+ expect(model.campaignId).toBe(value);
+ });
+ });
+ describe("#phoneNumber", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "phoneNumber",
+ )?.defaultValue;
+ expect(model.phoneNumber).toBe(value);
+ });
+ });
+ describe("#voiceEnabled", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "voiceEnabled",
+ )?.defaultValue;
+ expect(model.voiceEnabled).toBe(value);
+ });
+ });
+ describe("#smsEnabled", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "smsEnabled",
+ )?.defaultValue;
+ expect(model.smsEnabled).toBe(value);
+ });
+ });
+ describe("#region", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "region",
+ )?.defaultValue;
+ expect(model.region).toBe(value);
+ });
+ });
+ describe("#country", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "country",
+ )?.defaultValue;
+ expect(model.country).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/AvailableNumberList.spec.ts b/__tests__/models/AvailableNumberList.spec.ts
index e4c8e1c..ae3abdd 100644
--- a/__tests__/models/AvailableNumberList.spec.ts
+++ b/__tests__/models/AvailableNumberList.spec.ts
@@ -2,67 +2,161 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("AvailableNumberList", () => {
- let model: freeclimb.AvailableNumberList = new freeclimb.AvailableNumberList({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- availablePhoneNumbers: [],
- });
- describe("AvailableNumberList class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.AvailableNumberList);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.AvailableNumberList;
+ let model: freeclimb.AvailableNumberList =
+ new freeclimb.AvailableNumberList({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ availablePhoneNumbers: [],
+ });
+ describe("AvailableNumberList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.AvailableNumberList);
+ });
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".availablePhoneNumbers", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.AvailableNumber[] = [];
+ expect(model.availablePhoneNumbers).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.AvailableNumberList;
+ let model: freeclimb.AvailableNumberList =
+ new freeclimb.AvailableNumberList({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ availablePhoneNumbers: [],
+ });
+ describe("AvailableNumberList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.AvailableNumberList);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".availablePhoneNumbers", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.AvailableNumber[] = [];
+ expect(model.availablePhoneNumbers).toStrictEqual(value);
+ });
});
});
- describe(".availablePhoneNumbers", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.AvailableNumber[] = [];
- expect(model.availablePhoneNumbers).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.AvailableNumberList;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.AvailableNumberList =
+ new freeclimb.AvailableNumberList(constructorArguments);
+
+ describe("#availablePhoneNumbers", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "availablePhoneNumbers",
+ )?.defaultValue;
+ expect(model.availablePhoneNumbers).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/BargeInReason.spec.ts b/__tests__/models/BargeInReason.spec.ts
index 920c26f..9aef105 100644
--- a/__tests__/models/BargeInReason.spec.ts
+++ b/__tests__/models/BargeInReason.spec.ts
@@ -2,21 +2,23 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("BargeInReason", () => {
- describe(".NO_BARGE_IN", () => {
- it("resolves to correct value for NO_BARGE_IN enum property", () => {
- expect(freeclimb.BargeInReason.NO_BARGE_IN).toBe("noBargeIn");
+ describe("Test with truthy values", () => {
+ describe(".NO_BARGE_IN", () => {
+ it("resolves to correct value for NO_BARGE_IN enum property", () => {
+ expect(freeclimb.BargeInReason.NO_BARGE_IN).toBe("noBargeIn");
+ });
});
- });
- describe(".BARGE_IN_BY_DTMF", () => {
- it("resolves to correct value for BARGE_IN_BY_DTMF enum property", () => {
- expect(freeclimb.BargeInReason.BARGE_IN_BY_DTMF).toBe("bargeInByDTMF");
+ describe(".BARGE_IN_BY_DTMF", () => {
+ it("resolves to correct value for BARGE_IN_BY_DTMF enum property", () => {
+ expect(freeclimb.BargeInReason.BARGE_IN_BY_DTMF).toBe("bargeInByDTMF");
+ });
});
- });
- describe(".BARGE_IN_BY_ENERGY", () => {
- it("resolves to correct value for BARGE_IN_BY_ENERGY enum property", () => {
- expect(freeclimb.BargeInReason.BARGE_IN_BY_ENERGY).toBe(
- "bargeInByEnergy",
- );
+ describe(".BARGE_IN_BY_ENERGY", () => {
+ it("resolves to correct value for BARGE_IN_BY_ENERGY enum property", () => {
+ expect(freeclimb.BargeInReason.BARGE_IN_BY_ENERGY).toBe(
+ "bargeInByEnergy",
+ );
+ });
});
});
});
diff --git a/__tests__/models/BuyIncomingNumberRequest.spec.ts b/__tests__/models/BuyIncomingNumberRequest.spec.ts
index bf166d1..4c57fea 100644
--- a/__tests__/models/BuyIncomingNumberRequest.spec.ts
+++ b/__tests__/models/BuyIncomingNumberRequest.spec.ts
@@ -2,33 +2,98 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("BuyIncomingNumberRequest", () => {
- let model: freeclimb.BuyIncomingNumberRequest =
- new freeclimb.BuyIncomingNumberRequest({
- phoneNumber: "test_phoneNumber",
- alias: "test_alias",
- applicationId: "test_applicationId",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.BuyIncomingNumberRequest;
+ let model: freeclimb.BuyIncomingNumberRequest =
+ new freeclimb.BuyIncomingNumberRequest({
+ phoneNumber: "test_phoneNumber",
+ alias: "test_alias",
+ applicationId: "test_applicationId",
+ });
+ describe("BuyIncomingNumberRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.BuyIncomingNumberRequest);
+ });
});
- describe("BuyIncomingNumberRequest class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.BuyIncomingNumberRequest);
+ describe(".phoneNumber", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_phoneNumber";
+ expect(model.phoneNumber).toBe(value);
+ });
});
- });
- describe(".phoneNumber", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_phoneNumber";
- expect(model.phoneNumber).toBe(value);
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_alias";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_applicationId";
+ expect(model.applicationId).toBe(value);
+ });
});
});
- describe(".alias", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_alias";
- expect(model.alias).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.BuyIncomingNumberRequest;
+ let model: freeclimb.BuyIncomingNumberRequest =
+ new freeclimb.BuyIncomingNumberRequest({
+ phoneNumber: "",
+ alias: "",
+ applicationId: "",
+ });
+ describe("BuyIncomingNumberRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.BuyIncomingNumberRequest);
+ });
+ });
+ describe(".phoneNumber", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.phoneNumber).toBe(value);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.applicationId).toBe(value);
+ });
});
});
- describe(".applicationId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_applicationId";
- expect(model.applicationId).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.BuyIncomingNumberRequest;
+ let constructorArguments = {
+ phoneNumber: "test_phoneNumber",
+ };
+ let model: freeclimb.BuyIncomingNumberRequest =
+ new freeclimb.BuyIncomingNumberRequest(constructorArguments);
+
+ describe("#phoneNumber", () => {
+ it("resolves to initialization value", () => {
+ expect(model.phoneNumber).toBe(constructorArguments["phoneNumber"]);
+ });
+ });
+ describe("#alias", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "alias",
+ )?.defaultValue;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe("#applicationId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "applicationId",
+ )?.defaultValue;
+ expect(model.applicationId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/CallControlWebhook.spec.ts b/__tests__/models/CallControlWebhook.spec.ts
index 0176f43..4ca4602 100644
--- a/__tests__/models/CallControlWebhook.spec.ts
+++ b/__tests__/models/CallControlWebhook.spec.ts
@@ -2,56 +2,162 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CallControlWebhook", () => {
- let model: freeclimb.CallControlWebhook = new freeclimb.CallControlWebhook({
- requestType: "test_requestType",
- callId: "test_callId",
- accountId: "test_accountId",
- conferenceId: "test_conferenceId",
- digits: "test_digits",
- });
- describe("CallControlWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.CallControlWebhook);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.CallControlWebhook;
+ let model: freeclimb.CallControlWebhook = new freeclimb.CallControlWebhook({
+ requestType: "test_requestType",
+ callId: "test_callId",
+ accountId: "test_accountId",
+ conferenceId: "test_conferenceId",
+ digits: "test_digits",
+ });
+ describe("CallControlWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CallControlWebhook);
+ });
});
- });
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".digits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_digits";
+ expect(model.digits).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of CallControlWebhook", () => {
+ expect(
+ freeclimb.CallControlWebhook.deserialize(
+ '{ "requestType": "callControl"}',
+ ),
+ ).toBeInstanceOf(freeclimb.CallControlWebhook);
+ });
});
});
- describe(".digits", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_digits";
- expect(model.digits).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.CallControlWebhook;
+ let model: freeclimb.CallControlWebhook = new freeclimb.CallControlWebhook({
+ requestType: "",
+ callId: "",
+ accountId: "",
+ conferenceId: "",
+ digits: "",
+ });
+ describe("CallControlWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CallControlWebhook);
+ });
+ });
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".digits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.digits).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of CallControlWebhook", () => {
+ expect(
+ freeclimb.CallControlWebhook.deserialize(
+ '{ "requestType": "callControl"}',
+ ),
+ ).toBeInstanceOf(freeclimb.CallControlWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of CallControlWebhook", () => {
- expect(
- freeclimb.CallControlWebhook.deserialize(
- '{ "requestType": "callControl"}',
- ),
- ).toBeInstanceOf(freeclimb.CallControlWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.CallControlWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.CallControlWebhook = new freeclimb.CallControlWebhook(
+ constructorArguments,
+ );
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#digits", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "digits",
+ )?.defaultValue;
+ expect(model.digits).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/CallDirection.spec.ts b/__tests__/models/CallDirection.spec.ts
index 59cd1ee..36a8d7a 100644
--- a/__tests__/models/CallDirection.spec.ts
+++ b/__tests__/models/CallDirection.spec.ts
@@ -2,19 +2,21 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CallDirection", () => {
- describe(".INBOUND", () => {
- it("resolves to correct value for INBOUND enum property", () => {
- expect(freeclimb.CallDirection.INBOUND).toBe("inbound");
+ describe("Test with truthy values", () => {
+ describe(".INBOUND", () => {
+ it("resolves to correct value for INBOUND enum property", () => {
+ expect(freeclimb.CallDirection.INBOUND).toBe("inbound");
+ });
});
- });
- describe(".OUTBOUND_API", () => {
- it("resolves to correct value for OUTBOUND_API enum property", () => {
- expect(freeclimb.CallDirection.OUTBOUND_API).toBe("outboundAPI");
+ describe(".OUTBOUND_API", () => {
+ it("resolves to correct value for OUTBOUND_API enum property", () => {
+ expect(freeclimb.CallDirection.OUTBOUND_API).toBe("outboundAPI");
+ });
});
- });
- describe(".OUTBOUND_DIAL", () => {
- it("resolves to correct value for OUTBOUND_DIAL enum property", () => {
- expect(freeclimb.CallDirection.OUTBOUND_DIAL).toBe("outboundDial");
+ describe(".OUTBOUND_DIAL", () => {
+ it("resolves to correct value for OUTBOUND_DIAL enum property", () => {
+ expect(freeclimb.CallDirection.OUTBOUND_DIAL).toBe("outboundDial");
+ });
});
});
});
diff --git a/__tests__/models/CallEndedReason.spec.ts b/__tests__/models/CallEndedReason.spec.ts
index 594c9be..7eea3db 100644
--- a/__tests__/models/CallEndedReason.spec.ts
+++ b/__tests__/models/CallEndedReason.spec.ts
@@ -2,139 +2,141 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CallEndedReason", () => {
- describe(".BUSY", () => {
- it("resolves to correct value for BUSY enum property", () => {
- expect(freeclimb.CallEndedReason.BUSY).toBe("busy");
- });
- });
- describe(".FAILED", () => {
- it("resolves to correct value for FAILED enum property", () => {
- expect(freeclimb.CallEndedReason.FAILED).toBe("failed");
- });
- });
- describe(".NO_ANSWER", () => {
- it("resolves to correct value for NO_ANSWER enum property", () => {
- expect(freeclimb.CallEndedReason.NO_ANSWER).toBe("noAnswer");
- });
- });
- describe(".CALL_CANCELED", () => {
- it("resolves to correct value for CALL_CANCELED enum property", () => {
- expect(freeclimb.CallEndedReason.CALL_CANCELED).toBe("callCanceled");
- });
- });
- describe(".FAR_END_HANGUP", () => {
- it("resolves to correct value for FAR_END_HANGUP enum property", () => {
- expect(freeclimb.CallEndedReason.FAR_END_HANGUP).toBe("farEndHangup");
- });
- });
- describe(".APP_HANGUP", () => {
- it("resolves to correct value for APP_HANGUP enum property", () => {
- expect(freeclimb.CallEndedReason.APP_HANGUP).toBe("appHangup");
- });
- });
- describe(".APP_REJECT", () => {
- it("resolves to correct value for APP_REJECT enum property", () => {
- expect(freeclimb.CallEndedReason.APP_REJECT).toBe("appReject");
- });
- });
- describe(".APP_NO_PERCL", () => {
- it("resolves to correct value for APP_NO_PERCL enum property", () => {
- expect(freeclimb.CallEndedReason.APP_NO_PERCL).toBe("appNoPercl");
- });
- });
- describe(".APP_INVALID_PERCL", () => {
- it("resolves to correct value for APP_INVALID_PERCL enum property", () => {
- expect(freeclimb.CallEndedReason.APP_INVALID_PERCL).toBe(
- "appInvalidPercl",
- );
- });
- });
- describe(".CONFERENCE_TERMINATED", () => {
- it("resolves to correct value for CONFERENCE_TERMINATED enum property", () => {
- expect(freeclimb.CallEndedReason.CONFERENCE_TERMINATED).toBe(
- "conferenceTerminated",
- );
- });
- });
- describe(".CONFERENCE_EMPTIED", () => {
- it("resolves to correct value for CONFERENCE_EMPTIED enum property", () => {
- expect(freeclimb.CallEndedReason.CONFERENCE_EMPTIED).toBe(
- "conferenceEmptied",
- );
- });
- });
- describe(".REMOVED_FROM_CONFERENCE", () => {
- it("resolves to correct value for REMOVED_FROM_CONFERENCE enum property", () => {
- expect(freeclimb.CallEndedReason.REMOVED_FROM_CONFERENCE).toBe(
- "removedFromConference",
- );
- });
- });
- describe(".MACHINE_DETECTED", () => {
- it("resolves to correct value for MACHINE_DETECTED enum property", () => {
- expect(freeclimb.CallEndedReason.MACHINE_DETECTED).toBe(
- "machineDetected",
- );
- });
- });
- describe(".WEBHOOK_FAILED", () => {
- it("resolves to correct value for WEBHOOK_FAILED enum property", () => {
- expect(freeclimb.CallEndedReason.WEBHOOK_FAILED).toBe("webhookFailed");
- });
- });
- describe(".WEBHOOK_INVALID_RESPONSE", () => {
- it("resolves to correct value for WEBHOOK_INVALID_RESPONSE enum property", () => {
- expect(freeclimb.CallEndedReason.WEBHOOK_INVALID_RESPONSE).toBe(
- "webhookInvalidResponse",
- );
- });
- });
- describe(".VOICE_DISABLED", () => {
- it("resolves to correct value for VOICE_DISABLED enum property", () => {
- expect(freeclimb.CallEndedReason.VOICE_DISABLED).toBe("voiceDisabled");
- });
- });
- describe(".CONFIG_ERROR_NO_APPLICATION", () => {
- it("resolves to correct value for CONFIG_ERROR_NO_APPLICATION enum property", () => {
- expect(freeclimb.CallEndedReason.CONFIG_ERROR_NO_APPLICATION).toBe(
- "configErrorNoApplication",
- );
- });
- });
- describe(".CONFIG_ERROR_NO_VOICE_URL", () => {
- it("resolves to correct value for CONFIG_ERROR_NO_VOICE_URL enum property", () => {
- expect(freeclimb.CallEndedReason.CONFIG_ERROR_NO_VOICE_URL).toBe(
- "configErrorNoVoiceUrl",
- );
- });
- });
- describe(".MAX_REDIRECTS_ERROR", () => {
- it("resolves to correct value for MAX_REDIRECTS_ERROR enum property", () => {
- expect(freeclimb.CallEndedReason.MAX_REDIRECTS_ERROR).toBe(
- "maxRedirectsError",
- );
- });
- });
- describe(".PERCL_PROCESSING_ERROR", () => {
- it("resolves to correct value for PERCL_PROCESSING_ERROR enum property", () => {
- expect(freeclimb.CallEndedReason.PERCL_PROCESSING_ERROR).toBe(
- "perclProcessingError",
- );
- });
- });
- describe(".INTERNAL_ERROR", () => {
- it("resolves to correct value for INTERNAL_ERROR enum property", () => {
- expect(freeclimb.CallEndedReason.INTERNAL_ERROR).toBe("internalError");
- });
- });
- describe(".GRPC_HANGUP", () => {
- it("resolves to correct value for GRPC_HANGUP enum property", () => {
- expect(freeclimb.CallEndedReason.GRPC_HANGUP).toBe("grpcHangup");
- });
- });
- describe(".MAX_DURATION", () => {
- it("resolves to correct value for MAX_DURATION enum property", () => {
- expect(freeclimb.CallEndedReason.MAX_DURATION).toBe("maxDuration");
+ describe("Test with truthy values", () => {
+ describe(".BUSY", () => {
+ it("resolves to correct value for BUSY enum property", () => {
+ expect(freeclimb.CallEndedReason.BUSY).toBe("busy");
+ });
+ });
+ describe(".FAILED", () => {
+ it("resolves to correct value for FAILED enum property", () => {
+ expect(freeclimb.CallEndedReason.FAILED).toBe("failed");
+ });
+ });
+ describe(".NO_ANSWER", () => {
+ it("resolves to correct value for NO_ANSWER enum property", () => {
+ expect(freeclimb.CallEndedReason.NO_ANSWER).toBe("noAnswer");
+ });
+ });
+ describe(".CALL_CANCELED", () => {
+ it("resolves to correct value for CALL_CANCELED enum property", () => {
+ expect(freeclimb.CallEndedReason.CALL_CANCELED).toBe("callCanceled");
+ });
+ });
+ describe(".FAR_END_HANGUP", () => {
+ it("resolves to correct value for FAR_END_HANGUP enum property", () => {
+ expect(freeclimb.CallEndedReason.FAR_END_HANGUP).toBe("farEndHangup");
+ });
+ });
+ describe(".APP_HANGUP", () => {
+ it("resolves to correct value for APP_HANGUP enum property", () => {
+ expect(freeclimb.CallEndedReason.APP_HANGUP).toBe("appHangup");
+ });
+ });
+ describe(".APP_REJECT", () => {
+ it("resolves to correct value for APP_REJECT enum property", () => {
+ expect(freeclimb.CallEndedReason.APP_REJECT).toBe("appReject");
+ });
+ });
+ describe(".APP_NO_PERCL", () => {
+ it("resolves to correct value for APP_NO_PERCL enum property", () => {
+ expect(freeclimb.CallEndedReason.APP_NO_PERCL).toBe("appNoPercl");
+ });
+ });
+ describe(".APP_INVALID_PERCL", () => {
+ it("resolves to correct value for APP_INVALID_PERCL enum property", () => {
+ expect(freeclimb.CallEndedReason.APP_INVALID_PERCL).toBe(
+ "appInvalidPercl",
+ );
+ });
+ });
+ describe(".CONFERENCE_TERMINATED", () => {
+ it("resolves to correct value for CONFERENCE_TERMINATED enum property", () => {
+ expect(freeclimb.CallEndedReason.CONFERENCE_TERMINATED).toBe(
+ "conferenceTerminated",
+ );
+ });
+ });
+ describe(".CONFERENCE_EMPTIED", () => {
+ it("resolves to correct value for CONFERENCE_EMPTIED enum property", () => {
+ expect(freeclimb.CallEndedReason.CONFERENCE_EMPTIED).toBe(
+ "conferenceEmptied",
+ );
+ });
+ });
+ describe(".REMOVED_FROM_CONFERENCE", () => {
+ it("resolves to correct value for REMOVED_FROM_CONFERENCE enum property", () => {
+ expect(freeclimb.CallEndedReason.REMOVED_FROM_CONFERENCE).toBe(
+ "removedFromConference",
+ );
+ });
+ });
+ describe(".MACHINE_DETECTED", () => {
+ it("resolves to correct value for MACHINE_DETECTED enum property", () => {
+ expect(freeclimb.CallEndedReason.MACHINE_DETECTED).toBe(
+ "machineDetected",
+ );
+ });
+ });
+ describe(".WEBHOOK_FAILED", () => {
+ it("resolves to correct value for WEBHOOK_FAILED enum property", () => {
+ expect(freeclimb.CallEndedReason.WEBHOOK_FAILED).toBe("webhookFailed");
+ });
+ });
+ describe(".WEBHOOK_INVALID_RESPONSE", () => {
+ it("resolves to correct value for WEBHOOK_INVALID_RESPONSE enum property", () => {
+ expect(freeclimb.CallEndedReason.WEBHOOK_INVALID_RESPONSE).toBe(
+ "webhookInvalidResponse",
+ );
+ });
+ });
+ describe(".VOICE_DISABLED", () => {
+ it("resolves to correct value for VOICE_DISABLED enum property", () => {
+ expect(freeclimb.CallEndedReason.VOICE_DISABLED).toBe("voiceDisabled");
+ });
+ });
+ describe(".CONFIG_ERROR_NO_APPLICATION", () => {
+ it("resolves to correct value for CONFIG_ERROR_NO_APPLICATION enum property", () => {
+ expect(freeclimb.CallEndedReason.CONFIG_ERROR_NO_APPLICATION).toBe(
+ "configErrorNoApplication",
+ );
+ });
+ });
+ describe(".CONFIG_ERROR_NO_VOICE_URL", () => {
+ it("resolves to correct value for CONFIG_ERROR_NO_VOICE_URL enum property", () => {
+ expect(freeclimb.CallEndedReason.CONFIG_ERROR_NO_VOICE_URL).toBe(
+ "configErrorNoVoiceUrl",
+ );
+ });
+ });
+ describe(".MAX_REDIRECTS_ERROR", () => {
+ it("resolves to correct value for MAX_REDIRECTS_ERROR enum property", () => {
+ expect(freeclimb.CallEndedReason.MAX_REDIRECTS_ERROR).toBe(
+ "maxRedirectsError",
+ );
+ });
+ });
+ describe(".PERCL_PROCESSING_ERROR", () => {
+ it("resolves to correct value for PERCL_PROCESSING_ERROR enum property", () => {
+ expect(freeclimb.CallEndedReason.PERCL_PROCESSING_ERROR).toBe(
+ "perclProcessingError",
+ );
+ });
+ });
+ describe(".INTERNAL_ERROR", () => {
+ it("resolves to correct value for INTERNAL_ERROR enum property", () => {
+ expect(freeclimb.CallEndedReason.INTERNAL_ERROR).toBe("internalError");
+ });
+ });
+ describe(".GRPC_HANGUP", () => {
+ it("resolves to correct value for GRPC_HANGUP enum property", () => {
+ expect(freeclimb.CallEndedReason.GRPC_HANGUP).toBe("grpcHangup");
+ });
+ });
+ describe(".MAX_DURATION", () => {
+ it("resolves to correct value for MAX_DURATION enum property", () => {
+ expect(freeclimb.CallEndedReason.MAX_DURATION).toBe("maxDuration");
+ });
});
});
});
diff --git a/__tests__/models/CallList.spec.ts b/__tests__/models/CallList.spec.ts
index 2eebe1a..af402de 100644
--- a/__tests__/models/CallList.spec.ts
+++ b/__tests__/models/CallList.spec.ts
@@ -2,67 +2,160 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CallList", () => {
- let model: freeclimb.CallList = new freeclimb.CallList({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- calls: [],
- });
- describe("CallList class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.CallList);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.CallList;
+ let model: freeclimb.CallList = new freeclimb.CallList({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ calls: [],
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe("CallList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CallList);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".calls", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.CallResult[] = [];
+ expect(model.calls).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.CallList;
+ let model: freeclimb.CallList = new freeclimb.CallList({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ calls: [],
+ });
+ describe("CallList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CallList);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".calls", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.CallResult[] = [];
+ expect(model.calls).toStrictEqual(value);
+ });
});
});
- describe(".calls", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.CallResult[] = [];
- expect(model.calls).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.CallList;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.CallList = new freeclimb.CallList(
+ constructorArguments,
+ );
+
+ describe("#calls", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "calls",
+ )?.defaultValue;
+ expect(model.calls).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/CallResult.spec.ts b/__tests__/models/CallResult.spec.ts
index 4fee26f..f9ff925 100644
--- a/__tests__/models/CallResult.spec.ts
+++ b/__tests__/models/CallResult.spec.ts
@@ -2,156 +2,455 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CallResult", () => {
- let model: freeclimb.CallResult = new freeclimb.CallResult({
- uri: "test_uri",
- dateCreated: "test_dateCreated",
- dateUpdated: "test_dateUpdated",
- revision: 1,
- callId: "test_callId",
- parentCallId: "test_parentCallId",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
- phoneNumberId: "test_phoneNumberId",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.CallResult;
+ let model: freeclimb.CallResult = new freeclimb.CallResult({
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ callId: "test_callId",
+ parentCallId: "test_parentCallId",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
+ phoneNumberId: "test_phoneNumberId",
- callStatus: freeclimb.CallStatus.QUEUED,
- startTime: "test_startTime",
- connectTime: "test_connectTime",
- endTime: "test_endTime",
- duration: 1,
- connectDuration: 1,
+ callStatus: freeclimb.CallStatus.QUEUED,
+ startTime: "test_startTime",
+ connectTime: "test_connectTime",
+ endTime: "test_endTime",
+ duration: 1,
+ connectDuration: 1,
- direction: freeclimb.CallDirection.INBOUND,
+ direction: freeclimb.CallDirection.INBOUND,
- answeredBy: freeclimb.AnsweredBy.HUMAN,
- subresourceUris: {},
+ answeredBy: freeclimb.AnsweredBy.HUMAN,
+ subresourceUris: {},
- applicationId: "test_applicationId",
- });
- describe("CallResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.CallResult);
+ applicationId: "test_applicationId",
});
- });
- describe(".uri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_uri";
- expect(model.uri).toBe(value);
+ describe("CallResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CallResult);
+ });
});
- });
- describe(".dateCreated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreated";
- expect(model.dateCreated).toBe(value);
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_uri";
+ expect(model.uri).toBe(value);
+ });
});
- });
- describe(".dateUpdated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdated";
- expect(model.dateUpdated).toBe(value);
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreated";
+ expect(model.dateCreated).toBe(value);
+ });
});
- });
- describe(".revision", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.revision).toBe(value);
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdated";
+ expect(model.dateUpdated).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.revision).toBe(value);
+ });
});
- });
- describe(".parentCallId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_parentCallId";
- expect(model.parentCallId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_parentCallId";
+ expect(model.parentCallId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".phoneNumberId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_phoneNumberId";
- expect(model.phoneNumberId).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".phoneNumberId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_phoneNumberId";
+ expect(model.phoneNumberId).toBe(value);
+ });
});
- });
- describe(".startTime", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_startTime";
- expect(model.startTime).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".connectTime", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_connectTime";
- expect(model.connectTime).toBe(value);
+ describe(".startTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_startTime";
+ expect(model.startTime).toBe(value);
+ });
});
- });
- describe(".endTime", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_endTime";
- expect(model.endTime).toBe(value);
+ describe(".connectTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_connectTime";
+ expect(model.connectTime).toBe(value);
+ });
});
- });
- describe(".duration", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.duration).toBe(value);
+ describe(".endTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_endTime";
+ expect(model.endTime).toBe(value);
+ });
});
- });
- describe(".connectDuration", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.connectDuration).toBe(value);
+ describe(".duration", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.duration).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".connectDuration", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.connectDuration).toBe(value);
+ });
});
- });
- describe(".answeredBy", () => {
- it("resolves to particular value on initialization", () => {
- const value = "human";
- expect(model.answeredBy).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".answeredBy", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "human";
+ expect(model.answeredBy).toBe(value);
+ });
+ });
+ describe(".subresourceUris", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = {};
+ const receivedValue: any = model.subresourceUris;
+ expect(receivedValue).toStrictEqual(value);
+ });
+ });
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_applicationId";
+ expect(model.applicationId).toBe(value);
+ });
});
});
- describe(".subresourceUris", () => {
- it("resolves to particular value on initialization", () => {
- const value = {};
- const receivedValue: any = model.subresourceUris;
- expect(receivedValue).toStrictEqual(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.CallResult;
+ let model: freeclimb.CallResult = new freeclimb.CallResult({
+ uri: "",
+ dateCreated: "",
+ dateUpdated: "",
+ revision: 0,
+ callId: "",
+ parentCallId: "",
+ accountId: "",
+ from: "",
+ to: "",
+ phoneNumberId: "",
+
+ callStatus: freeclimb.CallStatus.QUEUED,
+ startTime: "",
+ connectTime: "",
+ endTime: "",
+ duration: 0,
+ connectDuration: 0,
+
+ direction: freeclimb.CallDirection.INBOUND,
+
+ answeredBy: freeclimb.AnsweredBy.HUMAN,
+ subresourceUris: {},
+
+ applicationId: "",
+ });
+ describe("CallResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CallResult);
+ });
+ });
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.revision).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".phoneNumberId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.phoneNumberId).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".startTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.startTime).toBe(value);
+ });
+ });
+ describe(".connectTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.connectTime).toBe(value);
+ });
+ });
+ describe(".endTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.endTime).toBe(value);
+ });
+ });
+ describe(".duration", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.duration).toBe(value);
+ });
+ });
+ describe(".connectDuration", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.connectDuration).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".answeredBy", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "human";
+ expect(model.answeredBy).toBe(value);
+ });
+ });
+ describe(".subresourceUris", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = {};
+ const receivedValue: any = model.subresourceUris;
+ expect(receivedValue).toStrictEqual(value);
+ });
+ });
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.applicationId).toBe(value);
+ });
});
});
- describe(".applicationId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_applicationId";
- expect(model.applicationId).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.CallResult;
+ let constructorArguments = {
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ };
+ let model: freeclimb.CallResult = new freeclimb.CallResult(
+ constructorArguments,
+ );
+
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#parentCallId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "parentCallId",
+ )?.defaultValue;
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#phoneNumberId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "phoneNumberId",
+ )?.defaultValue;
+ expect(model.phoneNumberId).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#startTime", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "startTime",
+ )?.defaultValue;
+ expect(model.startTime).toBe(value);
+ });
+ });
+ describe("#connectTime", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "connectTime",
+ )?.defaultValue;
+ expect(model.connectTime).toBe(value);
+ });
+ });
+ describe("#endTime", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "endTime",
+ )?.defaultValue;
+ expect(model.endTime).toBe(value);
+ });
+ });
+ describe("#duration", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "duration",
+ )?.defaultValue;
+ expect(model.duration).toBe(value);
+ });
+ });
+ describe("#connectDuration", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "connectDuration",
+ )?.defaultValue;
+ expect(model.connectDuration).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#answeredBy", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "answeredBy",
+ )?.defaultValue;
+ expect(model.answeredBy).toBe(value);
+ });
+ });
+ describe("#subresourceUris", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "subresourceUris",
+ )?.defaultValue;
+ expect(model.subresourceUris).toBe(value);
+ });
+ });
+ describe("#applicationId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "applicationId",
+ )?.defaultValue;
+ expect(model.applicationId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/CallStatus.spec.ts b/__tests__/models/CallStatus.spec.ts
index 3fbbbe8..cc6bc0f 100644
--- a/__tests__/models/CallStatus.spec.ts
+++ b/__tests__/models/CallStatus.spec.ts
@@ -2,44 +2,46 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CallStatus", () => {
- describe(".QUEUED", () => {
- it("resolves to correct value for QUEUED enum property", () => {
- expect(freeclimb.CallStatus.QUEUED).toBe("queued");
- });
- });
- describe(".RINGING", () => {
- it("resolves to correct value for RINGING enum property", () => {
- expect(freeclimb.CallStatus.RINGING).toBe("ringing");
- });
- });
- describe(".IN_PROGRESS", () => {
- it("resolves to correct value for IN_PROGRESS enum property", () => {
- expect(freeclimb.CallStatus.IN_PROGRESS).toBe("inProgress");
- });
- });
- describe(".CANCELED", () => {
- it("resolves to correct value for CANCELED enum property", () => {
- expect(freeclimb.CallStatus.CANCELED).toBe("canceled");
- });
- });
- describe(".COMPLETED", () => {
- it("resolves to correct value for COMPLETED enum property", () => {
- expect(freeclimb.CallStatus.COMPLETED).toBe("completed");
- });
- });
- describe(".FAILED", () => {
- it("resolves to correct value for FAILED enum property", () => {
- expect(freeclimb.CallStatus.FAILED).toBe("failed");
- });
- });
- describe(".BUSY", () => {
- it("resolves to correct value for BUSY enum property", () => {
- expect(freeclimb.CallStatus.BUSY).toBe("busy");
- });
- });
- describe(".NO_ANSWER", () => {
- it("resolves to correct value for NO_ANSWER enum property", () => {
- expect(freeclimb.CallStatus.NO_ANSWER).toBe("noAnswer");
+ describe("Test with truthy values", () => {
+ describe(".QUEUED", () => {
+ it("resolves to correct value for QUEUED enum property", () => {
+ expect(freeclimb.CallStatus.QUEUED).toBe("queued");
+ });
+ });
+ describe(".RINGING", () => {
+ it("resolves to correct value for RINGING enum property", () => {
+ expect(freeclimb.CallStatus.RINGING).toBe("ringing");
+ });
+ });
+ describe(".IN_PROGRESS", () => {
+ it("resolves to correct value for IN_PROGRESS enum property", () => {
+ expect(freeclimb.CallStatus.IN_PROGRESS).toBe("inProgress");
+ });
+ });
+ describe(".CANCELED", () => {
+ it("resolves to correct value for CANCELED enum property", () => {
+ expect(freeclimb.CallStatus.CANCELED).toBe("canceled");
+ });
+ });
+ describe(".COMPLETED", () => {
+ it("resolves to correct value for COMPLETED enum property", () => {
+ expect(freeclimb.CallStatus.COMPLETED).toBe("completed");
+ });
+ });
+ describe(".FAILED", () => {
+ it("resolves to correct value for FAILED enum property", () => {
+ expect(freeclimb.CallStatus.FAILED).toBe("failed");
+ });
+ });
+ describe(".BUSY", () => {
+ it("resolves to correct value for BUSY enum property", () => {
+ expect(freeclimb.CallStatus.BUSY).toBe("busy");
+ });
+ });
+ describe(".NO_ANSWER", () => {
+ it("resolves to correct value for NO_ANSWER enum property", () => {
+ expect(freeclimb.CallStatus.NO_ANSWER).toBe("noAnswer");
+ });
});
});
});
diff --git a/__tests__/models/CallStatusWebhook.spec.ts b/__tests__/models/CallStatusWebhook.spec.ts
index fd8ffa7..7cc05d2 100644
--- a/__tests__/models/CallStatusWebhook.spec.ts
+++ b/__tests__/models/CallStatusWebhook.spec.ts
@@ -2,94 +2,278 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CallStatusWebhook", () => {
- let model: freeclimb.CallStatusWebhook = new freeclimb.CallStatusWebhook({
- requestType: "test_requestType",
- callId: "test_callId",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.CallStatusWebhook;
+ let model: freeclimb.CallStatusWebhook = new freeclimb.CallStatusWebhook({
+ requestType: "test_requestType",
+ callId: "test_callId",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- callEndedReason: freeclimb.CallEndedReason.BUSY,
+ callEndedReason: freeclimb.CallEndedReason.BUSY,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
- });
- describe("CallStatusWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.CallStatusWebhook);
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
+ });
+ describe("CallStatusWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CallStatusWebhook);
+ });
});
- });
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".callEndedReason", () => {
- it("resolves to particular value on initialization", () => {
- const value = "busy";
- expect(model.callEndedReason).toBe(value);
+ describe(".callEndedReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "busy";
+ expect(model.callEndedReason).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of CallStatusWebhook", () => {
+ expect(
+ freeclimb.CallStatusWebhook.deserialize(
+ '{ "requestType": "callStatus"}',
+ ),
+ ).toBeInstanceOf(freeclimb.CallStatusWebhook);
+ });
});
});
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.CallStatusWebhook;
+ let model: freeclimb.CallStatusWebhook = new freeclimb.CallStatusWebhook({
+ requestType: "",
+ callId: "",
+ accountId: "",
+ from: "",
+ to: "",
+
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ callEndedReason: freeclimb.CallEndedReason.BUSY,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+ });
+ describe("CallStatusWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CallStatusWebhook);
+ });
+ });
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".callEndedReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "busy";
+ expect(model.callEndedReason).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of CallStatusWebhook", () => {
+ expect(
+ freeclimb.CallStatusWebhook.deserialize(
+ '{ "requestType": "callStatus"}',
+ ),
+ ).toBeInstanceOf(freeclimb.CallStatusWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of CallStatusWebhook", () => {
- expect(
- freeclimb.CallStatusWebhook.deserialize(
- '{ "requestType": "callStatus"}',
- ),
- ).toBeInstanceOf(freeclimb.CallStatusWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.CallStatusWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.CallStatusWebhook = new freeclimb.CallStatusWebhook(
+ constructorArguments,
+ );
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#callEndedReason", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callEndedReason",
+ )?.defaultValue;
+ expect(model.callEndedReason).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/Capabilities.spec.ts b/__tests__/models/Capabilities.spec.ts
index fa0460d..ce35539 100644
--- a/__tests__/models/Capabilities.spec.ts
+++ b/__tests__/models/Capabilities.spec.ts
@@ -2,46 +2,133 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Capabilities", () => {
- let model: freeclimb.Capabilities = new freeclimb.Capabilities({
- voice: true,
- sms: true,
- tollFree: true,
- tenDLC: true,
- shortCode: true,
- });
- describe("Capabilities class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.Capabilities);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.Capabilities;
+ let model: freeclimb.Capabilities = new freeclimb.Capabilities({
+ voice: true,
+ sms: true,
+ tollFree: true,
+ tenDLC: true,
+ shortCode: true,
});
- });
- describe(".voice", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.voice).toBe(value);
+ describe("Capabilities class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Capabilities);
+ });
});
- });
- describe(".sms", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.sms).toBe(value);
+ describe(".voice", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.voice).toBe(value);
+ });
});
- });
- describe(".tollFree", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.tollFree).toBe(value);
+ describe(".sms", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.sms).toBe(value);
+ });
+ });
+ describe(".tollFree", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.tollFree).toBe(value);
+ });
+ });
+ describe(".tenDLC", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.tenDLC).toBe(value);
+ });
+ });
+ describe(".shortCode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.shortCode).toBe(value);
+ });
});
});
- describe(".tenDLC", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.tenDLC).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.Capabilities;
+ let model: freeclimb.Capabilities = new freeclimb.Capabilities({
+ voice: false,
+ sms: false,
+ tollFree: false,
+ tenDLC: false,
+ shortCode: false,
+ });
+ describe("Capabilities class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Capabilities);
+ });
+ });
+ describe(".voice", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.voice).toBe(value);
+ });
+ });
+ describe(".sms", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.sms).toBe(value);
+ });
+ });
+ describe(".tollFree", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.tollFree).toBe(value);
+ });
+ });
+ describe(".tenDLC", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.tenDLC).toBe(value);
+ });
+ });
+ describe(".shortCode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.shortCode).toBe(value);
+ });
});
});
- describe(".shortCode", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.shortCode).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.Capabilities;
+ let constructorArguments = {
+ voice: true,
+ sms: true,
+ tollFree: true,
+ tenDLC: true,
+ shortCode: true,
+ };
+ let model: freeclimb.Capabilities = new freeclimb.Capabilities(
+ constructorArguments,
+ );
+
+ describe("#voice", () => {
+ it("resolves to initialization value", () => {
+ expect(model.voice).toBe(constructorArguments["voice"]);
+ });
+ });
+ describe("#sms", () => {
+ it("resolves to initialization value", () => {
+ expect(model.sms).toBe(constructorArguments["sms"]);
+ });
+ });
+ describe("#tollFree", () => {
+ it("resolves to initialization value", () => {
+ expect(model.tollFree).toBe(constructorArguments["tollFree"]);
+ });
+ });
+ describe("#tenDLC", () => {
+ it("resolves to initialization value", () => {
+ expect(model.tenDLC).toBe(constructorArguments["tenDLC"]);
+ });
+ });
+ describe("#shortCode", () => {
+ it("resolves to initialization value", () => {
+ expect(model.shortCode).toBe(constructorArguments["shortCode"]);
+ });
});
});
});
diff --git a/__tests__/models/CompletionRequest.spec.ts b/__tests__/models/CompletionRequest.spec.ts
index bf41521..506fbd2 100644
--- a/__tests__/models/CompletionRequest.spec.ts
+++ b/__tests__/models/CompletionRequest.spec.ts
@@ -2,18 +2,53 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CompletionRequest", () => {
- let model: freeclimb.CompletionRequest = new freeclimb.CompletionRequest({
- query: "test_query",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.CompletionRequest;
+ let model: freeclimb.CompletionRequest = new freeclimb.CompletionRequest({
+ query: "test_query",
+ });
+ describe("CompletionRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CompletionRequest);
+ });
+ });
+ describe(".query", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_query";
+ expect(model.query).toBe(value);
+ });
+ });
});
- describe("CompletionRequest class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.CompletionRequest);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.CompletionRequest;
+ let model: freeclimb.CompletionRequest = new freeclimb.CompletionRequest({
+ query: "",
+ });
+ describe("CompletionRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CompletionRequest);
+ });
+ });
+ describe(".query", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.query).toBe(value);
+ });
});
});
- describe(".query", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_query";
- expect(model.query).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.CompletionRequest;
+ let constructorArguments = {
+ query: "test_query",
+ };
+ let model: freeclimb.CompletionRequest = new freeclimb.CompletionRequest(
+ constructorArguments,
+ );
+
+ describe("#query", () => {
+ it("resolves to initialization value", () => {
+ expect(model.query).toBe(constructorArguments["query"]);
+ });
});
});
});
diff --git a/__tests__/models/CompletionResult.spec.ts b/__tests__/models/CompletionResult.spec.ts
index 3c6ba26..b2d9ab9 100644
--- a/__tests__/models/CompletionResult.spec.ts
+++ b/__tests__/models/CompletionResult.spec.ts
@@ -2,26 +2,76 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CompletionResult", () => {
- let model: freeclimb.CompletionResult = new freeclimb.CompletionResult({
- response: "test_response",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.CompletionResult;
+ let model: freeclimb.CompletionResult = new freeclimb.CompletionResult({
+ response: "test_response",
- status: freeclimb.CompletionResultStatus.SUCCESS,
- });
- describe("CompletionResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.CompletionResult);
+ status: freeclimb.CompletionResultStatus.SUCCESS,
+ });
+ describe("CompletionResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CompletionResult);
+ });
+ });
+ describe(".response", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_response";
+ expect(model.response).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "success";
+ expect(model.status).toBe(value);
+ });
});
});
- describe(".response", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_response";
- expect(model.response).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.CompletionResult;
+ let model: freeclimb.CompletionResult = new freeclimb.CompletionResult({
+ response: "",
+
+ status: freeclimb.CompletionResultStatus.SUCCESS,
+ });
+ describe("CompletionResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CompletionResult);
+ });
+ });
+ describe(".response", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.response).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "success";
+ expect(model.status).toBe(value);
+ });
});
});
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "success";
- expect(model.status).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.CompletionResult;
+ let constructorArguments = {
+ response: "test_response",
+
+ status: freeclimb.CompletionResultStatus.SUCCESS,
+ };
+ let model: freeclimb.CompletionResult = new freeclimb.CompletionResult(
+ constructorArguments,
+ );
+
+ describe("#response", () => {
+ it("resolves to initialization value", () => {
+ expect(model.response).toBe(constructorArguments["response"]);
+ });
+ });
+ describe("#status", () => {
+ it("resolves to initialization value", () => {
+ expect(model.status).toBe(constructorArguments["status"]);
+ });
});
});
});
diff --git a/__tests__/models/CompletionResultStatus.spec.ts b/__tests__/models/CompletionResultStatus.spec.ts
index 420d6cf..03d3cc5 100644
--- a/__tests__/models/CompletionResultStatus.spec.ts
+++ b/__tests__/models/CompletionResultStatus.spec.ts
@@ -2,14 +2,16 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CompletionResultStatus", () => {
- describe(".SUCCESS", () => {
- it("resolves to correct value for SUCCESS enum property", () => {
- expect(freeclimb.CompletionResultStatus.SUCCESS).toBe("success");
+ describe("Test with truthy values", () => {
+ describe(".SUCCESS", () => {
+ it("resolves to correct value for SUCCESS enum property", () => {
+ expect(freeclimb.CompletionResultStatus.SUCCESS).toBe("success");
+ });
});
- });
- describe(".NO_CONTEXT", () => {
- it("resolves to correct value for NO_CONTEXT enum property", () => {
- expect(freeclimb.CompletionResultStatus.NO_CONTEXT).toBe("no_context");
+ describe(".NO_CONTEXT", () => {
+ it("resolves to correct value for NO_CONTEXT enum property", () => {
+ expect(freeclimb.CompletionResultStatus.NO_CONTEXT).toBe("no_context");
+ });
});
});
});
diff --git a/__tests__/models/ConferenceList.spec.ts b/__tests__/models/ConferenceList.spec.ts
index 6ffe04c..141dd6c 100644
--- a/__tests__/models/ConferenceList.spec.ts
+++ b/__tests__/models/ConferenceList.spec.ts
@@ -2,67 +2,160 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("ConferenceList", () => {
- let model: freeclimb.ConferenceList = new freeclimb.ConferenceList({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- conferences: [],
- });
- describe("ConferenceList class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.ConferenceList);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.ConferenceList;
+ let model: freeclimb.ConferenceList = new freeclimb.ConferenceList({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ conferences: [],
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe("ConferenceList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ConferenceList);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".conferences", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.ConferenceResult[] = [];
+ expect(model.conferences).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.ConferenceList;
+ let model: freeclimb.ConferenceList = new freeclimb.ConferenceList({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ conferences: [],
+ });
+ describe("ConferenceList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ConferenceList);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".conferences", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.ConferenceResult[] = [];
+ expect(model.conferences).toStrictEqual(value);
+ });
});
});
- describe(".conferences", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.ConferenceResult[] = [];
- expect(model.conferences).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.ConferenceList;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.ConferenceList = new freeclimb.ConferenceList(
+ constructorArguments,
+ );
+
+ describe("#conferences", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferences",
+ )?.defaultValue;
+ expect(model.conferences).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/ConferenceParticipantList.spec.ts b/__tests__/models/ConferenceParticipantList.spec.ts
index a6075b1..a248c46 100644
--- a/__tests__/models/ConferenceParticipantList.spec.ts
+++ b/__tests__/models/ConferenceParticipantList.spec.ts
@@ -2,68 +2,161 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("ConferenceParticipantList", () => {
- let model: freeclimb.ConferenceParticipantList =
- new freeclimb.ConferenceParticipantList({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- participants: [],
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.ConferenceParticipantList;
+ let model: freeclimb.ConferenceParticipantList =
+ new freeclimb.ConferenceParticipantList({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ participants: [],
+ });
+ describe("ConferenceParticipantList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ConferenceParticipantList);
+ });
});
- describe("ConferenceParticipantList class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.ConferenceParticipantList);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".participants", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.ConferenceParticipantResult[] = [];
+ expect(model.participants).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.ConferenceParticipantList;
+ let model: freeclimb.ConferenceParticipantList =
+ new freeclimb.ConferenceParticipantList({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ participants: [],
+ });
+ describe("ConferenceParticipantList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ConferenceParticipantList);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".participants", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.ConferenceParticipantResult[] = [];
+ expect(model.participants).toStrictEqual(value);
+ });
});
});
- describe(".participants", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.ConferenceParticipantResult[] = [];
- expect(model.participants).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.ConferenceParticipantList;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.ConferenceParticipantList =
+ new freeclimb.ConferenceParticipantList(constructorArguments);
+
+ describe("#participants", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "participants",
+ )?.defaultValue;
+ expect(model.participants).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/ConferenceParticipantResult.spec.ts b/__tests__/models/ConferenceParticipantResult.spec.ts
index 7850e23..f6a848a 100644
--- a/__tests__/models/ConferenceParticipantResult.spec.ts
+++ b/__tests__/models/ConferenceParticipantResult.spec.ts
@@ -2,89 +2,248 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("ConferenceParticipantResult", () => {
- let model: freeclimb.ConferenceParticipantResult =
- new freeclimb.ConferenceParticipantResult({
- uri: "test_uri",
- dateCreated: "test_dateCreated",
- dateUpdated: "test_dateUpdated",
- revision: 1,
- accountId: "test_accountId",
- conferenceId: "test_conferenceId",
- callId: "test_callId",
- talk: true,
- listen: true,
- dtmfPassThrough: true,
- startConfOnEnter: true,
- });
- describe("ConferenceParticipantResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.ConferenceParticipantResult);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.ConferenceParticipantResult;
+ let model: freeclimb.ConferenceParticipantResult =
+ new freeclimb.ConferenceParticipantResult({
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ accountId: "test_accountId",
+ conferenceId: "test_conferenceId",
+ callId: "test_callId",
+ talk: true,
+ listen: true,
+ dtmfPassThrough: true,
+ startConfOnEnter: true,
+ });
+ describe("ConferenceParticipantResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ConferenceParticipantResult);
+ });
});
- });
- describe(".uri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_uri";
- expect(model.uri).toBe(value);
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_uri";
+ expect(model.uri).toBe(value);
+ });
});
- });
- describe(".dateCreated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreated";
- expect(model.dateCreated).toBe(value);
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreated";
+ expect(model.dateCreated).toBe(value);
+ });
});
- });
- describe(".dateUpdated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdated";
- expect(model.dateUpdated).toBe(value);
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdated";
+ expect(model.dateUpdated).toBe(value);
+ });
});
- });
- describe(".revision", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.revision).toBe(value);
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.revision).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".talk", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.talk).toBe(value);
+ describe(".talk", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.talk).toBe(value);
+ });
});
- });
- describe(".listen", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.listen).toBe(value);
+ describe(".listen", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.listen).toBe(value);
+ });
+ });
+ describe(".dtmfPassThrough", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.dtmfPassThrough).toBe(value);
+ });
+ });
+ describe(".startConfOnEnter", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.startConfOnEnter).toBe(value);
+ });
});
});
- describe(".dtmfPassThrough", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.dtmfPassThrough).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.ConferenceParticipantResult;
+ let model: freeclimb.ConferenceParticipantResult =
+ new freeclimb.ConferenceParticipantResult({
+ uri: "",
+ dateCreated: "",
+ dateUpdated: "",
+ revision: 0,
+ accountId: "",
+ conferenceId: "",
+ callId: "",
+ talk: false,
+ listen: false,
+ dtmfPassThrough: false,
+ startConfOnEnter: false,
+ });
+ describe("ConferenceParticipantResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ConferenceParticipantResult);
+ });
+ });
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.revision).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".talk", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.talk).toBe(value);
+ });
+ });
+ describe(".listen", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.listen).toBe(value);
+ });
+ });
+ describe(".dtmfPassThrough", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.dtmfPassThrough).toBe(value);
+ });
+ });
+ describe(".startConfOnEnter", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.startConfOnEnter).toBe(value);
+ });
});
});
- describe(".startConfOnEnter", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.startConfOnEnter).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.ConferenceParticipantResult;
+ let constructorArguments = {
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ };
+ let model: freeclimb.ConferenceParticipantResult =
+ new freeclimb.ConferenceParticipantResult(constructorArguments);
+
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#talk", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "talk",
+ )?.defaultValue;
+ expect(model.talk).toBe(value);
+ });
+ });
+ describe("#listen", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "listen",
+ )?.defaultValue;
+ expect(model.listen).toBe(value);
+ });
+ });
+ describe("#dtmfPassThrough", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "dtmfPassThrough",
+ )?.defaultValue;
+ expect(model.dtmfPassThrough).toBe(value);
+ });
+ });
+ describe("#startConfOnEnter", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "startConfOnEnter",
+ )?.defaultValue;
+ expect(model.startConfOnEnter).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/ConferenceRecordingStatusWebhook.spec.ts b/__tests__/models/ConferenceRecordingStatusWebhook.spec.ts
index 51d3cd8..1136b42 100644
--- a/__tests__/models/ConferenceRecordingStatusWebhook.spec.ts
+++ b/__tests__/models/ConferenceRecordingStatusWebhook.spec.ts
@@ -2,116 +2,349 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("ConferenceRecordingStatusWebhook", () => {
- let model: freeclimb.ConferenceRecordingStatusWebhook =
- new freeclimb.ConferenceRecordingStatusWebhook({
- requestType: "test_requestType",
- callId: "test_callId",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.ConferenceRecordingStatusWebhook;
+ let model: freeclimb.ConferenceRecordingStatusWebhook =
+ new freeclimb.ConferenceRecordingStatusWebhook({
+ requestType: "test_requestType",
+ callId: "test_callId",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
- status: freeclimb.ConferenceStatus.EMPTY,
- recordingUrl: "https://123.abc",
- recordingId: "test_recordingId",
- recordingDurationSec: 1,
+ status: freeclimb.ConferenceStatus.EMPTY,
+ recordingUrl: "https://123.abc",
+ recordingId: "test_recordingId",
+ recordingDurationSec: 1,
+ });
+ describe("ConferenceRecordingStatusWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(
+ freeclimb.ConferenceRecordingStatusWebhook,
+ );
+ });
});
- describe("ConferenceRecordingStatusWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.ConferenceRecordingStatusWebhook);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "empty";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".recordingUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.recordingUrl).toBe(value);
+ });
+ });
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_recordingId";
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe(".recordingDurationSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.recordingDurationSec).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of ConferenceRecordingStatusWebhook", () => {
+ expect(
+ freeclimb.ConferenceRecordingStatusWebhook.deserialize(
+ '{ "requestType": "conferenceRecordingStatus"}',
+ ),
+ ).toBeInstanceOf(freeclimb.ConferenceRecordingStatusWebhook);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.ConferenceRecordingStatusWebhook;
+ let model: freeclimb.ConferenceRecordingStatusWebhook =
+ new freeclimb.ConferenceRecordingStatusWebhook({
+ requestType: "",
+ callId: "",
+ accountId: "",
+ from: "",
+ to: "",
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+
+ status: freeclimb.ConferenceStatus.EMPTY,
+ recordingUrl: "",
+ recordingId: "",
+ recordingDurationSec: 0,
+ });
+ describe("ConferenceRecordingStatusWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(
+ freeclimb.ConferenceRecordingStatusWebhook,
+ );
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "empty";
- expect(model.status).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
});
- });
- describe(".recordingUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.recordingUrl).toBe(value);
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "empty";
+ expect(model.status).toBe(value);
+ });
});
- });
- describe(".recordingId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_recordingId";
- expect(model.recordingId).toBe(value);
+ describe(".recordingUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingUrl).toBe(value);
+ });
});
- });
- describe(".recordingDurationSec", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.recordingDurationSec).toBe(value);
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe(".recordingDurationSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.recordingDurationSec).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of ConferenceRecordingStatusWebhook", () => {
+ expect(
+ freeclimb.ConferenceRecordingStatusWebhook.deserialize(
+ '{ "requestType": "conferenceRecordingStatus"}',
+ ),
+ ).toBeInstanceOf(freeclimb.ConferenceRecordingStatusWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of ConferenceRecordingStatusWebhook", () => {
- expect(
- freeclimb.ConferenceRecordingStatusWebhook.deserialize(
- '{ "requestType": "conferenceRecordingStatus"}',
- ),
- ).toBeInstanceOf(freeclimb.ConferenceRecordingStatusWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.ConferenceRecordingStatusWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.ConferenceRecordingStatusWebhook =
+ new freeclimb.ConferenceRecordingStatusWebhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#status", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "status",
+ )?.defaultValue;
+ expect(model.status).toBe(value);
+ });
+ });
+ describe("#recordingUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingUrl",
+ )?.defaultValue;
+ expect(model.recordingUrl).toBe(value);
+ });
+ });
+ describe("#recordingId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingId",
+ )?.defaultValue;
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe("#recordingDurationSec", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingDurationSec",
+ )?.defaultValue;
+ expect(model.recordingDurationSec).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/ConferenceResult.spec.ts b/__tests__/models/ConferenceResult.spec.ts
index c23dd27..05fac0e 100644
--- a/__tests__/models/ConferenceResult.spec.ts
+++ b/__tests__/models/ConferenceResult.spec.ts
@@ -2,112 +2,319 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("ConferenceResult", () => {
- let model: freeclimb.ConferenceResult = new freeclimb.ConferenceResult({
- uri: "test_uri",
- dateCreated: "test_dateCreated",
- dateUpdated: "test_dateUpdated",
- revision: 1,
- conferenceId: "test_conferenceId",
- accountId: "test_accountId",
- alias: "test_alias",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.ConferenceResult;
+ let model: freeclimb.ConferenceResult = new freeclimb.ConferenceResult({
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ conferenceId: "test_conferenceId",
+ accountId: "test_accountId",
+ alias: "test_alias",
- playBeep: freeclimb.PlayBeep.ALWAYS,
- record: true,
+ playBeep: freeclimb.PlayBeep.ALWAYS,
+ record: true,
- status: freeclimb.ConferenceStatus.EMPTY,
- waitUrl: "https://123.abc",
- actionUrl: "https://123.abc",
- statusCallbackUrl: "https://123.abc",
- subresourceUris: {},
- });
- describe("ConferenceResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.ConferenceResult);
+ status: freeclimb.ConferenceStatus.EMPTY,
+ waitUrl: "https://123.abc",
+ actionUrl: "https://123.abc",
+ statusCallbackUrl: "https://123.abc",
+ subresourceUris: {},
});
- });
- describe(".uri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_uri";
- expect(model.uri).toBe(value);
+ describe("ConferenceResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ConferenceResult);
+ });
});
- });
- describe(".dateCreated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreated";
- expect(model.dateCreated).toBe(value);
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_uri";
+ expect(model.uri).toBe(value);
+ });
});
- });
- describe(".dateUpdated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdated";
- expect(model.dateUpdated).toBe(value);
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreated";
+ expect(model.dateCreated).toBe(value);
+ });
});
- });
- describe(".revision", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.revision).toBe(value);
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdated";
+ expect(model.dateUpdated).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.revision).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".alias", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_alias";
- expect(model.alias).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".playBeep", () => {
- it("resolves to particular value on initialization", () => {
- const value = "always";
- expect(model.playBeep).toBe(value);
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_alias";
+ expect(model.alias).toBe(value);
+ });
});
- });
- describe(".record", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.record).toBe(value);
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "always";
+ expect(model.playBeep).toBe(value);
+ });
});
- });
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "empty";
- expect(model.status).toBe(value);
+ describe(".record", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.record).toBe(value);
+ });
});
- });
- describe(".waitUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.waitUrl).toBe(value);
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "empty";
+ expect(model.status).toBe(value);
+ });
});
- });
- describe(".actionUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.actionUrl).toBe(value);
+ describe(".waitUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.waitUrl).toBe(value);
+ });
+ });
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.actionUrl).toBe(value);
+ });
+ });
+ describe(".statusCallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe(".subresourceUris", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = {};
+ const receivedValue: any = model.subresourceUris;
+ expect(receivedValue).toStrictEqual(value);
+ });
});
});
- describe(".statusCallbackUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.statusCallbackUrl).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.ConferenceResult;
+ let model: freeclimb.ConferenceResult = new freeclimb.ConferenceResult({
+ uri: "",
+ dateCreated: "",
+ dateUpdated: "",
+ revision: 0,
+ conferenceId: "",
+ accountId: "",
+ alias: "",
+
+ playBeep: freeclimb.PlayBeep.ALWAYS,
+ record: false,
+
+ status: freeclimb.ConferenceStatus.EMPTY,
+ waitUrl: "",
+ actionUrl: "",
+ statusCallbackUrl: "",
+ subresourceUris: {},
+ });
+ describe("ConferenceResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ConferenceResult);
+ });
+ });
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.revision).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "always";
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe(".record", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.record).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "empty";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".waitUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.waitUrl).toBe(value);
+ });
+ });
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.actionUrl).toBe(value);
+ });
+ });
+ describe(".statusCallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe(".subresourceUris", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = {};
+ const receivedValue: any = model.subresourceUris;
+ expect(receivedValue).toStrictEqual(value);
+ });
});
});
- describe(".subresourceUris", () => {
- it("resolves to particular value on initialization", () => {
- const value = {};
- const receivedValue: any = model.subresourceUris;
- expect(receivedValue).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.ConferenceResult;
+ let constructorArguments = {
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ };
+ let model: freeclimb.ConferenceResult = new freeclimb.ConferenceResult(
+ constructorArguments,
+ );
+
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#alias", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "alias",
+ )?.defaultValue;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe("#playBeep", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "playBeep",
+ )?.defaultValue;
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe("#record", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "record",
+ )?.defaultValue;
+ expect(model.record).toBe(value);
+ });
+ });
+ describe("#status", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "status",
+ )?.defaultValue;
+ expect(model.status).toBe(value);
+ });
+ });
+ describe("#waitUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "waitUrl",
+ )?.defaultValue;
+ expect(model.waitUrl).toBe(value);
+ });
+ });
+ describe("#actionUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "actionUrl",
+ )?.defaultValue;
+ expect(model.actionUrl).toBe(value);
+ });
+ });
+ describe("#statusCallbackUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "statusCallbackUrl",
+ )?.defaultValue;
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe("#subresourceUris", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "subresourceUris",
+ )?.defaultValue;
+ expect(model.subresourceUris).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/ConferenceStatus.spec.ts b/__tests__/models/ConferenceStatus.spec.ts
index 9d31700..af2d1b5 100644
--- a/__tests__/models/ConferenceStatus.spec.ts
+++ b/__tests__/models/ConferenceStatus.spec.ts
@@ -2,24 +2,26 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("ConferenceStatus", () => {
- describe(".EMPTY", () => {
- it("resolves to correct value for EMPTY enum property", () => {
- expect(freeclimb.ConferenceStatus.EMPTY).toBe("empty");
+ describe("Test with truthy values", () => {
+ describe(".EMPTY", () => {
+ it("resolves to correct value for EMPTY enum property", () => {
+ expect(freeclimb.ConferenceStatus.EMPTY).toBe("empty");
+ });
});
- });
- describe(".POPULATED", () => {
- it("resolves to correct value for POPULATED enum property", () => {
- expect(freeclimb.ConferenceStatus.POPULATED).toBe("populated");
+ describe(".POPULATED", () => {
+ it("resolves to correct value for POPULATED enum property", () => {
+ expect(freeclimb.ConferenceStatus.POPULATED).toBe("populated");
+ });
});
- });
- describe(".IN_PROGRESS", () => {
- it("resolves to correct value for IN_PROGRESS enum property", () => {
- expect(freeclimb.ConferenceStatus.IN_PROGRESS).toBe("inProgress");
+ describe(".IN_PROGRESS", () => {
+ it("resolves to correct value for IN_PROGRESS enum property", () => {
+ expect(freeclimb.ConferenceStatus.IN_PROGRESS).toBe("inProgress");
+ });
});
- });
- describe(".TERMINATED", () => {
- it("resolves to correct value for TERMINATED enum property", () => {
- expect(freeclimb.ConferenceStatus.TERMINATED).toBe("terminated");
+ describe(".TERMINATED", () => {
+ it("resolves to correct value for TERMINATED enum property", () => {
+ expect(freeclimb.ConferenceStatus.TERMINATED).toBe("terminated");
+ });
});
});
});
diff --git a/__tests__/models/ConferenceStatusWebhook.spec.ts b/__tests__/models/ConferenceStatusWebhook.spec.ts
index 92a96fe..61e3db2 100644
--- a/__tests__/models/ConferenceStatusWebhook.spec.ts
+++ b/__tests__/models/ConferenceStatusWebhook.spec.ts
@@ -2,116 +2,345 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("ConferenceStatusWebhook", () => {
- let model: freeclimb.ConferenceStatusWebhook =
- new freeclimb.ConferenceStatusWebhook({
- requestType: "test_requestType",
- callId: "test_callId",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.ConferenceStatusWebhook;
+ let model: freeclimb.ConferenceStatusWebhook =
+ new freeclimb.ConferenceStatusWebhook({
+ requestType: "test_requestType",
+ callId: "test_callId",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
- status: freeclimb.ConferenceStatus.EMPTY,
- recordingUrl: "https://123.abc",
- recordingId: "test_recordingId",
- recordingDurationSec: 1,
+ status: freeclimb.ConferenceStatus.EMPTY,
+ recordingUrl: "https://123.abc",
+ recordingId: "test_recordingId",
+ recordingDurationSec: 1,
+ });
+ describe("ConferenceStatusWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ConferenceStatusWebhook);
+ });
});
- describe("ConferenceStatusWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.ConferenceStatusWebhook);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "empty";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".recordingUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.recordingUrl).toBe(value);
+ });
+ });
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_recordingId";
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe(".recordingDurationSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.recordingDurationSec).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of ConferenceStatusWebhook", () => {
+ expect(
+ freeclimb.ConferenceStatusWebhook.deserialize(
+ '{ "requestType": "conferenceStatus"}',
+ ),
+ ).toBeInstanceOf(freeclimb.ConferenceStatusWebhook);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.ConferenceStatusWebhook;
+ let model: freeclimb.ConferenceStatusWebhook =
+ new freeclimb.ConferenceStatusWebhook({
+ requestType: "",
+ callId: "",
+ accountId: "",
+ from: "",
+ to: "",
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+
+ status: freeclimb.ConferenceStatus.EMPTY,
+ recordingUrl: "",
+ recordingId: "",
+ recordingDurationSec: 0,
+ });
+ describe("ConferenceStatusWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.ConferenceStatusWebhook);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "empty";
- expect(model.status).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
});
- });
- describe(".recordingUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.recordingUrl).toBe(value);
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "empty";
+ expect(model.status).toBe(value);
+ });
});
- });
- describe(".recordingId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_recordingId";
- expect(model.recordingId).toBe(value);
+ describe(".recordingUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingUrl).toBe(value);
+ });
});
- });
- describe(".recordingDurationSec", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.recordingDurationSec).toBe(value);
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe(".recordingDurationSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.recordingDurationSec).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of ConferenceStatusWebhook", () => {
+ expect(
+ freeclimb.ConferenceStatusWebhook.deserialize(
+ '{ "requestType": "conferenceStatus"}',
+ ),
+ ).toBeInstanceOf(freeclimb.ConferenceStatusWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of ConferenceStatusWebhook", () => {
- expect(
- freeclimb.ConferenceStatusWebhook.deserialize(
- '{ "requestType": "conferenceStatus"}',
- ),
- ).toBeInstanceOf(freeclimb.ConferenceStatusWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.ConferenceStatusWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.ConferenceStatusWebhook =
+ new freeclimb.ConferenceStatusWebhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#status", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "status",
+ )?.defaultValue;
+ expect(model.status).toBe(value);
+ });
+ });
+ describe("#recordingUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingUrl",
+ )?.defaultValue;
+ expect(model.recordingUrl).toBe(value);
+ });
+ });
+ describe("#recordingId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingId",
+ )?.defaultValue;
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe("#recordingDurationSec", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingDurationSec",
+ )?.defaultValue;
+ expect(model.recordingDurationSec).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/CreateConference.spec.ts b/__tests__/models/CreateConference.spec.ts
index 3e686f5..ebcb5c8 100644
--- a/__tests__/models/CreateConference.spec.ts
+++ b/__tests__/models/CreateConference.spec.ts
@@ -2,55 +2,167 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CreateConference", () => {
- let model: freeclimb.CreateConference = new freeclimb.CreateConference({
- actionUrl: "https://123.abc",
- alias: true,
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.CreateConference;
+ let model: freeclimb.CreateConference = new freeclimb.CreateConference({
+ actionUrl: "https://123.abc",
+ alias: true,
- playBeep: freeclimb.PlayBeep.ALWAYS,
- record: true,
- statusCallbackUrl: "https://123.abc",
- waitUrl: "https://123.abc",
- });
- describe("CreateConference class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.CreateConference);
+ playBeep: freeclimb.PlayBeep.ALWAYS,
+ record: true,
+ statusCallbackUrl: "https://123.abc",
+ waitUrl: "https://123.abc",
+ });
+ describe("CreateConference class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CreateConference);
+ });
});
- });
- describe(".actionUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.actionUrl).toBe(value);
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.actionUrl).toBe(value);
+ });
});
- });
- describe(".alias", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.alias).toBe(value);
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.alias).toBe(value);
+ });
});
- });
- describe(".playBeep", () => {
- it("resolves to particular value on initialization", () => {
- const value = "always";
- expect(model.playBeep).toBe(value);
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "always";
+ expect(model.playBeep).toBe(value);
+ });
});
- });
- describe(".record", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.record).toBe(value);
+ describe(".record", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.record).toBe(value);
+ });
+ });
+ describe(".statusCallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe(".waitUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.waitUrl).toBe(value);
+ });
});
});
- describe(".statusCallbackUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.statusCallbackUrl).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.CreateConference;
+ let model: freeclimb.CreateConference = new freeclimb.CreateConference({
+ actionUrl: "",
+ alias: false,
+
+ playBeep: freeclimb.PlayBeep.ALWAYS,
+ record: false,
+ statusCallbackUrl: "",
+ waitUrl: "",
+ });
+ describe("CreateConference class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CreateConference);
+ });
+ });
+
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.actionUrl).toBe(value);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "always";
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe(".record", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.record).toBe(value);
+ });
+ });
+ describe(".statusCallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe(".waitUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.waitUrl).toBe(value);
+ });
});
});
- describe(".waitUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.waitUrl).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.CreateConference;
+ let constructorArguments = {
+ actionUrl: "https://123.abc",
+ };
+ let model: freeclimb.CreateConference = new freeclimb.CreateConference(
+ constructorArguments,
+ );
+
+ describe("#actionUrl", () => {
+ it("resolves to initialization value", () => {
+ expect(model.actionUrl).toBe(constructorArguments["actionUrl"]);
+ });
+ });
+ describe("#alias", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "alias",
+ )?.defaultValue;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe("#playBeep", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "playBeep",
+ )?.defaultValue;
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe("#record", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "record",
+ )?.defaultValue;
+ expect(model.record).toBe(value);
+ });
+ });
+ describe("#statusCallbackUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "statusCallbackUrl",
+ )?.defaultValue;
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe("#waitUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "waitUrl",
+ )?.defaultValue;
+ expect(model.waitUrl).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/CreateConferenceRequest.spec.ts b/__tests__/models/CreateConferenceRequest.spec.ts
index aabd512..52b27bf 100644
--- a/__tests__/models/CreateConferenceRequest.spec.ts
+++ b/__tests__/models/CreateConferenceRequest.spec.ts
@@ -2,48 +2,146 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CreateConferenceRequest", () => {
- let model: freeclimb.CreateConferenceRequest =
- new freeclimb.CreateConferenceRequest({
- alias: "test_alias",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.CreateConferenceRequest;
+ let model: freeclimb.CreateConferenceRequest =
+ new freeclimb.CreateConferenceRequest({
+ alias: "test_alias",
- playBeep: freeclimb.PlayBeep.ALWAYS,
- record: true,
- waitUrl: "https://123.abc",
- statusCallbackUrl: "https://123.abc",
+ playBeep: freeclimb.PlayBeep.ALWAYS,
+ record: true,
+ waitUrl: "https://123.abc",
+ statusCallbackUrl: "https://123.abc",
+ });
+ describe("CreateConferenceRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CreateConferenceRequest);
+ });
});
- describe("CreateConferenceRequest class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.CreateConferenceRequest);
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_alias";
+ expect(model.alias).toBe(value);
+ });
});
- });
- describe(".alias", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_alias";
- expect(model.alias).toBe(value);
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "always";
+ expect(model.playBeep).toBe(value);
+ });
});
- });
- describe(".playBeep", () => {
- it("resolves to particular value on initialization", () => {
- const value = "always";
- expect(model.playBeep).toBe(value);
+ describe(".record", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.record).toBe(value);
+ });
});
- });
- describe(".record", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.record).toBe(value);
+ describe(".waitUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.waitUrl).toBe(value);
+ });
+ });
+ describe(".statusCallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.statusCallbackUrl).toBe(value);
+ });
});
});
- describe(".waitUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.waitUrl).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.CreateConferenceRequest;
+ let model: freeclimb.CreateConferenceRequest =
+ new freeclimb.CreateConferenceRequest({
+ alias: "",
+
+ playBeep: freeclimb.PlayBeep.ALWAYS,
+ record: false,
+ waitUrl: "",
+ statusCallbackUrl: "",
+ });
+ describe("CreateConferenceRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CreateConferenceRequest);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "always";
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe(".record", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.record).toBe(value);
+ });
+ });
+ describe(".waitUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.waitUrl).toBe(value);
+ });
+ });
+ describe(".statusCallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.statusCallbackUrl).toBe(value);
+ });
});
});
- describe(".statusCallbackUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.statusCallbackUrl).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.CreateConferenceRequest;
+ let constructorArguments = {
+ statusCallbackUrl: "https://123.abc",
+ };
+ let model: freeclimb.CreateConferenceRequest =
+ new freeclimb.CreateConferenceRequest(constructorArguments);
+
+ describe("#alias", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "alias",
+ )?.defaultValue;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe("#playBeep", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "playBeep",
+ )?.defaultValue;
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe("#record", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "record",
+ )?.defaultValue;
+ expect(model.record).toBe(value);
+ });
+ });
+ describe("#waitUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "waitUrl",
+ )?.defaultValue;
+ expect(model.waitUrl).toBe(value);
+ });
+ });
+ describe("#statusCallbackUrl", () => {
+ it("resolves to initialization value", () => {
+ expect(model.statusCallbackUrl).toBe(
+ constructorArguments["statusCallbackUrl"],
+ );
+ });
});
});
});
diff --git a/__tests__/models/CreateConferenceWebhook.spec.ts b/__tests__/models/CreateConferenceWebhook.spec.ts
index 573e7c1..bcd798d 100644
--- a/__tests__/models/CreateConferenceWebhook.spec.ts
+++ b/__tests__/models/CreateConferenceWebhook.spec.ts
@@ -2,116 +2,345 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CreateConferenceWebhook", () => {
- let model: freeclimb.CreateConferenceWebhook =
- new freeclimb.CreateConferenceWebhook({
- requestType: "test_requestType",
- callId: "test_callId",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.CreateConferenceWebhook;
+ let model: freeclimb.CreateConferenceWebhook =
+ new freeclimb.CreateConferenceWebhook({
+ requestType: "test_requestType",
+ callId: "test_callId",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
- status: freeclimb.ConferenceStatus.EMPTY,
- recordingUrl: "https://123.abc",
- recordingId: "test_recordingId",
- recordingDurationSec: 1,
+ status: freeclimb.ConferenceStatus.EMPTY,
+ recordingUrl: "https://123.abc",
+ recordingId: "test_recordingId",
+ recordingDurationSec: 1,
+ });
+ describe("CreateConferenceWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CreateConferenceWebhook);
+ });
});
- describe("CreateConferenceWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.CreateConferenceWebhook);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "empty";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".recordingUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.recordingUrl).toBe(value);
+ });
+ });
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_recordingId";
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe(".recordingDurationSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.recordingDurationSec).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of CreateConferenceWebhook", () => {
+ expect(
+ freeclimb.CreateConferenceWebhook.deserialize(
+ '{ "requestType": "createConference"}',
+ ),
+ ).toBeInstanceOf(freeclimb.CreateConferenceWebhook);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.CreateConferenceWebhook;
+ let model: freeclimb.CreateConferenceWebhook =
+ new freeclimb.CreateConferenceWebhook({
+ requestType: "",
+ callId: "",
+ accountId: "",
+ from: "",
+ to: "",
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+
+ status: freeclimb.ConferenceStatus.EMPTY,
+ recordingUrl: "",
+ recordingId: "",
+ recordingDurationSec: 0,
+ });
+ describe("CreateConferenceWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CreateConferenceWebhook);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "empty";
- expect(model.status).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
});
- });
- describe(".recordingUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.recordingUrl).toBe(value);
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "empty";
+ expect(model.status).toBe(value);
+ });
});
- });
- describe(".recordingId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_recordingId";
- expect(model.recordingId).toBe(value);
+ describe(".recordingUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingUrl).toBe(value);
+ });
});
- });
- describe(".recordingDurationSec", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.recordingDurationSec).toBe(value);
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe(".recordingDurationSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.recordingDurationSec).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of CreateConferenceWebhook", () => {
+ expect(
+ freeclimb.CreateConferenceWebhook.deserialize(
+ '{ "requestType": "createConference"}',
+ ),
+ ).toBeInstanceOf(freeclimb.CreateConferenceWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of CreateConferenceWebhook", () => {
- expect(
- freeclimb.CreateConferenceWebhook.deserialize(
- '{ "requestType": "createConference"}',
- ),
- ).toBeInstanceOf(freeclimb.CreateConferenceWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.CreateConferenceWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.CreateConferenceWebhook =
+ new freeclimb.CreateConferenceWebhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#status", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "status",
+ )?.defaultValue;
+ expect(model.status).toBe(value);
+ });
+ });
+ describe("#recordingUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingUrl",
+ )?.defaultValue;
+ expect(model.recordingUrl).toBe(value);
+ });
+ });
+ describe("#recordingId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingId",
+ )?.defaultValue;
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe("#recordingDurationSec", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingDurationSec",
+ )?.defaultValue;
+ expect(model.recordingDurationSec).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/CreateWebRTCToken.spec.ts b/__tests__/models/CreateWebRTCToken.spec.ts
index 74e8e2a..915d31e 100644
--- a/__tests__/models/CreateWebRTCToken.spec.ts
+++ b/__tests__/models/CreateWebRTCToken.spec.ts
@@ -2,32 +2,93 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("CreateWebRTCToken", () => {
- let model: freeclimb.CreateWebRTCToken = new freeclimb.CreateWebRTCToken({
- to: "test_to",
- from: "test_from",
- uses: 1,
- });
- describe("CreateWebRTCToken class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.CreateWebRTCToken);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.CreateWebRTCToken;
+ let model: freeclimb.CreateWebRTCToken = new freeclimb.CreateWebRTCToken({
+ to: "test_to",
+ from: "test_from",
+ uses: 1,
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe("CreateWebRTCToken class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CreateWebRTCToken);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".uses", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.uses).toBe(value);
+ });
});
});
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.CreateWebRTCToken;
+ let model: freeclimb.CreateWebRTCToken = new freeclimb.CreateWebRTCToken({
+ to: "",
+ from: "",
+ uses: 0,
+ });
+ describe("CreateWebRTCToken class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.CreateWebRTCToken);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".uses", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.uses).toBe(value);
+ });
});
});
- describe(".uses", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.uses).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.CreateWebRTCToken;
+ let constructorArguments = {
+ to: "test_to",
+ from: "test_from",
+ uses: 1,
+ };
+ let model: freeclimb.CreateWebRTCToken = new freeclimb.CreateWebRTCToken(
+ constructorArguments,
+ );
+
+ describe("#to", () => {
+ it("resolves to initialization value", () => {
+ expect(model.to).toBe(constructorArguments["to"]);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to initialization value", () => {
+ expect(model.from).toBe(constructorArguments["from"]);
+ });
+ });
+ describe("#uses", () => {
+ it("resolves to initialization value", () => {
+ expect(model.uses).toBe(constructorArguments["uses"]);
+ });
});
});
});
diff --git a/__tests__/models/Dequeue.spec.ts b/__tests__/models/Dequeue.spec.ts
index 4a2e5eb..226c213 100644
--- a/__tests__/models/Dequeue.spec.ts
+++ b/__tests__/models/Dequeue.spec.ts
@@ -2,10 +2,27 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Dequeue", () => {
- let model: freeclimb.Dequeue = new freeclimb.Dequeue({});
- describe("Dequeue class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.Dequeue);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.Dequeue;
+ let model: freeclimb.Dequeue = new freeclimb.Dequeue({});
+ describe("Dequeue class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Dequeue);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.Dequeue;
+ let model: freeclimb.Dequeue = new freeclimb.Dequeue({});
+ describe("Dequeue class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Dequeue);
+ });
+ });
+ });
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.Dequeue;
+ let constructorArguments = {};
+ let model: freeclimb.Dequeue = new freeclimb.Dequeue(constructorArguments);
+ });
});
diff --git a/__tests__/models/DequeueWebhook.spec.ts b/__tests__/models/DequeueWebhook.spec.ts
index ef3fd86..bed2389 100644
--- a/__tests__/models/DequeueWebhook.spec.ts
+++ b/__tests__/models/DequeueWebhook.spec.ts
@@ -2,98 +2,294 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("DequeueWebhook", () => {
- let model: freeclimb.DequeueWebhook = new freeclimb.DequeueWebhook({
- requestType: "test_requestType",
- callId: "test_callId",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.DequeueWebhook;
+ let model: freeclimb.DequeueWebhook = new freeclimb.DequeueWebhook({
+ requestType: "test_requestType",
+ callId: "test_callId",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
- queueResult: "test_queueResult",
- queueTime: 1,
- });
- describe("DequeueWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.DequeueWebhook);
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
+ queueResult: "test_queueResult",
+ queueTime: 1,
+ });
+ describe("DequeueWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.DequeueWebhook);
+ });
});
- });
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
});
- });
- describe(".queueResult", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueResult";
- expect(model.queueResult).toBe(value);
+ describe(".queueResult", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueResult";
+ expect(model.queueResult).toBe(value);
+ });
+ });
+ describe(".queueTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.queueTime).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of DequeueWebhook", () => {
+ expect(
+ freeclimb.DequeueWebhook.deserialize('{ "requestType": "dequeue"}'),
+ ).toBeInstanceOf(freeclimb.DequeueWebhook);
+ });
});
});
- describe(".queueTime", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.queueTime).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.DequeueWebhook;
+ let model: freeclimb.DequeueWebhook = new freeclimb.DequeueWebhook({
+ requestType: "",
+ callId: "",
+ accountId: "",
+ from: "",
+ to: "",
+
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+ queueResult: "",
+ queueTime: 0,
+ });
+ describe("DequeueWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.DequeueWebhook);
+ });
+ });
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".queueResult", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueResult).toBe(value);
+ });
+ });
+ describe(".queueTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.queueTime).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of DequeueWebhook", () => {
+ expect(
+ freeclimb.DequeueWebhook.deserialize('{ "requestType": "dequeue"}'),
+ ).toBeInstanceOf(freeclimb.DequeueWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of DequeueWebhook", () => {
- expect(
- freeclimb.DequeueWebhook.deserialize('{ "requestType": "dequeue"}'),
- ).toBeInstanceOf(freeclimb.DequeueWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.DequeueWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.DequeueWebhook = new freeclimb.DequeueWebhook(
+ constructorArguments,
+ );
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#queueResult", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueResult",
+ )?.defaultValue;
+ expect(model.queueResult).toBe(value);
+ });
+ });
+ describe("#queueTime", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueTime",
+ )?.defaultValue;
+ expect(model.queueTime).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/Enqueue.spec.ts b/__tests__/models/Enqueue.spec.ts
index c07b61b..c5f95f1 100644
--- a/__tests__/models/Enqueue.spec.ts
+++ b/__tests__/models/Enqueue.spec.ts
@@ -2,40 +2,115 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Enqueue", () => {
- let model: freeclimb.Enqueue = new freeclimb.Enqueue({
- actionUrl: "https://123.abc",
- notificationUrl: "https://123.abc",
- queueId: "test_queueId",
- waitUrl: "https://123.abc",
- });
- describe("Enqueue class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.Enqueue);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.Enqueue;
+ let model: freeclimb.Enqueue = new freeclimb.Enqueue({
+ actionUrl: "https://123.abc",
+ notificationUrl: "https://123.abc",
+ queueId: "test_queueId",
+ waitUrl: "https://123.abc",
+ });
+ describe("Enqueue class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Enqueue);
+ });
});
- });
- describe(".actionUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.actionUrl).toBe(value);
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.actionUrl).toBe(value);
+ });
});
- });
- describe(".notificationUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.notificationUrl).toBe(value);
+ describe(".notificationUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.notificationUrl).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".waitUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.waitUrl).toBe(value);
+ });
});
});
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.Enqueue;
+ let model: freeclimb.Enqueue = new freeclimb.Enqueue({
+ actionUrl: "",
+ notificationUrl: "",
+ queueId: "",
+ waitUrl: "",
+ });
+ describe("Enqueue class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Enqueue);
+ });
+ });
+
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.actionUrl).toBe(value);
+ });
+ });
+ describe(".notificationUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.notificationUrl).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".waitUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.waitUrl).toBe(value);
+ });
});
});
- describe(".waitUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.waitUrl).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.Enqueue;
+ let constructorArguments = {
+ actionUrl: "https://123.abc",
+ queueId: "test_queueId",
+ waitUrl: "https://123.abc",
+ };
+ let model: freeclimb.Enqueue = new freeclimb.Enqueue(constructorArguments);
+
+ describe("#actionUrl", () => {
+ it("resolves to initialization value", () => {
+ expect(model.actionUrl).toBe(constructorArguments["actionUrl"]);
+ });
+ });
+ describe("#notificationUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "notificationUrl",
+ )?.defaultValue;
+ expect(model.notificationUrl).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to initialization value", () => {
+ expect(model.queueId).toBe(constructorArguments["queueId"]);
+ });
+ });
+ describe("#waitUrl", () => {
+ it("resolves to initialization value", () => {
+ expect(model.waitUrl).toBe(constructorArguments["waitUrl"]);
+ });
});
});
});
diff --git a/__tests__/models/FilterLogsRequest.spec.ts b/__tests__/models/FilterLogsRequest.spec.ts
index 760adad..dd7f8a6 100644
--- a/__tests__/models/FilterLogsRequest.spec.ts
+++ b/__tests__/models/FilterLogsRequest.spec.ts
@@ -2,18 +2,53 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("FilterLogsRequest", () => {
- let model: freeclimb.FilterLogsRequest = new freeclimb.FilterLogsRequest({
- pql: "test_pql",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.FilterLogsRequest;
+ let model: freeclimb.FilterLogsRequest = new freeclimb.FilterLogsRequest({
+ pql: "test_pql",
+ });
+ describe("FilterLogsRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.FilterLogsRequest);
+ });
+ });
+ describe(".pql", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_pql";
+ expect(model.pql).toBe(value);
+ });
+ });
});
- describe("FilterLogsRequest class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.FilterLogsRequest);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.FilterLogsRequest;
+ let model: freeclimb.FilterLogsRequest = new freeclimb.FilterLogsRequest({
+ pql: "",
+ });
+ describe("FilterLogsRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.FilterLogsRequest);
+ });
+ });
+ describe(".pql", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.pql).toBe(value);
+ });
});
});
- describe(".pql", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_pql";
- expect(model.pql).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.FilterLogsRequest;
+ let constructorArguments = {
+ pql: "test_pql",
+ };
+ let model: freeclimb.FilterLogsRequest = new freeclimb.FilterLogsRequest(
+ constructorArguments,
+ );
+
+ describe("#pql", () => {
+ it("resolves to initialization value", () => {
+ expect(model.pql).toBe(constructorArguments["pql"]);
+ });
});
});
});
diff --git a/__tests__/models/GetDigits.spec.ts b/__tests__/models/GetDigits.spec.ts
index 836dad2..d2938fb 100644
--- a/__tests__/models/GetDigits.spec.ts
+++ b/__tests__/models/GetDigits.spec.ts
@@ -2,75 +2,231 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("GetDigits", () => {
- let model: freeclimb.GetDigits = new freeclimb.GetDigits({
- actionUrl: "https://123.abc",
- digitTimeoutMs: 1,
- finishOnKey: "test_finishOnKey",
- flushBuffer: true,
- initialTimeoutMs: 1,
- maxDigits: 1,
- minDigits: 1,
- prompts: [],
- privacyMode: true,
- });
- describe("GetDigits class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.GetDigits);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.GetDigits;
+ let model: freeclimb.GetDigits = new freeclimb.GetDigits({
+ actionUrl: "https://123.abc",
+ digitTimeoutMs: 1,
+ finishOnKey: "test_finishOnKey",
+ flushBuffer: true,
+ initialTimeoutMs: 1,
+ maxDigits: 1,
+ minDigits: 1,
+ prompts: [],
+ privacyMode: true,
+ });
+ describe("GetDigits class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.GetDigits);
+ });
});
- });
- describe(".actionUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.actionUrl).toBe(value);
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.actionUrl).toBe(value);
+ });
});
- });
- describe(".digitTimeoutMs", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.digitTimeoutMs).toBe(value);
+ describe(".digitTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.digitTimeoutMs).toBe(value);
+ });
});
- });
- describe(".finishOnKey", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_finishOnKey";
- expect(model.finishOnKey).toBe(value);
+ describe(".finishOnKey", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_finishOnKey";
+ expect(model.finishOnKey).toBe(value);
+ });
});
- });
- describe(".flushBuffer", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.flushBuffer).toBe(value);
+ describe(".flushBuffer", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.flushBuffer).toBe(value);
+ });
});
- });
- describe(".initialTimeoutMs", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.initialTimeoutMs).toBe(value);
+ describe(".initialTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.initialTimeoutMs).toBe(value);
+ });
});
- });
- describe(".maxDigits", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.maxDigits).toBe(value);
+ describe(".maxDigits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.maxDigits).toBe(value);
+ });
});
- });
- describe(".minDigits", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.minDigits).toBe(value);
+ describe(".minDigits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.minDigits).toBe(value);
+ });
+ });
+ describe(".prompts", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.PerclCommand[] = [];
+ expect(model.prompts).toStrictEqual(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".prompts", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.PerclCommand[] = [];
- expect(model.prompts).toStrictEqual(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.GetDigits;
+ let model: freeclimb.GetDigits = new freeclimb.GetDigits({
+ actionUrl: "",
+ digitTimeoutMs: 0,
+ finishOnKey: "",
+ flushBuffer: false,
+ initialTimeoutMs: 0,
+ maxDigits: 0,
+ minDigits: 0,
+ prompts: [],
+ privacyMode: false,
+ });
+ describe("GetDigits class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.GetDigits);
+ });
+ });
+
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.actionUrl).toBe(value);
+ });
+ });
+ describe(".digitTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.digitTimeoutMs).toBe(value);
+ });
+ });
+ describe(".finishOnKey", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.finishOnKey).toBe(value);
+ });
+ });
+ describe(".flushBuffer", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.flushBuffer).toBe(value);
+ });
+ });
+ describe(".initialTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.initialTimeoutMs).toBe(value);
+ });
+ });
+ describe(".maxDigits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.maxDigits).toBe(value);
+ });
+ });
+ describe(".minDigits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.minDigits).toBe(value);
+ });
+ });
+ describe(".prompts", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.PerclCommand[] = [];
+ expect(model.prompts).toStrictEqual(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".privacyMode", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.privacyMode).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.GetDigits;
+ let constructorArguments = {
+ actionUrl: "https://123.abc",
+ };
+ let model: freeclimb.GetDigits = new freeclimb.GetDigits(
+ constructorArguments,
+ );
+
+ describe("#actionUrl", () => {
+ it("resolves to initialization value", () => {
+ expect(model.actionUrl).toBe(constructorArguments["actionUrl"]);
+ });
+ });
+ describe("#digitTimeoutMs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "digitTimeoutMs",
+ )?.defaultValue;
+ expect(model.digitTimeoutMs).toBe(value);
+ });
+ });
+ describe("#finishOnKey", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "finishOnKey",
+ )?.defaultValue;
+ expect(model.finishOnKey).toBe(value);
+ });
+ });
+ describe("#flushBuffer", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "flushBuffer",
+ )?.defaultValue;
+ expect(model.flushBuffer).toBe(value);
+ });
+ });
+ describe("#initialTimeoutMs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "initialTimeoutMs",
+ )?.defaultValue;
+ expect(model.initialTimeoutMs).toBe(value);
+ });
+ });
+ describe("#maxDigits", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "maxDigits",
+ )?.defaultValue;
+ expect(model.maxDigits).toBe(value);
+ });
+ });
+ describe("#minDigits", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "minDigits",
+ )?.defaultValue;
+ expect(model.minDigits).toBe(value);
+ });
+ });
+ describe("#prompts", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "prompts",
+ )?.defaultValue;
+ expect(model.prompts).toBe(value);
+ });
+ });
+ describe("#privacyMode", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "privacyMode",
+ )?.defaultValue;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/GetDigitsReason.spec.ts b/__tests__/models/GetDigitsReason.spec.ts
index 5594640..18b2b58 100644
--- a/__tests__/models/GetDigitsReason.spec.ts
+++ b/__tests__/models/GetDigitsReason.spec.ts
@@ -2,24 +2,26 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("GetDigitsReason", () => {
- describe(".FINISH_KEY", () => {
- it("resolves to correct value for FINISH_KEY enum property", () => {
- expect(freeclimb.GetDigitsReason.FINISH_KEY).toBe("finishKey");
+ describe("Test with truthy values", () => {
+ describe(".FINISH_KEY", () => {
+ it("resolves to correct value for FINISH_KEY enum property", () => {
+ expect(freeclimb.GetDigitsReason.FINISH_KEY).toBe("finishKey");
+ });
});
- });
- describe(".TIMEOUT", () => {
- it("resolves to correct value for TIMEOUT enum property", () => {
- expect(freeclimb.GetDigitsReason.TIMEOUT).toBe("timeout");
+ describe(".TIMEOUT", () => {
+ it("resolves to correct value for TIMEOUT enum property", () => {
+ expect(freeclimb.GetDigitsReason.TIMEOUT).toBe("timeout");
+ });
});
- });
- describe(".MAX_DIGITS", () => {
- it("resolves to correct value for MAX_DIGITS enum property", () => {
- expect(freeclimb.GetDigitsReason.MAX_DIGITS).toBe("maxDigits");
+ describe(".MAX_DIGITS", () => {
+ it("resolves to correct value for MAX_DIGITS enum property", () => {
+ expect(freeclimb.GetDigitsReason.MAX_DIGITS).toBe("maxDigits");
+ });
});
- });
- describe(".TONE", () => {
- it("resolves to correct value for TONE enum property", () => {
- expect(freeclimb.GetDigitsReason.TONE).toBe("tone");
+ describe(".TONE", () => {
+ it("resolves to correct value for TONE enum property", () => {
+ expect(freeclimb.GetDigitsReason.TONE).toBe("tone");
+ });
});
});
});
diff --git a/__tests__/models/GetDigitsWebhook.spec.ts b/__tests__/models/GetDigitsWebhook.spec.ts
index 6796df9..ddb2d44 100644
--- a/__tests__/models/GetDigitsWebhook.spec.ts
+++ b/__tests__/models/GetDigitsWebhook.spec.ts
@@ -2,106 +2,322 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("GetDigitsWebhook", () => {
- let model: freeclimb.GetDigitsWebhook = new freeclimb.GetDigitsWebhook({
- requestType: "test_requestType",
- callId: "test_callId",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.GetDigitsWebhook;
+ let model: freeclimb.GetDigitsWebhook = new freeclimb.GetDigitsWebhook({
+ requestType: "test_requestType",
+ callId: "test_callId",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
- digits: "test_digits",
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
+ digits: "test_digits",
- reason: freeclimb.GetDigitsReason.FINISH_KEY,
- parentCallId: "test_parentCallId",
- });
- describe("GetDigitsWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.GetDigitsWebhook);
+ reason: freeclimb.GetDigitsReason.FINISH_KEY,
+ parentCallId: "test_parentCallId",
+ });
+ describe("GetDigitsWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.GetDigitsWebhook);
+ });
});
- });
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
});
- });
- describe(".digits", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_digits";
- expect(model.digits).toBe(value);
+ describe(".digits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_digits";
+ expect(model.digits).toBe(value);
+ });
});
- });
- describe(".reason", () => {
- it("resolves to particular value on initialization", () => {
- const value = "finishKey";
- expect(model.reason).toBe(value);
+ describe(".reason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "finishKey";
+ expect(model.reason).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_parentCallId";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of GetDigitsWebhook", () => {
+ expect(
+ freeclimb.GetDigitsWebhook.deserialize(
+ '{ "requestType": "getDigits"}',
+ ),
+ ).toBeInstanceOf(freeclimb.GetDigitsWebhook);
+ });
});
});
- describe(".parentCallId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_parentCallId";
- expect(model.parentCallId).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.GetDigitsWebhook;
+ let model: freeclimb.GetDigitsWebhook = new freeclimb.GetDigitsWebhook({
+ requestType: "",
+ callId: "",
+ accountId: "",
+ from: "",
+ to: "",
+
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+ digits: "",
+
+ reason: freeclimb.GetDigitsReason.FINISH_KEY,
+ parentCallId: "",
+ });
+ describe("GetDigitsWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.GetDigitsWebhook);
+ });
+ });
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".digits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.digits).toBe(value);
+ });
+ });
+ describe(".reason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "finishKey";
+ expect(model.reason).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of GetDigitsWebhook", () => {
+ expect(
+ freeclimb.GetDigitsWebhook.deserialize(
+ '{ "requestType": "getDigits"}',
+ ),
+ ).toBeInstanceOf(freeclimb.GetDigitsWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of GetDigitsWebhook", () => {
- expect(
- freeclimb.GetDigitsWebhook.deserialize('{ "requestType": "getDigits"}'),
- ).toBeInstanceOf(freeclimb.GetDigitsWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.GetDigitsWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.GetDigitsWebhook = new freeclimb.GetDigitsWebhook(
+ constructorArguments,
+ );
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#digits", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "digits",
+ )?.defaultValue;
+ expect(model.digits).toBe(value);
+ });
+ });
+ describe("#reason", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "reason",
+ )?.defaultValue;
+ expect(model.reason).toBe(value);
+ });
+ });
+ describe("#parentCallId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "parentCallId",
+ )?.defaultValue;
+ expect(model.parentCallId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/GetSpeech.spec.ts b/__tests__/models/GetSpeech.spec.ts
index 66a362f..18e9443 100644
--- a/__tests__/models/GetSpeech.spec.ts
+++ b/__tests__/models/GetSpeech.spec.ts
@@ -2,104 +2,319 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("GetSpeech", () => {
- let model: freeclimb.GetSpeech = new freeclimb.GetSpeech({
- actionUrl: "https://123.abc",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.GetSpeech;
+ let model: freeclimb.GetSpeech = new freeclimb.GetSpeech({
+ actionUrl: "https://123.abc",
- grammarType: freeclimb.GrammarType.URL,
- grammarFile: "test_grammarFile",
- grammarRule: "test_grammarRule",
- playBeep: true,
- prompts: [],
- noInputTimeoutMs: 1,
- recognitionTimeoutMs: 1,
- confidenceThreshold: 1.0,
- sensitivityLevel: 1.0,
- speechCompleteTimeoutMs: 1,
- speechIncompleteTimeoutMs: 1,
- privacyMode: true,
- });
- describe("GetSpeech class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.GetSpeech);
+ grammarType: freeclimb.GrammarType.URL,
+ grammarFile: "test_grammarFile",
+ grammarRule: "test_grammarRule",
+ playBeep: true,
+ prompts: [],
+ noInputTimeoutMs: 1,
+ recognitionTimeoutMs: 1,
+ confidenceThreshold: 1.0,
+ sensitivityLevel: 1.0,
+ speechCompleteTimeoutMs: 1,
+ speechIncompleteTimeoutMs: 1,
+ privacyMode: true,
+ });
+ describe("GetSpeech class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.GetSpeech);
+ });
});
- });
- describe(".actionUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.actionUrl).toBe(value);
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.actionUrl).toBe(value);
+ });
});
- });
- describe(".grammarType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "URL";
- expect(model.grammarType).toBe(value);
+ describe(".grammarType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "URL";
+ expect(model.grammarType).toBe(value);
+ });
});
- });
- describe(".grammarFile", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_grammarFile";
- expect(model.grammarFile).toBe(value);
+ describe(".grammarFile", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_grammarFile";
+ expect(model.grammarFile).toBe(value);
+ });
});
- });
- describe(".grammarRule", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_grammarRule";
- expect(model.grammarRule).toBe(value);
+ describe(".grammarRule", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_grammarRule";
+ expect(model.grammarRule).toBe(value);
+ });
});
- });
- describe(".playBeep", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.playBeep).toBe(value);
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.playBeep).toBe(value);
+ });
});
- });
- describe(".prompts", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.PerclCommand[] = [];
- expect(model.prompts).toStrictEqual(value);
+ describe(".prompts", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.PerclCommand[] = [];
+ expect(model.prompts).toStrictEqual(value);
+ });
});
- });
- describe(".noInputTimeoutMs", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.noInputTimeoutMs).toBe(value);
+ describe(".noInputTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.noInputTimeoutMs).toBe(value);
+ });
});
- });
- describe(".recognitionTimeoutMs", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.recognitionTimeoutMs).toBe(value);
+ describe(".recognitionTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.recognitionTimeoutMs).toBe(value);
+ });
});
- });
- describe(".confidenceThreshold", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1.0;
- expect(model.confidenceThreshold).toBe(value);
+ describe(".confidenceThreshold", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1.0;
+ expect(model.confidenceThreshold).toBe(value);
+ });
});
- });
- describe(".sensitivityLevel", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1.0;
- expect(model.sensitivityLevel).toBe(value);
+ describe(".sensitivityLevel", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1.0;
+ expect(model.sensitivityLevel).toBe(value);
+ });
});
- });
- describe(".speechCompleteTimeoutMs", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.speechCompleteTimeoutMs).toBe(value);
+ describe(".speechCompleteTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.speechCompleteTimeoutMs).toBe(value);
+ });
+ });
+ describe(".speechIncompleteTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.speechIncompleteTimeoutMs).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".speechIncompleteTimeoutMs", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.speechIncompleteTimeoutMs).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.GetSpeech;
+ let model: freeclimb.GetSpeech = new freeclimb.GetSpeech({
+ actionUrl: "",
+
+ grammarType: freeclimb.GrammarType.URL,
+ grammarFile: "",
+ grammarRule: "",
+ playBeep: false,
+ prompts: [],
+ noInputTimeoutMs: 0,
+ recognitionTimeoutMs: 0,
+ confidenceThreshold: 0.0,
+ sensitivityLevel: 0.0,
+ speechCompleteTimeoutMs: 0,
+ speechIncompleteTimeoutMs: 0,
+ privacyMode: false,
+ });
+ describe("GetSpeech class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.GetSpeech);
+ });
+ });
+
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.actionUrl).toBe(value);
+ });
+ });
+ describe(".grammarType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "URL";
+ expect(model.grammarType).toBe(value);
+ });
+ });
+ describe(".grammarFile", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.grammarFile).toBe(value);
+ });
+ });
+ describe(".grammarRule", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.grammarRule).toBe(value);
+ });
+ });
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe(".prompts", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.PerclCommand[] = [];
+ expect(model.prompts).toStrictEqual(value);
+ });
+ });
+ describe(".noInputTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.noInputTimeoutMs).toBe(value);
+ });
+ });
+ describe(".recognitionTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.recognitionTimeoutMs).toBe(value);
+ });
+ });
+ describe(".confidenceThreshold", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0.0;
+ expect(model.confidenceThreshold).toBe(value);
+ });
+ });
+ describe(".sensitivityLevel", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0.0;
+ expect(model.sensitivityLevel).toBe(value);
+ });
+ });
+ describe(".speechCompleteTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.speechCompleteTimeoutMs).toBe(value);
+ });
+ });
+ describe(".speechIncompleteTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.speechIncompleteTimeoutMs).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".privacyMode", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.privacyMode).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.GetSpeech;
+ let constructorArguments = {
+ actionUrl: "https://123.abc",
+ grammarFile: "test_grammarFile",
+ };
+ let model: freeclimb.GetSpeech = new freeclimb.GetSpeech(
+ constructorArguments,
+ );
+
+ describe("#actionUrl", () => {
+ it("resolves to initialization value", () => {
+ expect(model.actionUrl).toBe(constructorArguments["actionUrl"]);
+ });
+ });
+ describe("#grammarType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "grammarType",
+ )?.defaultValue;
+ expect(model.grammarType).toBe(value);
+ });
+ });
+ describe("#grammarFile", () => {
+ it("resolves to initialization value", () => {
+ expect(model.grammarFile).toBe(constructorArguments["grammarFile"]);
+ });
+ });
+ describe("#grammarRule", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "grammarRule",
+ )?.defaultValue;
+ expect(model.grammarRule).toBe(value);
+ });
+ });
+ describe("#playBeep", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "playBeep",
+ )?.defaultValue;
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe("#prompts", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "prompts",
+ )?.defaultValue;
+ expect(model.prompts).toBe(value);
+ });
+ });
+ describe("#noInputTimeoutMs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "noInputTimeoutMs",
+ )?.defaultValue;
+ expect(model.noInputTimeoutMs).toBe(value);
+ });
+ });
+ describe("#recognitionTimeoutMs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recognitionTimeoutMs",
+ )?.defaultValue;
+ expect(model.recognitionTimeoutMs).toBe(value);
+ });
+ });
+ describe("#confidenceThreshold", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "confidenceThreshold",
+ )?.defaultValue;
+ expect(model.confidenceThreshold).toBe(value);
+ });
+ });
+ describe("#sensitivityLevel", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "sensitivityLevel",
+ )?.defaultValue;
+ expect(model.sensitivityLevel).toBe(value);
+ });
+ });
+ describe("#speechCompleteTimeoutMs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "speechCompleteTimeoutMs",
+ )?.defaultValue;
+ expect(model.speechCompleteTimeoutMs).toBe(value);
+ });
+ });
+ describe("#speechIncompleteTimeoutMs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "speechIncompleteTimeoutMs",
+ )?.defaultValue;
+ expect(model.speechIncompleteTimeoutMs).toBe(value);
+ });
+ });
+ describe("#privacyMode", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "privacyMode",
+ )?.defaultValue;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/GetSpeechReason.spec.ts b/__tests__/models/GetSpeechReason.spec.ts
index 8aa73ec..977e24a 100644
--- a/__tests__/models/GetSpeechReason.spec.ts
+++ b/__tests__/models/GetSpeechReason.spec.ts
@@ -2,34 +2,36 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("GetSpeechReason", () => {
- describe(".ERROR", () => {
- it("resolves to correct value for ERROR enum property", () => {
- expect(freeclimb.GetSpeechReason.ERROR).toBe("error");
+ describe("Test with truthy values", () => {
+ describe(".ERROR", () => {
+ it("resolves to correct value for ERROR enum property", () => {
+ expect(freeclimb.GetSpeechReason.ERROR).toBe("error");
+ });
});
- });
- describe(".HANGUP", () => {
- it("resolves to correct value for HANGUP enum property", () => {
- expect(freeclimb.GetSpeechReason.HANGUP).toBe("hangup");
+ describe(".HANGUP", () => {
+ it("resolves to correct value for HANGUP enum property", () => {
+ expect(freeclimb.GetSpeechReason.HANGUP).toBe("hangup");
+ });
});
- });
- describe(".DIGIT", () => {
- it("resolves to correct value for DIGIT enum property", () => {
- expect(freeclimb.GetSpeechReason.DIGIT).toBe("digit");
+ describe(".DIGIT", () => {
+ it("resolves to correct value for DIGIT enum property", () => {
+ expect(freeclimb.GetSpeechReason.DIGIT).toBe("digit");
+ });
});
- });
- describe(".NO_INPUT", () => {
- it("resolves to correct value for NO_INPUT enum property", () => {
- expect(freeclimb.GetSpeechReason.NO_INPUT).toBe("noInput");
+ describe(".NO_INPUT", () => {
+ it("resolves to correct value for NO_INPUT enum property", () => {
+ expect(freeclimb.GetSpeechReason.NO_INPUT).toBe("noInput");
+ });
});
- });
- describe(".NO_MATCH", () => {
- it("resolves to correct value for NO_MATCH enum property", () => {
- expect(freeclimb.GetSpeechReason.NO_MATCH).toBe("noMatch");
+ describe(".NO_MATCH", () => {
+ it("resolves to correct value for NO_MATCH enum property", () => {
+ expect(freeclimb.GetSpeechReason.NO_MATCH).toBe("noMatch");
+ });
});
- });
- describe(".RECOGNITION", () => {
- it("resolves to correct value for RECOGNITION enum property", () => {
- expect(freeclimb.GetSpeechReason.RECOGNITION).toBe("recognition");
+ describe(".RECOGNITION", () => {
+ it("resolves to correct value for RECOGNITION enum property", () => {
+ expect(freeclimb.GetSpeechReason.RECOGNITION).toBe("recognition");
+ });
});
});
});
diff --git a/__tests__/models/GetSpeechWebhook.spec.ts b/__tests__/models/GetSpeechWebhook.spec.ts
index 8ae2d6e..a4f81f5 100644
--- a/__tests__/models/GetSpeechWebhook.spec.ts
+++ b/__tests__/models/GetSpeechWebhook.spec.ts
@@ -2,141 +2,432 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("GetSpeechWebhook", () => {
- let model: freeclimb.GetSpeechWebhook = new freeclimb.GetSpeechWebhook({
- requestType: "test_requestType",
- callId: "test_callId",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.GetSpeechWebhook;
+ let model: freeclimb.GetSpeechWebhook = new freeclimb.GetSpeechWebhook({
+ requestType: "test_requestType",
+ callId: "test_callId",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
- reason: freeclimb.GetSpeechReason.ERROR,
- recognitionResult: "test_recognitionResult",
- confidence: 1,
- parentCallId: "test_parentCallId",
- completionReason: "test_completionReason",
- completionCause: "test_completionCause",
- mrcpCode: 1,
- mrcpDiagnostic: "test_mrcpDiagnostic",
- });
- describe("GetSpeechWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.GetSpeechWebhook);
+ reason: freeclimb.GetSpeechReason.ERROR,
+ recognitionResult: "test_recognitionResult",
+ confidence: 1,
+ parentCallId: "test_parentCallId",
+ completionReason: "test_completionReason",
+ completionCause: "test_completionCause",
+ mrcpCode: 1,
+ mrcpDiagnostic: "test_mrcpDiagnostic",
+ });
+ describe("GetSpeechWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.GetSpeechWebhook);
+ });
});
- });
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
});
- });
- describe(".reason", () => {
- it("resolves to particular value on initialization", () => {
- const value = "error";
- expect(model.reason).toBe(value);
+ describe(".reason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "error";
+ expect(model.reason).toBe(value);
+ });
});
- });
- describe(".recognitionResult", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_recognitionResult";
- expect(model.recognitionResult).toBe(value);
+ describe(".recognitionResult", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_recognitionResult";
+ expect(model.recognitionResult).toBe(value);
+ });
});
- });
- describe(".confidence", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.confidence).toBe(value);
+ describe(".confidence", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.confidence).toBe(value);
+ });
});
- });
- describe(".parentCallId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_parentCallId";
- expect(model.parentCallId).toBe(value);
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_parentCallId";
+ expect(model.parentCallId).toBe(value);
+ });
});
- });
- describe(".completionReason", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_completionReason";
- expect(model.completionReason).toBe(value);
+ describe(".completionReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_completionReason";
+ expect(model.completionReason).toBe(value);
+ });
});
- });
- describe(".completionCause", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_completionCause";
- expect(model.completionCause).toBe(value);
+ describe(".completionCause", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_completionCause";
+ expect(model.completionCause).toBe(value);
+ });
});
- });
- describe(".mrcpCode", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.mrcpCode).toBe(value);
+ describe(".mrcpCode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.mrcpCode).toBe(value);
+ });
+ });
+ describe(".mrcpDiagnostic", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_mrcpDiagnostic";
+ expect(model.mrcpDiagnostic).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of GetSpeechWebhook", () => {
+ expect(
+ freeclimb.GetSpeechWebhook.deserialize(
+ '{ "requestType": "getSpeech"}',
+ ),
+ ).toBeInstanceOf(freeclimb.GetSpeechWebhook);
+ });
});
});
- describe(".mrcpDiagnostic", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_mrcpDiagnostic";
- expect(model.mrcpDiagnostic).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.GetSpeechWebhook;
+ let model: freeclimb.GetSpeechWebhook = new freeclimb.GetSpeechWebhook({
+ requestType: "",
+ callId: "",
+ accountId: "",
+ from: "",
+ to: "",
+
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+
+ reason: freeclimb.GetSpeechReason.ERROR,
+ recognitionResult: "",
+ confidence: 0,
+ parentCallId: "",
+ completionReason: "",
+ completionCause: "",
+ mrcpCode: 0,
+ mrcpDiagnostic: "",
+ });
+ describe("GetSpeechWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.GetSpeechWebhook);
+ });
+ });
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".reason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "error";
+ expect(model.reason).toBe(value);
+ });
+ });
+ describe(".recognitionResult", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recognitionResult).toBe(value);
+ });
+ });
+ describe(".confidence", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.confidence).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".completionReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.completionReason).toBe(value);
+ });
+ });
+ describe(".completionCause", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.completionCause).toBe(value);
+ });
+ });
+ describe(".mrcpCode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.mrcpCode).toBe(value);
+ });
+ });
+ describe(".mrcpDiagnostic", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.mrcpDiagnostic).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of GetSpeechWebhook", () => {
+ expect(
+ freeclimb.GetSpeechWebhook.deserialize(
+ '{ "requestType": "getSpeech"}',
+ ),
+ ).toBeInstanceOf(freeclimb.GetSpeechWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of GetSpeechWebhook", () => {
- expect(
- freeclimb.GetSpeechWebhook.deserialize('{ "requestType": "getSpeech"}'),
- ).toBeInstanceOf(freeclimb.GetSpeechWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.GetSpeechWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.GetSpeechWebhook = new freeclimb.GetSpeechWebhook(
+ constructorArguments,
+ );
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#reason", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "reason",
+ )?.defaultValue;
+ expect(model.reason).toBe(value);
+ });
+ });
+ describe("#recognitionResult", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recognitionResult",
+ )?.defaultValue;
+ expect(model.recognitionResult).toBe(value);
+ });
+ });
+ describe("#confidence", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "confidence",
+ )?.defaultValue;
+ expect(model.confidence).toBe(value);
+ });
+ });
+ describe("#parentCallId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "parentCallId",
+ )?.defaultValue;
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe("#completionReason", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "completionReason",
+ )?.defaultValue;
+ expect(model.completionReason).toBe(value);
+ });
+ });
+ describe("#completionCause", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "completionCause",
+ )?.defaultValue;
+ expect(model.completionCause).toBe(value);
+ });
+ });
+ describe("#mrcpCode", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "mrcpCode",
+ )?.defaultValue;
+ expect(model.mrcpCode).toBe(value);
+ });
+ });
+ describe("#mrcpDiagnostic", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "mrcpDiagnostic",
+ )?.defaultValue;
+ expect(model.mrcpDiagnostic).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/GrammarFileBuiltIn.spec.ts b/__tests__/models/GrammarFileBuiltIn.spec.ts
index b5e312d..4539f9b 100644
--- a/__tests__/models/GrammarFileBuiltIn.spec.ts
+++ b/__tests__/models/GrammarFileBuiltIn.spec.ts
@@ -2,81 +2,83 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("GrammarFileBuiltIn", () => {
- describe(".ALPHNUM6", () => {
- it("resolves to correct value for ALPHNUM6 enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.ALPHNUM6).toBe("ALPHNUM6");
+ describe("Test with truthy values", () => {
+ describe(".ALPHNUM6", () => {
+ it("resolves to correct value for ALPHNUM6 enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.ALPHNUM6).toBe("ALPHNUM6");
+ });
});
- });
- describe(".ANY_DIG", () => {
- it("resolves to correct value for ANY_DIG enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.ANY_DIG).toBe("ANY_DIG");
+ describe(".ANY_DIG", () => {
+ it("resolves to correct value for ANY_DIG enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.ANY_DIG).toBe("ANY_DIG");
+ });
});
- });
- describe(".DIG1", () => {
- it("resolves to correct value for DIG1 enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.DIG1).toBe("DIG1");
+ describe(".DIG1", () => {
+ it("resolves to correct value for DIG1 enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.DIG1).toBe("DIG1");
+ });
});
- });
- describe(".DIG2", () => {
- it("resolves to correct value for DIG2 enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.DIG2).toBe("DIG2");
+ describe(".DIG2", () => {
+ it("resolves to correct value for DIG2 enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.DIG2).toBe("DIG2");
+ });
});
- });
- describe(".DIG3", () => {
- it("resolves to correct value for DIG3 enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.DIG3).toBe("DIG3");
+ describe(".DIG3", () => {
+ it("resolves to correct value for DIG3 enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.DIG3).toBe("DIG3");
+ });
});
- });
- describe(".DIG4", () => {
- it("resolves to correct value for DIG4 enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.DIG4).toBe("DIG4");
+ describe(".DIG4", () => {
+ it("resolves to correct value for DIG4 enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.DIG4).toBe("DIG4");
+ });
});
- });
- describe(".DIG5", () => {
- it("resolves to correct value for DIG5 enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.DIG5).toBe("DIG5");
+ describe(".DIG5", () => {
+ it("resolves to correct value for DIG5 enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.DIG5).toBe("DIG5");
+ });
});
- });
- describe(".DIG6", () => {
- it("resolves to correct value for DIG6 enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.DIG6).toBe("DIG6");
+ describe(".DIG6", () => {
+ it("resolves to correct value for DIG6 enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.DIG6).toBe("DIG6");
+ });
});
- });
- describe(".DIG7", () => {
- it("resolves to correct value for DIG7 enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.DIG7).toBe("DIG7");
+ describe(".DIG7", () => {
+ it("resolves to correct value for DIG7 enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.DIG7).toBe("DIG7");
+ });
});
- });
- describe(".DIG8", () => {
- it("resolves to correct value for DIG8 enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.DIG8).toBe("DIG8");
+ describe(".DIG8", () => {
+ it("resolves to correct value for DIG8 enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.DIG8).toBe("DIG8");
+ });
});
- });
- describe(".DIG9", () => {
- it("resolves to correct value for DIG9 enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.DIG9).toBe("DIG9");
+ describe(".DIG9", () => {
+ it("resolves to correct value for DIG9 enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.DIG9).toBe("DIG9");
+ });
});
- });
- describe(".DIG10", () => {
- it("resolves to correct value for DIG10 enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.DIG10).toBe("DIG10");
+ describe(".DIG10", () => {
+ it("resolves to correct value for DIG10 enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.DIG10).toBe("DIG10");
+ });
});
- });
- describe(".DIG11", () => {
- it("resolves to correct value for DIG11 enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.DIG11).toBe("DIG11");
+ describe(".DIG11", () => {
+ it("resolves to correct value for DIG11 enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.DIG11).toBe("DIG11");
+ });
});
- });
- describe(".UP_TO_20_DIGIT_SEQUENCE", () => {
- it("resolves to correct value for UP_TO_20_DIGIT_SEQUENCE enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.UP_TO_20_DIGIT_SEQUENCE).toBe(
- "UP_TO_20_DIGIT_SEQUENCE",
- );
+ describe(".UP_TO_20_DIGIT_SEQUENCE", () => {
+ it("resolves to correct value for UP_TO_20_DIGIT_SEQUENCE enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.UP_TO_20_DIGIT_SEQUENCE).toBe(
+ "UP_TO_20_DIGIT_SEQUENCE",
+ );
+ });
});
- });
- describe(".VERSAY_YESNO", () => {
- it("resolves to correct value for VERSAY_YESNO enum property", () => {
- expect(freeclimb.GrammarFileBuiltIn.VERSAY_YESNO).toBe("VERSAY_YESNO");
+ describe(".VERSAY_YESNO", () => {
+ it("resolves to correct value for VERSAY_YESNO enum property", () => {
+ expect(freeclimb.GrammarFileBuiltIn.VERSAY_YESNO).toBe("VERSAY_YESNO");
+ });
});
});
});
diff --git a/__tests__/models/GrammarType.spec.ts b/__tests__/models/GrammarType.spec.ts
index e5c7efc..7d161ed 100644
--- a/__tests__/models/GrammarType.spec.ts
+++ b/__tests__/models/GrammarType.spec.ts
@@ -2,14 +2,16 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("GrammarType", () => {
- describe(".URL", () => {
- it("resolves to correct value for URL enum property", () => {
- expect(freeclimb.GrammarType.URL).toBe("URL");
+ describe("Test with truthy values", () => {
+ describe(".URL", () => {
+ it("resolves to correct value for URL enum property", () => {
+ expect(freeclimb.GrammarType.URL).toBe("URL");
+ });
});
- });
- describe(".BUILT_IN", () => {
- it("resolves to correct value for BUILT_IN enum property", () => {
- expect(freeclimb.GrammarType.BUILT_IN).toBe("BUILTIN");
+ describe(".BUILT_IN", () => {
+ it("resolves to correct value for BUILT_IN enum property", () => {
+ expect(freeclimb.GrammarType.BUILT_IN).toBe("BUILTIN");
+ });
});
});
});
diff --git a/__tests__/models/Hangup.spec.ts b/__tests__/models/Hangup.spec.ts
index 8a839ba..83b28eb 100644
--- a/__tests__/models/Hangup.spec.ts
+++ b/__tests__/models/Hangup.spec.ts
@@ -2,19 +2,54 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Hangup", () => {
- let model: freeclimb.Hangup = new freeclimb.Hangup({
- reason: "test_reason",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.Hangup;
+ let model: freeclimb.Hangup = new freeclimb.Hangup({
+ reason: "test_reason",
+ });
+ describe("Hangup class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Hangup);
+ });
+ });
+
+ describe(".reason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_reason";
+ expect(model.reason).toBe(value);
+ });
+ });
});
- describe("Hangup class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.Hangup);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.Hangup;
+ let model: freeclimb.Hangup = new freeclimb.Hangup({
+ reason: "",
+ });
+ describe("Hangup class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Hangup);
+ });
+ });
+
+ describe(".reason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.reason).toBe(value);
+ });
});
});
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.Hangup;
+ let constructorArguments = {};
+ let model: freeclimb.Hangup = new freeclimb.Hangup(constructorArguments);
- describe(".reason", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_reason";
- expect(model.reason).toBe(value);
+ describe("#reason", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "reason",
+ )?.defaultValue;
+ expect(model.reason).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/IfMachine.spec.ts b/__tests__/models/IfMachine.spec.ts
index 0f47738..bff0752 100644
--- a/__tests__/models/IfMachine.spec.ts
+++ b/__tests__/models/IfMachine.spec.ts
@@ -2,14 +2,16 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("IfMachine", () => {
- describe(".REDIRECT", () => {
- it("resolves to correct value for REDIRECT enum property", () => {
- expect(freeclimb.IfMachine.REDIRECT).toBe("redirect");
+ describe("Test with truthy values", () => {
+ describe(".REDIRECT", () => {
+ it("resolves to correct value for REDIRECT enum property", () => {
+ expect(freeclimb.IfMachine.REDIRECT).toBe("redirect");
+ });
});
- });
- describe(".HANGUP", () => {
- it("resolves to correct value for HANGUP enum property", () => {
- expect(freeclimb.IfMachine.HANGUP).toBe("hangup");
+ describe(".HANGUP", () => {
+ it("resolves to correct value for HANGUP enum property", () => {
+ expect(freeclimb.IfMachine.HANGUP).toBe("hangup");
+ });
});
});
});
diff --git a/__tests__/models/InboundCallWebhook.spec.ts b/__tests__/models/InboundCallWebhook.spec.ts
index 37008ef..d0a1767 100644
--- a/__tests__/models/InboundCallWebhook.spec.ts
+++ b/__tests__/models/InboundCallWebhook.spec.ts
@@ -2,93 +2,276 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("InboundCallWebhook", () => {
- let model: freeclimb.InboundCallWebhook = new freeclimb.InboundCallWebhook({
- requestType: "test_requestType",
- callId: "test_callId",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.InboundCallWebhook;
+ let model: freeclimb.InboundCallWebhook = new freeclimb.InboundCallWebhook({
+ requestType: "test_requestType",
+ callId: "test_callId",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
- parentCallId: "test_parentCallId",
- });
- describe("InboundCallWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.InboundCallWebhook);
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
+ parentCallId: "test_parentCallId",
+ });
+ describe("InboundCallWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.InboundCallWebhook);
+ });
});
- });
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_parentCallId";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of InboundCallWebhook", () => {
+ expect(
+ freeclimb.InboundCallWebhook.deserialize(
+ '{ "requestType": "inboundCall"}',
+ ),
+ ).toBeInstanceOf(freeclimb.InboundCallWebhook);
+ });
});
});
- describe(".parentCallId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_parentCallId";
- expect(model.parentCallId).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.InboundCallWebhook;
+ let model: freeclimb.InboundCallWebhook = new freeclimb.InboundCallWebhook({
+ requestType: "",
+ callId: "",
+ accountId: "",
+ from: "",
+ to: "",
+
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+ parentCallId: "",
+ });
+ describe("InboundCallWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.InboundCallWebhook);
+ });
+ });
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of InboundCallWebhook", () => {
+ expect(
+ freeclimb.InboundCallWebhook.deserialize(
+ '{ "requestType": "inboundCall"}',
+ ),
+ ).toBeInstanceOf(freeclimb.InboundCallWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of InboundCallWebhook", () => {
- expect(
- freeclimb.InboundCallWebhook.deserialize(
- '{ "requestType": "inboundCall"}',
- ),
- ).toBeInstanceOf(freeclimb.InboundCallWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.InboundCallWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.InboundCallWebhook = new freeclimb.InboundCallWebhook(
+ constructorArguments,
+ );
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#parentCallId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "parentCallId",
+ )?.defaultValue;
+ expect(model.parentCallId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/IncomingNumberList.spec.ts b/__tests__/models/IncomingNumberList.spec.ts
index 5eb4874..b449081 100644
--- a/__tests__/models/IncomingNumberList.spec.ts
+++ b/__tests__/models/IncomingNumberList.spec.ts
@@ -2,67 +2,160 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("IncomingNumberList", () => {
- let model: freeclimb.IncomingNumberList = new freeclimb.IncomingNumberList({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- incomingPhoneNumbers: [],
- });
- describe("IncomingNumberList class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.IncomingNumberList);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.IncomingNumberList;
+ let model: freeclimb.IncomingNumberList = new freeclimb.IncomingNumberList({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ incomingPhoneNumbers: [],
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe("IncomingNumberList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.IncomingNumberList);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".incomingPhoneNumbers", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.IncomingNumberResult[] = [];
+ expect(model.incomingPhoneNumbers).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.IncomingNumberList;
+ let model: freeclimb.IncomingNumberList = new freeclimb.IncomingNumberList({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ incomingPhoneNumbers: [],
+ });
+ describe("IncomingNumberList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.IncomingNumberList);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".incomingPhoneNumbers", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.IncomingNumberResult[] = [];
+ expect(model.incomingPhoneNumbers).toStrictEqual(value);
+ });
});
});
- describe(".incomingPhoneNumbers", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.IncomingNumberResult[] = [];
- expect(model.incomingPhoneNumbers).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.IncomingNumberList;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.IncomingNumberList = new freeclimb.IncomingNumberList(
+ constructorArguments,
+ );
+
+ describe("#incomingPhoneNumbers", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "incomingPhoneNumbers",
+ )?.defaultValue;
+ expect(model.incomingPhoneNumbers).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/IncomingNumberRequest.spec.ts b/__tests__/models/IncomingNumberRequest.spec.ts
index 4d23d92..ac9d8be 100644
--- a/__tests__/models/IncomingNumberRequest.spec.ts
+++ b/__tests__/models/IncomingNumberRequest.spec.ts
@@ -2,33 +2,99 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("IncomingNumberRequest", () => {
- let model: freeclimb.IncomingNumberRequest =
- new freeclimb.IncomingNumberRequest({
- applicationId: "test_applicationId",
- alias: "test_alias",
- campaignId: "test_campaignId",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.IncomingNumberRequest;
+ let model: freeclimb.IncomingNumberRequest =
+ new freeclimb.IncomingNumberRequest({
+ applicationId: "test_applicationId",
+ alias: "test_alias",
+ campaignId: "test_campaignId",
+ });
+ describe("IncomingNumberRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.IncomingNumberRequest);
+ });
});
- describe("IncomingNumberRequest class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.IncomingNumberRequest);
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_applicationId";
+ expect(model.applicationId).toBe(value);
+ });
});
- });
- describe(".applicationId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_applicationId";
- expect(model.applicationId).toBe(value);
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_alias";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_campaignId";
+ expect(model.campaignId).toBe(value);
+ });
});
});
- describe(".alias", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_alias";
- expect(model.alias).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.IncomingNumberRequest;
+ let model: freeclimb.IncomingNumberRequest =
+ new freeclimb.IncomingNumberRequest({
+ applicationId: "",
+ alias: "",
+ campaignId: "",
+ });
+ describe("IncomingNumberRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.IncomingNumberRequest);
+ });
+ });
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.applicationId).toBe(value);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.campaignId).toBe(value);
+ });
});
});
- describe(".campaignId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_campaignId";
- expect(model.campaignId).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.IncomingNumberRequest;
+ let constructorArguments = {};
+ let model: freeclimb.IncomingNumberRequest =
+ new freeclimb.IncomingNumberRequest(constructorArguments);
+
+ describe("#applicationId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "applicationId",
+ )?.defaultValue;
+ expect(model.applicationId).toBe(value);
+ });
+ });
+ describe("#alias", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "alias",
+ )?.defaultValue;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe("#campaignId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "campaignId",
+ )?.defaultValue;
+ expect(model.campaignId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/IncomingNumberResult.spec.ts b/__tests__/models/IncomingNumberResult.spec.ts
index 866e20a..4e1606a 100644
--- a/__tests__/models/IncomingNumberResult.spec.ts
+++ b/__tests__/models/IncomingNumberResult.spec.ts
@@ -2,149 +2,416 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("IncomingNumberResult", () => {
- let model: freeclimb.IncomingNumberResult =
- new freeclimb.IncomingNumberResult({
- uri: "test_uri",
- dateCreated: "test_dateCreated",
- dateUpdated: "test_dateUpdated",
- revision: 1,
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.IncomingNumberResult;
+ let model: freeclimb.IncomingNumberResult =
+ new freeclimb.IncomingNumberResult({
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
- capabilities: new freeclimb.Capabilities({
- voice: null as any,
- sms: null as any,
- tollFree: null as any,
- tenDLC: null as any,
- shortCode: null as any,
- }),
- campaignId: "test_campaignId",
- phoneNumberId: "test_phoneNumberId",
- accountId: "test_accountId",
- applicationId: "test_applicationId",
- phoneNumber: "test_phoneNumber",
- alias: "test_alias",
- region: "test_region",
- country: "test_country",
- voiceEnabled: true,
- smsEnabled: true,
- offnet: true,
+ capabilities: new freeclimb.Capabilities({
+ voice: null as any,
+ sms: null as any,
+ tollFree: null as any,
+ tenDLC: null as any,
+ shortCode: null as any,
+ }),
+ campaignId: "test_campaignId",
+ phoneNumberId: "test_phoneNumberId",
+ accountId: "test_accountId",
+ applicationId: "test_applicationId",
+ phoneNumber: "test_phoneNumber",
+ alias: "test_alias",
+ region: "test_region",
+ country: "test_country",
+ voiceEnabled: true,
+ smsEnabled: true,
+ offnet: true,
- tfn: new freeclimb.TFN({
- campaignId: null as any,
- }),
+ tfn: new freeclimb.TFN({
+ campaignId: null as any,
+ }),
+ });
+ describe("IncomingNumberResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.IncomingNumberResult);
+ });
});
- describe("IncomingNumberResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.IncomingNumberResult);
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_uri";
+ expect(model.uri).toBe(value);
+ });
});
- });
- describe(".uri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_uri";
- expect(model.uri).toBe(value);
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreated";
+ expect(model.dateCreated).toBe(value);
+ });
});
- });
- describe(".dateCreated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreated";
- expect(model.dateCreated).toBe(value);
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdated";
+ expect(model.dateUpdated).toBe(value);
+ });
});
- });
- describe(".dateUpdated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdated";
- expect(model.dateUpdated).toBe(value);
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.revision).toBe(value);
+ });
});
- });
- describe(".revision", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.revision).toBe(value);
+ describe(".capabilities", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new freeclimb.Capabilities({
+ voice: null as any,
+ sms: null as any,
+ tollFree: null as any,
+ tenDLC: null as any,
+ shortCode: null as any,
+ });
+ expect(model.capabilities).toStrictEqual(value);
+ });
});
- });
- describe(".capabilities", () => {
- it("resolves to particular value on initialization", () => {
- const value = new freeclimb.Capabilities({
- voice: null as any,
- sms: null as any,
- tollFree: null as any,
- tenDLC: null as any,
- shortCode: null as any,
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_campaignId";
+ expect(model.campaignId).toBe(value);
});
- expect(model.capabilities).toStrictEqual(value);
});
- });
- describe(".campaignId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_campaignId";
- expect(model.campaignId).toBe(value);
+ describe(".phoneNumberId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_phoneNumberId";
+ expect(model.phoneNumberId).toBe(value);
+ });
});
- });
- describe(".phoneNumberId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_phoneNumberId";
- expect(model.phoneNumberId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_applicationId";
+ expect(model.applicationId).toBe(value);
+ });
});
- });
- describe(".applicationId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_applicationId";
- expect(model.applicationId).toBe(value);
+ describe(".phoneNumber", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_phoneNumber";
+ expect(model.phoneNumber).toBe(value);
+ });
});
- });
- describe(".phoneNumber", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_phoneNumber";
- expect(model.phoneNumber).toBe(value);
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_alias";
+ expect(model.alias).toBe(value);
+ });
});
- });
- describe(".alias", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_alias";
- expect(model.alias).toBe(value);
+ describe(".region", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_region";
+ expect(model.region).toBe(value);
+ });
});
- });
- describe(".region", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_region";
- expect(model.region).toBe(value);
+ describe(".country", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_country";
+ expect(model.country).toBe(value);
+ });
});
- });
- describe(".country", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_country";
- expect(model.country).toBe(value);
+ describe(".voiceEnabled", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.voiceEnabled).toBe(value);
+ });
});
- });
- describe(".voiceEnabled", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.voiceEnabled).toBe(value);
+ describe(".smsEnabled", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.smsEnabled).toBe(value);
+ });
});
- });
- describe(".smsEnabled", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.smsEnabled).toBe(value);
+ describe(".offnet", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.offnet).toBe(value);
+ });
+ });
+ describe(".tfn", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new freeclimb.TFN({
+ campaignId: null as any,
+ });
+ expect(model.tfn).toStrictEqual(value);
+ });
});
});
- describe(".offnet", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.offnet).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.IncomingNumberResult;
+ let model: freeclimb.IncomingNumberResult =
+ new freeclimb.IncomingNumberResult({
+ uri: "",
+ dateCreated: "",
+ dateUpdated: "",
+ revision: 0,
+
+ capabilities: new freeclimb.Capabilities({
+ voice: null as any,
+ sms: null as any,
+ tollFree: null as any,
+ tenDLC: null as any,
+ shortCode: null as any,
+ }),
+ campaignId: "",
+ phoneNumberId: "",
+ accountId: "",
+ applicationId: "",
+ phoneNumber: "",
+ alias: "",
+ region: "",
+ country: "",
+ voiceEnabled: false,
+ smsEnabled: false,
+ offnet: false,
+
+ tfn: new freeclimb.TFN({
+ campaignId: null as any,
+ }),
+ });
+ describe("IncomingNumberResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.IncomingNumberResult);
+ });
+ });
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.revision).toBe(value);
+ });
+ });
+ describe(".capabilities", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new freeclimb.Capabilities({
+ voice: null as any,
+ sms: null as any,
+ tollFree: null as any,
+ tenDLC: null as any,
+ shortCode: null as any,
+ });
+ expect(model.capabilities).toStrictEqual(value);
+ });
+ });
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.campaignId).toBe(value);
+ });
+ });
+ describe(".phoneNumberId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.phoneNumberId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.applicationId).toBe(value);
+ });
+ });
+ describe(".phoneNumber", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.phoneNumber).toBe(value);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".region", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.region).toBe(value);
+ });
+ });
+ describe(".country", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.country).toBe(value);
+ });
+ });
+ describe(".voiceEnabled", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.voiceEnabled).toBe(value);
+ });
+ });
+ describe(".smsEnabled", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.smsEnabled).toBe(value);
+ });
+ });
+ describe(".offnet", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.offnet).toBe(value);
+ });
+ });
+ describe(".tfn", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new freeclimb.TFN({
+ campaignId: null as any,
+ });
+ expect(model.tfn).toStrictEqual(value);
+ });
});
});
- describe(".tfn", () => {
- it("resolves to particular value on initialization", () => {
- const value = new freeclimb.TFN({
- campaignId: null as any,
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.IncomingNumberResult;
+ let constructorArguments = {
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ };
+ let model: freeclimb.IncomingNumberResult =
+ new freeclimb.IncomingNumberResult(constructorArguments);
+
+ describe("#capabilities", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "capabilities",
+ )?.defaultValue;
+ expect(model.capabilities).toBe(value);
+ });
+ });
+ describe("#campaignId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "campaignId",
+ )?.defaultValue;
+ expect(model.campaignId).toBe(value);
+ });
+ });
+ describe("#phoneNumberId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "phoneNumberId",
+ )?.defaultValue;
+ expect(model.phoneNumberId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#applicationId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "applicationId",
+ )?.defaultValue;
+ expect(model.applicationId).toBe(value);
+ });
+ });
+ describe("#phoneNumber", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "phoneNumber",
+ )?.defaultValue;
+ expect(model.phoneNumber).toBe(value);
+ });
+ });
+ describe("#alias", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "alias",
+ )?.defaultValue;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe("#region", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "region",
+ )?.defaultValue;
+ expect(model.region).toBe(value);
+ });
+ });
+ describe("#country", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "country",
+ )?.defaultValue;
+ expect(model.country).toBe(value);
+ });
+ });
+ describe("#voiceEnabled", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "voiceEnabled",
+ )?.defaultValue;
+ expect(model.voiceEnabled).toBe(value);
+ });
+ });
+ describe("#smsEnabled", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "smsEnabled",
+ )?.defaultValue;
+ expect(model.smsEnabled).toBe(value);
+ });
+ });
+ describe("#offnet", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "offnet",
+ )?.defaultValue;
+ expect(model.offnet).toBe(value);
+ });
+ });
+ describe("#tfn", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "tfn",
+ )?.defaultValue;
+ expect(model.tfn).toBe(value);
});
- expect(model.tfn).toStrictEqual(value);
});
});
});
diff --git a/__tests__/models/Language.spec.ts b/__tests__/models/Language.spec.ts
index a858f95..6e977fb 100644
--- a/__tests__/models/Language.spec.ts
+++ b/__tests__/models/Language.spec.ts
@@ -2,134 +2,136 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Language", () => {
- describe(".CATALAN", () => {
- it("resolves to correct value for CATALAN enum property", () => {
- expect(freeclimb.Language.CATALAN).toBe("ca-ES");
- });
- });
- describe(".DANISH", () => {
- it("resolves to correct value for DANISH enum property", () => {
- expect(freeclimb.Language.DANISH).toBe("da-DK");
- });
- });
- describe(".GERMAN", () => {
- it("resolves to correct value for GERMAN enum property", () => {
- expect(freeclimb.Language.GERMAN).toBe("de-DE");
- });
- });
- describe(".ENGLISH_AU", () => {
- it("resolves to correct value for ENGLISH_AU enum property", () => {
- expect(freeclimb.Language.ENGLISH_AU).toBe("en-AU");
- });
- });
- describe(".ENGLISH_CA", () => {
- it("resolves to correct value for ENGLISH_CA enum property", () => {
- expect(freeclimb.Language.ENGLISH_CA).toBe("en-CA");
- });
- });
- describe(".ENGLISH_UK", () => {
- it("resolves to correct value for ENGLISH_UK enum property", () => {
- expect(freeclimb.Language.ENGLISH_UK).toBe("en-GB");
- });
- });
- describe(".ENGLISH_IN", () => {
- it("resolves to correct value for ENGLISH_IN enum property", () => {
- expect(freeclimb.Language.ENGLISH_IN).toBe("en-IN");
- });
- });
- describe(".ENGLISH_US", () => {
- it("resolves to correct value for ENGLISH_US enum property", () => {
- expect(freeclimb.Language.ENGLISH_US).toBe("en-US");
- });
- });
- describe(".ENGLISH_ES", () => {
- it("resolves to correct value for ENGLISH_ES enum property", () => {
- expect(freeclimb.Language.ENGLISH_ES).toBe("es-ES");
- });
- });
- describe(".ENGLISH_MX", () => {
- it("resolves to correct value for ENGLISH_MX enum property", () => {
- expect(freeclimb.Language.ENGLISH_MX).toBe("es-MX");
- });
- });
- describe(".FINNISH", () => {
- it("resolves to correct value for FINNISH enum property", () => {
- expect(freeclimb.Language.FINNISH).toBe("fi-FI");
- });
- });
- describe(".FRENCH_CA", () => {
- it("resolves to correct value for FRENCH_CA enum property", () => {
- expect(freeclimb.Language.FRENCH_CA).toBe("fr-CA");
- });
- });
- describe(".FRENCH_FR", () => {
- it("resolves to correct value for FRENCH_FR enum property", () => {
- expect(freeclimb.Language.FRENCH_FR).toBe("fr-FR");
- });
- });
- describe(".ITALIAN", () => {
- it("resolves to correct value for ITALIAN enum property", () => {
- expect(freeclimb.Language.ITALIAN).toBe("it-IT");
- });
- });
- describe(".JAPANESE", () => {
- it("resolves to correct value for JAPANESE enum property", () => {
- expect(freeclimb.Language.JAPANESE).toBe("ja-JP");
- });
- });
- describe(".KOREAN", () => {
- it("resolves to correct value for KOREAN enum property", () => {
- expect(freeclimb.Language.KOREAN).toBe("ko-KR");
- });
- });
- describe(".NORWEGIAN", () => {
- it("resolves to correct value for NORWEGIAN enum property", () => {
- expect(freeclimb.Language.NORWEGIAN).toBe("nb-NO");
- });
- });
- describe(".DUTCH", () => {
- it("resolves to correct value for DUTCH enum property", () => {
- expect(freeclimb.Language.DUTCH).toBe("nl-NL");
- });
- });
- describe(".POLISH", () => {
- it("resolves to correct value for POLISH enum property", () => {
- expect(freeclimb.Language.POLISH).toBe("pl-PL");
- });
- });
- describe(".PORTUGESE_BR", () => {
- it("resolves to correct value for PORTUGESE_BR enum property", () => {
- expect(freeclimb.Language.PORTUGESE_BR).toBe("pt-BR");
- });
- });
- describe(".PORTUGESE_PT", () => {
- it("resolves to correct value for PORTUGESE_PT enum property", () => {
- expect(freeclimb.Language.PORTUGESE_PT).toBe("pt-PT");
- });
- });
- describe(".RUSSIAN", () => {
- it("resolves to correct value for RUSSIAN enum property", () => {
- expect(freeclimb.Language.RUSSIAN).toBe("ru-RU");
- });
- });
- describe(".SWEDISH", () => {
- it("resolves to correct value for SWEDISH enum property", () => {
- expect(freeclimb.Language.SWEDISH).toBe("sv-SE");
- });
- });
- describe(".CHINESE_CN", () => {
- it("resolves to correct value for CHINESE_CN enum property", () => {
- expect(freeclimb.Language.CHINESE_CN).toBe("zh-CN");
- });
- });
- describe(".CHINESE_HK", () => {
- it("resolves to correct value for CHINESE_HK enum property", () => {
- expect(freeclimb.Language.CHINESE_HK).toBe("zh-HK");
- });
- });
- describe(".CHINESE_TW", () => {
- it("resolves to correct value for CHINESE_TW enum property", () => {
- expect(freeclimb.Language.CHINESE_TW).toBe("zh-TW");
+ describe("Test with truthy values", () => {
+ describe(".CATALAN", () => {
+ it("resolves to correct value for CATALAN enum property", () => {
+ expect(freeclimb.Language.CATALAN).toBe("ca-ES");
+ });
+ });
+ describe(".DANISH", () => {
+ it("resolves to correct value for DANISH enum property", () => {
+ expect(freeclimb.Language.DANISH).toBe("da-DK");
+ });
+ });
+ describe(".GERMAN", () => {
+ it("resolves to correct value for GERMAN enum property", () => {
+ expect(freeclimb.Language.GERMAN).toBe("de-DE");
+ });
+ });
+ describe(".ENGLISH_AU", () => {
+ it("resolves to correct value for ENGLISH_AU enum property", () => {
+ expect(freeclimb.Language.ENGLISH_AU).toBe("en-AU");
+ });
+ });
+ describe(".ENGLISH_CA", () => {
+ it("resolves to correct value for ENGLISH_CA enum property", () => {
+ expect(freeclimb.Language.ENGLISH_CA).toBe("en-CA");
+ });
+ });
+ describe(".ENGLISH_UK", () => {
+ it("resolves to correct value for ENGLISH_UK enum property", () => {
+ expect(freeclimb.Language.ENGLISH_UK).toBe("en-GB");
+ });
+ });
+ describe(".ENGLISH_IN", () => {
+ it("resolves to correct value for ENGLISH_IN enum property", () => {
+ expect(freeclimb.Language.ENGLISH_IN).toBe("en-IN");
+ });
+ });
+ describe(".ENGLISH_US", () => {
+ it("resolves to correct value for ENGLISH_US enum property", () => {
+ expect(freeclimb.Language.ENGLISH_US).toBe("en-US");
+ });
+ });
+ describe(".ENGLISH_ES", () => {
+ it("resolves to correct value for ENGLISH_ES enum property", () => {
+ expect(freeclimb.Language.ENGLISH_ES).toBe("es-ES");
+ });
+ });
+ describe(".ENGLISH_MX", () => {
+ it("resolves to correct value for ENGLISH_MX enum property", () => {
+ expect(freeclimb.Language.ENGLISH_MX).toBe("es-MX");
+ });
+ });
+ describe(".FINNISH", () => {
+ it("resolves to correct value for FINNISH enum property", () => {
+ expect(freeclimb.Language.FINNISH).toBe("fi-FI");
+ });
+ });
+ describe(".FRENCH_CA", () => {
+ it("resolves to correct value for FRENCH_CA enum property", () => {
+ expect(freeclimb.Language.FRENCH_CA).toBe("fr-CA");
+ });
+ });
+ describe(".FRENCH_FR", () => {
+ it("resolves to correct value for FRENCH_FR enum property", () => {
+ expect(freeclimb.Language.FRENCH_FR).toBe("fr-FR");
+ });
+ });
+ describe(".ITALIAN", () => {
+ it("resolves to correct value for ITALIAN enum property", () => {
+ expect(freeclimb.Language.ITALIAN).toBe("it-IT");
+ });
+ });
+ describe(".JAPANESE", () => {
+ it("resolves to correct value for JAPANESE enum property", () => {
+ expect(freeclimb.Language.JAPANESE).toBe("ja-JP");
+ });
+ });
+ describe(".KOREAN", () => {
+ it("resolves to correct value for KOREAN enum property", () => {
+ expect(freeclimb.Language.KOREAN).toBe("ko-KR");
+ });
+ });
+ describe(".NORWEGIAN", () => {
+ it("resolves to correct value for NORWEGIAN enum property", () => {
+ expect(freeclimb.Language.NORWEGIAN).toBe("nb-NO");
+ });
+ });
+ describe(".DUTCH", () => {
+ it("resolves to correct value for DUTCH enum property", () => {
+ expect(freeclimb.Language.DUTCH).toBe("nl-NL");
+ });
+ });
+ describe(".POLISH", () => {
+ it("resolves to correct value for POLISH enum property", () => {
+ expect(freeclimb.Language.POLISH).toBe("pl-PL");
+ });
+ });
+ describe(".PORTUGESE_BR", () => {
+ it("resolves to correct value for PORTUGESE_BR enum property", () => {
+ expect(freeclimb.Language.PORTUGESE_BR).toBe("pt-BR");
+ });
+ });
+ describe(".PORTUGESE_PT", () => {
+ it("resolves to correct value for PORTUGESE_PT enum property", () => {
+ expect(freeclimb.Language.PORTUGESE_PT).toBe("pt-PT");
+ });
+ });
+ describe(".RUSSIAN", () => {
+ it("resolves to correct value for RUSSIAN enum property", () => {
+ expect(freeclimb.Language.RUSSIAN).toBe("ru-RU");
+ });
+ });
+ describe(".SWEDISH", () => {
+ it("resolves to correct value for SWEDISH enum property", () => {
+ expect(freeclimb.Language.SWEDISH).toBe("sv-SE");
+ });
+ });
+ describe(".CHINESE_CN", () => {
+ it("resolves to correct value for CHINESE_CN enum property", () => {
+ expect(freeclimb.Language.CHINESE_CN).toBe("zh-CN");
+ });
+ });
+ describe(".CHINESE_HK", () => {
+ it("resolves to correct value for CHINESE_HK enum property", () => {
+ expect(freeclimb.Language.CHINESE_HK).toBe("zh-HK");
+ });
+ });
+ describe(".CHINESE_TW", () => {
+ it("resolves to correct value for CHINESE_TW enum property", () => {
+ expect(freeclimb.Language.CHINESE_TW).toBe("zh-TW");
+ });
});
});
});
diff --git a/__tests__/models/LeaveConferenceWebhook.spec.ts b/__tests__/models/LeaveConferenceWebhook.spec.ts
index eb52636..d025b16 100644
--- a/__tests__/models/LeaveConferenceWebhook.spec.ts
+++ b/__tests__/models/LeaveConferenceWebhook.spec.ts
@@ -2,87 +2,255 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("LeaveConferenceWebhook", () => {
- let model: freeclimb.LeaveConferenceWebhook =
- new freeclimb.LeaveConferenceWebhook({
- requestType: "test_requestType",
- callId: "test_callId",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.LeaveConferenceWebhook;
+ let model: freeclimb.LeaveConferenceWebhook =
+ new freeclimb.LeaveConferenceWebhook({
+ requestType: "test_requestType",
+ callId: "test_callId",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
+ });
+ describe("LeaveConferenceWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.LeaveConferenceWebhook);
+ });
});
- describe("LeaveConferenceWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.LeaveConferenceWebhook);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of LeaveConferenceWebhook", () => {
+ expect(
+ freeclimb.LeaveConferenceWebhook.deserialize(
+ '{ "requestType": "leaveConference"}',
+ ),
+ ).toBeInstanceOf(freeclimb.LeaveConferenceWebhook);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.LeaveConferenceWebhook;
+ let model: freeclimb.LeaveConferenceWebhook =
+ new freeclimb.LeaveConferenceWebhook({
+ requestType: "",
+ callId: "",
+ accountId: "",
+ from: "",
+ to: "",
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+ });
+ describe("LeaveConferenceWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.LeaveConferenceWebhook);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of LeaveConferenceWebhook", () => {
+ expect(
+ freeclimb.LeaveConferenceWebhook.deserialize(
+ '{ "requestType": "leaveConference"}',
+ ),
+ ).toBeInstanceOf(freeclimb.LeaveConferenceWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of LeaveConferenceWebhook", () => {
- expect(
- freeclimb.LeaveConferenceWebhook.deserialize(
- '{ "requestType": "leaveConference"}',
- ),
- ).toBeInstanceOf(freeclimb.LeaveConferenceWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.LeaveConferenceWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.LeaveConferenceWebhook =
+ new freeclimb.LeaveConferenceWebhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/LogLevel.spec.ts b/__tests__/models/LogLevel.spec.ts
index 6174568..093eeba 100644
--- a/__tests__/models/LogLevel.spec.ts
+++ b/__tests__/models/LogLevel.spec.ts
@@ -2,19 +2,21 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("LogLevel", () => {
- describe(".INFO", () => {
- it("resolves to correct value for INFO enum property", () => {
- expect(freeclimb.LogLevel.INFO).toBe("info");
+ describe("Test with truthy values", () => {
+ describe(".INFO", () => {
+ it("resolves to correct value for INFO enum property", () => {
+ expect(freeclimb.LogLevel.INFO).toBe("info");
+ });
});
- });
- describe(".WARNING", () => {
- it("resolves to correct value for WARNING enum property", () => {
- expect(freeclimb.LogLevel.WARNING).toBe("warning");
+ describe(".WARNING", () => {
+ it("resolves to correct value for WARNING enum property", () => {
+ expect(freeclimb.LogLevel.WARNING).toBe("warning");
+ });
});
- });
- describe(".ERROR", () => {
- it("resolves to correct value for ERROR enum property", () => {
- expect(freeclimb.LogLevel.ERROR).toBe("error");
+ describe(".ERROR", () => {
+ it("resolves to correct value for ERROR enum property", () => {
+ expect(freeclimb.LogLevel.ERROR).toBe("error");
+ });
});
});
});
diff --git a/__tests__/models/LogList.spec.ts b/__tests__/models/LogList.spec.ts
index 6f7e07e..fe9854e 100644
--- a/__tests__/models/LogList.spec.ts
+++ b/__tests__/models/LogList.spec.ts
@@ -2,67 +2,158 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("LogList", () => {
- let model: freeclimb.LogList = new freeclimb.LogList({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- logs: [],
- });
- describe("LogList class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.LogList);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.LogList;
+ let model: freeclimb.LogList = new freeclimb.LogList({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ logs: [],
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe("LogList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.LogList);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".logs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.LogResult[] = [];
+ expect(model.logs).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.LogList;
+ let model: freeclimb.LogList = new freeclimb.LogList({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ logs: [],
+ });
+ describe("LogList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.LogList);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".logs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.LogResult[] = [];
+ expect(model.logs).toStrictEqual(value);
+ });
});
});
- describe(".logs", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.LogResult[] = [];
- expect(model.logs).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.LogList;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.LogList = new freeclimb.LogList(constructorArguments);
+
+ describe("#logs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "logs",
+ )?.defaultValue;
+ expect(model.logs).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/LogResult.spec.ts b/__tests__/models/LogResult.spec.ts
index 257bfee..6993da0 100644
--- a/__tests__/models/LogResult.spec.ts
+++ b/__tests__/models/LogResult.spec.ts
@@ -2,61 +2,188 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("LogResult", () => {
- let model: freeclimb.LogResult = new freeclimb.LogResult({
- timestamp: 1,
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.LogResult;
+ let model: freeclimb.LogResult = new freeclimb.LogResult({
+ timestamp: 1,
- level: freeclimb.LogLevel.INFO,
- requestId: "test_requestId",
- accountId: "test_accountId",
- callId: "test_callId",
- message: "test_message",
- metadata: {},
- });
- describe("LogResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.LogResult);
+ level: freeclimb.LogLevel.INFO,
+ requestId: "test_requestId",
+ accountId: "test_accountId",
+ callId: "test_callId",
+ message: "test_message",
+ metadata: {},
});
- });
- describe(".timestamp", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.timestamp).toBe(value);
+ describe("LogResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.LogResult);
+ });
});
- });
- describe(".level", () => {
- it("resolves to particular value on initialization", () => {
- const value = "info";
- expect(model.level).toBe(value);
+ describe(".timestamp", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.timestamp).toBe(value);
+ });
});
- });
- describe(".requestId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestId";
- expect(model.requestId).toBe(value);
+ describe(".level", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "info";
+ expect(model.level).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".requestId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestId";
+ expect(model.requestId).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".message", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_message";
+ expect(model.message).toBe(value);
+ });
+ });
+ describe(".metadata", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = {};
+ expect(model.metadata).toStrictEqual(value);
+ });
});
});
- describe(".message", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_message";
- expect(model.message).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.LogResult;
+ let model: freeclimb.LogResult = new freeclimb.LogResult({
+ timestamp: 0,
+
+ level: freeclimb.LogLevel.INFO,
+ requestId: "",
+ accountId: "",
+ callId: "",
+ message: "",
+ metadata: {},
+ });
+ describe("LogResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.LogResult);
+ });
+ });
+ describe(".timestamp", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.timestamp).toBe(value);
+ });
+ });
+ describe(".level", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "info";
+ expect(model.level).toBe(value);
+ });
+ });
+ describe(".requestId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".message", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.message).toBe(value);
+ });
+ });
+ describe(".metadata", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = {};
+ expect(model.metadata).toStrictEqual(value);
+ });
});
});
- describe(".metadata", () => {
- it("resolves to particular value on initialization", () => {
- const value = {};
- expect(model.metadata).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.LogResult;
+ let constructorArguments = {};
+ let model: freeclimb.LogResult = new freeclimb.LogResult(
+ constructorArguments,
+ );
+
+ describe("#timestamp", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "timestamp",
+ )?.defaultValue;
+ expect(model.timestamp).toBe(value);
+ });
+ });
+ describe("#level", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "level",
+ )?.defaultValue;
+ expect(model.level).toBe(value);
+ });
+ });
+ describe("#requestId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestId",
+ )?.defaultValue;
+ expect(model.requestId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#message", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "message",
+ )?.defaultValue;
+ expect(model.message).toBe(value);
+ });
+ });
+ describe("#metadata", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "metadata",
+ )?.defaultValue;
+ expect(model.metadata).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/MachineDetectedWebhook.spec.ts b/__tests__/models/MachineDetectedWebhook.spec.ts
index 239ee29..d082ae9 100644
--- a/__tests__/models/MachineDetectedWebhook.spec.ts
+++ b/__tests__/models/MachineDetectedWebhook.spec.ts
@@ -2,102 +2,301 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("MachineDetectedWebhook", () => {
- let model: freeclimb.MachineDetectedWebhook =
- new freeclimb.MachineDetectedWebhook({
- requestType: "test_requestType",
- callId: "test_callId",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.MachineDetectedWebhook;
+ let model: freeclimb.MachineDetectedWebhook =
+ new freeclimb.MachineDetectedWebhook({
+ requestType: "test_requestType",
+ callId: "test_callId",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
- parentCallId: "test_parentCallId",
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
+ parentCallId: "test_parentCallId",
- machineType: freeclimb.MachineType.ANSWERING_MACHINE,
+ machineType: freeclimb.MachineType.ANSWERING_MACHINE,
+ });
+ describe("MachineDetectedWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MachineDetectedWebhook);
+ });
});
- describe("MachineDetectedWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.MachineDetectedWebhook);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_parentCallId";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".machineType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "answering machine";
+ expect(model.machineType).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of MachineDetectedWebhook", () => {
+ expect(
+ freeclimb.MachineDetectedWebhook.deserialize(
+ '{ "requestType": "machineDetected"}',
+ ),
+ ).toBeInstanceOf(freeclimb.MachineDetectedWebhook);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.MachineDetectedWebhook;
+ let model: freeclimb.MachineDetectedWebhook =
+ new freeclimb.MachineDetectedWebhook({
+ requestType: "",
+ callId: "",
+ accountId: "",
+ from: "",
+ to: "",
+
+ callStatus: freeclimb.CallStatus.QUEUED,
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+ parentCallId: "",
+
+ machineType: freeclimb.MachineType.ANSWERING_MACHINE,
+ });
+ describe("MachineDetectedWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MachineDetectedWebhook);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".parentCallId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_parentCallId";
- expect(model.parentCallId).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
});
- });
- describe(".machineType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "answering machine";
- expect(model.machineType).toBe(value);
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".machineType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "answering machine";
+ expect(model.machineType).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of MachineDetectedWebhook", () => {
+ expect(
+ freeclimb.MachineDetectedWebhook.deserialize(
+ '{ "requestType": "machineDetected"}',
+ ),
+ ).toBeInstanceOf(freeclimb.MachineDetectedWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of MachineDetectedWebhook", () => {
- expect(
- freeclimb.MachineDetectedWebhook.deserialize(
- '{ "requestType": "machineDetected"}',
- ),
- ).toBeInstanceOf(freeclimb.MachineDetectedWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.MachineDetectedWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.MachineDetectedWebhook =
+ new freeclimb.MachineDetectedWebhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#parentCallId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "parentCallId",
+ )?.defaultValue;
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe("#machineType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "machineType",
+ )?.defaultValue;
+ expect(model.machineType).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/MachineType.spec.ts b/__tests__/models/MachineType.spec.ts
index b588a8b..c7726c2 100644
--- a/__tests__/models/MachineType.spec.ts
+++ b/__tests__/models/MachineType.spec.ts
@@ -2,14 +2,18 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("MachineType", () => {
- describe(".ANSWERING_MACHINE", () => {
- it("resolves to correct value for ANSWERING_MACHINE enum property", () => {
- expect(freeclimb.MachineType.ANSWERING_MACHINE).toBe("answering machine");
+ describe("Test with truthy values", () => {
+ describe(".ANSWERING_MACHINE", () => {
+ it("resolves to correct value for ANSWERING_MACHINE enum property", () => {
+ expect(freeclimb.MachineType.ANSWERING_MACHINE).toBe(
+ "answering machine",
+ );
+ });
});
- });
- describe(".FAX_MODEM", () => {
- it("resolves to correct value for FAX_MODEM enum property", () => {
- expect(freeclimb.MachineType.FAX_MODEM).toBe("fax modem");
+ describe(".FAX_MODEM", () => {
+ it("resolves to correct value for FAX_MODEM enum property", () => {
+ expect(freeclimb.MachineType.FAX_MODEM).toBe("fax modem");
+ });
});
});
});
diff --git a/__tests__/models/MakeCallRequest.spec.ts b/__tests__/models/MakeCallRequest.spec.ts
index 91ea4fb..403d767 100644
--- a/__tests__/models/MakeCallRequest.spec.ts
+++ b/__tests__/models/MakeCallRequest.spec.ts
@@ -2,81 +2,249 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("MakeCallRequest", () => {
- let model: freeclimb.MakeCallRequest = new freeclimb.MakeCallRequest({
- from: "test_from",
- to: "test_to",
- applicationId: "test_applicationId",
- sendDigits: "test_sendDigits",
- ifMachine: "test_ifMachine",
- ifMachineUrl: "https://123.abc",
- timeout: 1,
- parentCallId: "test_parentCallId",
- privacyMode: true,
- callConnectUrl: "https://123.abc",
- });
- describe("MakeCallRequest class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.MakeCallRequest);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.MakeCallRequest;
+ let model: freeclimb.MakeCallRequest = new freeclimb.MakeCallRequest({
+ from: "test_from",
+ to: "test_to",
+ applicationId: "test_applicationId",
+ sendDigits: "test_sendDigits",
+ ifMachine: "test_ifMachine",
+ ifMachineUrl: "https://123.abc",
+ timeout: 1,
+ parentCallId: "test_parentCallId",
+ privacyMode: true,
+ callConnectUrl: "https://123.abc",
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe("MakeCallRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MakeCallRequest);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".applicationId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_applicationId";
- expect(model.applicationId).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".sendDigits", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_sendDigits";
- expect(model.sendDigits).toBe(value);
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_applicationId";
+ expect(model.applicationId).toBe(value);
+ });
});
- });
- describe(".ifMachine", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_ifMachine";
- expect(model.ifMachine).toBe(value);
+ describe(".sendDigits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_sendDigits";
+ expect(model.sendDigits).toBe(value);
+ });
});
- });
- describe(".ifMachineUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.ifMachineUrl).toBe(value);
+ describe(".ifMachine", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_ifMachine";
+ expect(model.ifMachine).toBe(value);
+ });
});
- });
- describe(".timeout", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.timeout).toBe(value);
+ describe(".ifMachineUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.ifMachineUrl).toBe(value);
+ });
});
- });
- describe(".parentCallId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_parentCallId";
- expect(model.parentCallId).toBe(value);
+ describe(".timeout", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.timeout).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_parentCallId";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.privacyMode).toBe(value);
+ });
+ });
+ describe(".callConnectUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.callConnectUrl).toBe(value);
+ });
});
});
- describe(".privacyMode", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.privacyMode).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.MakeCallRequest;
+ let model: freeclimb.MakeCallRequest = new freeclimb.MakeCallRequest({
+ from: "",
+ to: "",
+ applicationId: "",
+ sendDigits: "",
+ ifMachine: "",
+ ifMachineUrl: "",
+ timeout: 0,
+ parentCallId: "",
+ privacyMode: false,
+ callConnectUrl: "",
+ });
+ describe("MakeCallRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MakeCallRequest);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.applicationId).toBe(value);
+ });
+ });
+ describe(".sendDigits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.sendDigits).toBe(value);
+ });
+ });
+ describe(".ifMachine", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.ifMachine).toBe(value);
+ });
+ });
+ describe(".ifMachineUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.ifMachineUrl).toBe(value);
+ });
+ });
+ describe(".timeout", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.timeout).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.privacyMode).toBe(value);
+ });
+ });
+ describe(".callConnectUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callConnectUrl).toBe(value);
+ });
});
});
- describe(".callConnectUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.callConnectUrl).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.MakeCallRequest;
+ let constructorArguments = {
+ from: "test_from",
+ to: "test_to",
+ };
+ let model: freeclimb.MakeCallRequest = new freeclimb.MakeCallRequest(
+ constructorArguments,
+ );
+
+ describe("#from", () => {
+ it("resolves to initialization value", () => {
+ expect(model.from).toBe(constructorArguments["from"]);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to initialization value", () => {
+ expect(model.to).toBe(constructorArguments["to"]);
+ });
+ });
+ describe("#applicationId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "applicationId",
+ )?.defaultValue;
+ expect(model.applicationId).toBe(value);
+ });
+ });
+ describe("#sendDigits", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "sendDigits",
+ )?.defaultValue;
+ expect(model.sendDigits).toBe(value);
+ });
+ });
+ describe("#ifMachine", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "ifMachine",
+ )?.defaultValue;
+ expect(model.ifMachine).toBe(value);
+ });
+ });
+ describe("#ifMachineUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "ifMachineUrl",
+ )?.defaultValue;
+ expect(model.ifMachineUrl).toBe(value);
+ });
+ });
+ describe("#timeout", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "timeout",
+ )?.defaultValue;
+ expect(model.timeout).toBe(value);
+ });
+ });
+ describe("#parentCallId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "parentCallId",
+ )?.defaultValue;
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe("#privacyMode", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "privacyMode",
+ )?.defaultValue;
+ expect(model.privacyMode).toBe(value);
+ });
+ });
+ describe("#callConnectUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callConnectUrl",
+ )?.defaultValue;
+ expect(model.callConnectUrl).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/MessageDeliveryWebhook.spec.ts b/__tests__/models/MessageDeliveryWebhook.spec.ts
index aec8033..7ddca61 100644
--- a/__tests__/models/MessageDeliveryWebhook.spec.ts
+++ b/__tests__/models/MessageDeliveryWebhook.spec.ts
@@ -2,92 +2,273 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("MessageDeliveryWebhook", () => {
- let model: freeclimb.MessageDeliveryWebhook =
- new freeclimb.MessageDeliveryWebhook({
- requestType: "test_requestType",
- accountId: "test_accountId",
- from: "test_from",
- to: "test_to",
- text: "test_text",
- direction: "test_direction",
- applicationId: "test_applicationId",
- status: "test_status",
- phoneNumberId: "test_phoneNumberId",
- uri: "test_uri",
- });
- describe("MessageDeliveryWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.MessageDeliveryWebhook);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.MessageDeliveryWebhook;
+ let model: freeclimb.MessageDeliveryWebhook =
+ new freeclimb.MessageDeliveryWebhook({
+ requestType: "test_requestType",
+ accountId: "test_accountId",
+ from: "test_from",
+ to: "test_to",
+ text: "test_text",
+ direction: "test_direction",
+ applicationId: "test_applicationId",
+ status: "test_status",
+ phoneNumberId: "test_phoneNumberId",
+ uri: "test_uri",
+ });
+ describe("MessageDeliveryWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MessageDeliveryWebhook);
+ });
});
- });
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".text", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_text";
- expect(model.text).toBe(value);
+ describe(".text", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_text";
+ expect(model.text).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_direction";
- expect(model.direction).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_direction";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".applicationId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_applicationId";
- expect(model.applicationId).toBe(value);
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_applicationId";
+ expect(model.applicationId).toBe(value);
+ });
});
- });
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_status";
- expect(model.status).toBe(value);
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_status";
+ expect(model.status).toBe(value);
+ });
});
- });
- describe(".phoneNumberId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_phoneNumberId";
- expect(model.phoneNumberId).toBe(value);
+ describe(".phoneNumberId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_phoneNumberId";
+ expect(model.phoneNumberId).toBe(value);
+ });
+ });
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_uri";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of MessageDeliveryWebhook", () => {
+ expect(
+ freeclimb.MessageDeliveryWebhook.deserialize(
+ '{ "requestType": "messageDelivery"}',
+ ),
+ ).toBeInstanceOf(freeclimb.MessageDeliveryWebhook);
+ });
});
});
- describe(".uri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_uri";
- expect(model.uri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.MessageDeliveryWebhook;
+ let model: freeclimb.MessageDeliveryWebhook =
+ new freeclimb.MessageDeliveryWebhook({
+ requestType: "",
+ accountId: "",
+ from: "",
+ to: "",
+ text: "",
+ direction: "",
+ applicationId: "",
+ status: "",
+ phoneNumberId: "",
+ uri: "",
+ });
+ describe("MessageDeliveryWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MessageDeliveryWebhook);
+ });
+ });
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".text", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.text).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.applicationId).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".phoneNumberId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.phoneNumberId).toBe(value);
+ });
+ });
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of MessageDeliveryWebhook", () => {
+ expect(
+ freeclimb.MessageDeliveryWebhook.deserialize(
+ '{ "requestType": "messageDelivery"}',
+ ),
+ ).toBeInstanceOf(freeclimb.MessageDeliveryWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of MessageDeliveryWebhook", () => {
- expect(
- freeclimb.MessageDeliveryWebhook.deserialize(
- '{ "requestType": "messageDelivery"}',
- ),
- ).toBeInstanceOf(freeclimb.MessageDeliveryWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.MessageDeliveryWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.MessageDeliveryWebhook =
+ new freeclimb.MessageDeliveryWebhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#text", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "text",
+ )?.defaultValue;
+ expect(model.text).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#applicationId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "applicationId",
+ )?.defaultValue;
+ expect(model.applicationId).toBe(value);
+ });
+ });
+ describe("#status", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "status",
+ )?.defaultValue;
+ expect(model.status).toBe(value);
+ });
+ });
+ describe("#phoneNumberId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "phoneNumberId",
+ )?.defaultValue;
+ expect(model.phoneNumberId).toBe(value);
+ });
+ });
+ describe("#uri", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "uri",
+ )?.defaultValue;
+ expect(model.uri).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/MessageDirection.spec.ts b/__tests__/models/MessageDirection.spec.ts
index 274a8d1..770c7bd 100644
--- a/__tests__/models/MessageDirection.spec.ts
+++ b/__tests__/models/MessageDirection.spec.ts
@@ -2,14 +2,16 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("MessageDirection", () => {
- describe(".INBOUND", () => {
- it("resolves to correct value for INBOUND enum property", () => {
- expect(freeclimb.MessageDirection.INBOUND).toBe("inbound");
+ describe("Test with truthy values", () => {
+ describe(".INBOUND", () => {
+ it("resolves to correct value for INBOUND enum property", () => {
+ expect(freeclimb.MessageDirection.INBOUND).toBe("inbound");
+ });
});
- });
- describe(".OUTBOUND", () => {
- it("resolves to correct value for OUTBOUND enum property", () => {
- expect(freeclimb.MessageDirection.OUTBOUND).toBe("outbound");
+ describe(".OUTBOUND", () => {
+ it("resolves to correct value for OUTBOUND enum property", () => {
+ expect(freeclimb.MessageDirection.OUTBOUND).toBe("outbound");
+ });
});
});
});
diff --git a/__tests__/models/MessageRequest.spec.ts b/__tests__/models/MessageRequest.spec.ts
index 528955f..73449b2 100644
--- a/__tests__/models/MessageRequest.spec.ts
+++ b/__tests__/models/MessageRequest.spec.ts
@@ -2,74 +2,197 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("MessageRequest", () => {
- let model: freeclimb.MessageRequest = new freeclimb.MessageRequest({
- uri: "test_uri",
- dateCreated: "test_dateCreated",
- dateUpdated: "test_dateUpdated",
- revision: 1,
- from: "test_from",
- to: "test_to",
- text: "test_text",
- notificationUrl: "https://123.abc",
- mediaUrls: [],
- });
- describe("MessageRequest class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.MessageRequest);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.MessageRequest;
+ let model: freeclimb.MessageRequest = new freeclimb.MessageRequest({
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ from: "test_from",
+ to: "test_to",
+ text: "test_text",
+ notificationUrl: "https://123.abc",
+ mediaUrls: [],
});
- });
- describe(".uri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_uri";
- expect(model.uri).toBe(value);
+ describe("MessageRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MessageRequest);
+ });
});
- });
- describe(".dateCreated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreated";
- expect(model.dateCreated).toBe(value);
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_uri";
+ expect(model.uri).toBe(value);
+ });
});
- });
- describe(".dateUpdated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdated";
- expect(model.dateUpdated).toBe(value);
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreated";
+ expect(model.dateCreated).toBe(value);
+ });
});
- });
- describe(".revision", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.revision).toBe(value);
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdated";
+ expect(model.dateUpdated).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.revision).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".text", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_text";
- expect(model.text).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".text", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_text";
+ expect(model.text).toBe(value);
+ });
+ });
+ describe(".notificationUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.notificationUrl).toBe(value);
+ });
+ });
+ describe(".mediaUrls", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: any[] = [];
+ expect(model.mediaUrls).toStrictEqual(value);
+ });
});
});
- describe(".notificationUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.notificationUrl).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.MessageRequest;
+ let model: freeclimb.MessageRequest = new freeclimb.MessageRequest({
+ uri: "",
+ dateCreated: "",
+ dateUpdated: "",
+ revision: 0,
+ from: "",
+ to: "",
+ text: "",
+ notificationUrl: "",
+ mediaUrls: [],
+ });
+ describe("MessageRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MessageRequest);
+ });
+ });
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.revision).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".text", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.text).toBe(value);
+ });
+ });
+ describe(".notificationUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.notificationUrl).toBe(value);
+ });
+ });
+ describe(".mediaUrls", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: any[] = [];
+ expect(model.mediaUrls).toStrictEqual(value);
+ });
});
});
- describe(".mediaUrls", () => {
- it("resolves to particular value on initialization", () => {
- const value: any[] = [];
- expect(model.mediaUrls).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.MessageRequest;
+ let constructorArguments = {
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ from: "test_from",
+ to: "test_to",
+ text: "test_text",
+ };
+ let model: freeclimb.MessageRequest = new freeclimb.MessageRequest(
+ constructorArguments,
+ );
+
+ describe("#from", () => {
+ it("resolves to initialization value", () => {
+ expect(model.from).toBe(constructorArguments["from"]);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to initialization value", () => {
+ expect(model.to).toBe(constructorArguments["to"]);
+ });
+ });
+ describe("#text", () => {
+ it("resolves to initialization value", () => {
+ expect(model.text).toBe(constructorArguments["text"]);
+ });
+ });
+ describe("#notificationUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "notificationUrl",
+ )?.defaultValue;
+ expect(model.notificationUrl).toBe(value);
+ });
+ });
+ describe("#mediaUrls", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "mediaUrls",
+ )?.defaultValue;
+ expect(model.mediaUrls).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/MessageResult.spec.ts b/__tests__/models/MessageResult.spec.ts
index 0c8073b..5f0e9f5 100644
--- a/__tests__/models/MessageResult.spec.ts
+++ b/__tests__/models/MessageResult.spec.ts
@@ -2,150 +2,435 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("MessageResult", () => {
- let model: freeclimb.MessageResult = new freeclimb.MessageResult({
- uri: "test_uri",
- dateCreated: "test_dateCreated",
- dateUpdated: "test_dateUpdated",
- revision: 1,
- accountId: "test_accountId",
- messageId: "test_messageId",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.MessageResult;
+ let model: freeclimb.MessageResult = new freeclimb.MessageResult({
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ accountId: "test_accountId",
+ messageId: "test_messageId",
- status: freeclimb.MessageStatus.NEW,
- from: "test_from",
- to: "test_to",
- text: "test_text",
- direction: "test_direction",
- notificationUrl: "https://123.abc",
- brandId: "test_brandId",
- campaignId: "test_campaignId",
- segmentCount: 1.0,
- mediaUrls: [],
+ status: freeclimb.MessageStatus.NEW,
+ from: "test_from",
+ to: "test_to",
+ text: "test_text",
+ direction: "test_direction",
+ notificationUrl: "https://123.abc",
+ brandId: "test_brandId",
+ campaignId: "test_campaignId",
+ segmentCount: 1.0,
+ mediaUrls: [],
- tfn: new freeclimb.TFN({
- campaignId: null as any,
- }),
- phoneNumberId: "test_phoneNumberId",
- applicationId: "test_applicationId",
- });
- describe("MessageResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.MessageResult);
+ tfn: new freeclimb.TFN({
+ campaignId: null as any,
+ }),
+ phoneNumberId: "test_phoneNumberId",
+ applicationId: "test_applicationId",
});
- });
- describe(".uri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_uri";
- expect(model.uri).toBe(value);
+ describe("MessageResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MessageResult);
+ });
});
- });
- describe(".dateCreated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreated";
- expect(model.dateCreated).toBe(value);
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_uri";
+ expect(model.uri).toBe(value);
+ });
});
- });
- describe(".dateUpdated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdated";
- expect(model.dateUpdated).toBe(value);
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreated";
+ expect(model.dateCreated).toBe(value);
+ });
});
- });
- describe(".revision", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.revision).toBe(value);
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdated";
+ expect(model.dateUpdated).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.revision).toBe(value);
+ });
});
- });
- describe(".messageId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_messageId";
- expect(model.messageId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "new";
- expect(model.status).toBe(value);
+ describe(".messageId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_messageId";
+ expect(model.messageId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "new";
+ expect(model.status).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".text", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_text";
- expect(model.text).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_direction";
- expect(model.direction).toBe(value);
+ describe(".text", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_text";
+ expect(model.text).toBe(value);
+ });
});
- });
- describe(".notificationUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.notificationUrl).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_direction";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".brandId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_brandId";
- expect(model.brandId).toBe(value);
+ describe(".notificationUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.notificationUrl).toBe(value);
+ });
});
- });
- describe(".campaignId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_campaignId";
- expect(model.campaignId).toBe(value);
+ describe(".brandId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_brandId";
+ expect(model.brandId).toBe(value);
+ });
});
- });
- describe(".segmentCount", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1.0;
- expect(model.segmentCount).toBe(value);
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_campaignId";
+ expect(model.campaignId).toBe(value);
+ });
});
- });
- describe(".mediaUrls", () => {
- it("resolves to particular value on initialization", () => {
- const value: any[] = [];
- expect(model.mediaUrls).toStrictEqual(value);
+ describe(".segmentCount", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1.0;
+ expect(model.segmentCount).toBe(value);
+ });
+ });
+ describe(".mediaUrls", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: any[] = [];
+ expect(model.mediaUrls).toStrictEqual(value);
+ });
+ });
+ describe(".tfn", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new freeclimb.TFN({
+ campaignId: null as any,
+ });
+ expect(model.tfn).toStrictEqual(value);
+ });
+ });
+ describe(".phoneNumberId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_phoneNumberId";
+ expect(model.phoneNumberId).toBe(value);
+ });
+ });
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_applicationId";
+ expect(model.applicationId).toBe(value);
+ });
});
});
- describe(".tfn", () => {
- it("resolves to particular value on initialization", () => {
- const value = new freeclimb.TFN({
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.MessageResult;
+ let model: freeclimb.MessageResult = new freeclimb.MessageResult({
+ uri: "",
+ dateCreated: "",
+ dateUpdated: "",
+ revision: 0,
+ accountId: "",
+ messageId: "",
+
+ status: freeclimb.MessageStatus.NEW,
+ from: "",
+ to: "",
+ text: "",
+ direction: "",
+ notificationUrl: "",
+ brandId: "",
+ campaignId: "",
+ segmentCount: 0.0,
+ mediaUrls: [],
+
+ tfn: new freeclimb.TFN({
campaignId: null as any,
+ }),
+ phoneNumberId: "",
+ applicationId: "",
+ });
+ describe("MessageResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MessageResult);
});
- expect(model.tfn).toStrictEqual(value);
});
- });
- describe(".phoneNumberId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_phoneNumberId";
- expect(model.phoneNumberId).toBe(value);
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.revision).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".messageId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.messageId).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "new";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".text", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.text).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".notificationUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.notificationUrl).toBe(value);
+ });
+ });
+ describe(".brandId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.brandId).toBe(value);
+ });
+ });
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.campaignId).toBe(value);
+ });
+ });
+ describe(".segmentCount", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0.0;
+ expect(model.segmentCount).toBe(value);
+ });
+ });
+ describe(".mediaUrls", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: any[] = [];
+ expect(model.mediaUrls).toStrictEqual(value);
+ });
+ });
+ describe(".tfn", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new freeclimb.TFN({
+ campaignId: null as any,
+ });
+ expect(model.tfn).toStrictEqual(value);
+ });
+ });
+ describe(".phoneNumberId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.phoneNumberId).toBe(value);
+ });
+ });
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.applicationId).toBe(value);
+ });
});
});
- describe(".applicationId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_applicationId";
- expect(model.applicationId).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.MessageResult;
+ let constructorArguments = {
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ };
+ let model: freeclimb.MessageResult = new freeclimb.MessageResult(
+ constructorArguments,
+ );
+
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#messageId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "messageId",
+ )?.defaultValue;
+ expect(model.messageId).toBe(value);
+ });
+ });
+ describe("#status", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "status",
+ )?.defaultValue;
+ expect(model.status).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#text", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "text",
+ )?.defaultValue;
+ expect(model.text).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#notificationUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "notificationUrl",
+ )?.defaultValue;
+ expect(model.notificationUrl).toBe(value);
+ });
+ });
+ describe("#brandId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "brandId",
+ )?.defaultValue;
+ expect(model.brandId).toBe(value);
+ });
+ });
+ describe("#campaignId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "campaignId",
+ )?.defaultValue;
+ expect(model.campaignId).toBe(value);
+ });
+ });
+ describe("#segmentCount", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "segmentCount",
+ )?.defaultValue;
+ expect(model.segmentCount).toBe(value);
+ });
+ });
+ describe("#mediaUrls", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "mediaUrls",
+ )?.defaultValue;
+ expect(model.mediaUrls).toBe(value);
+ });
+ });
+ describe("#tfn", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "tfn",
+ )?.defaultValue;
+ expect(model.tfn).toBe(value);
+ });
+ });
+ describe("#phoneNumberId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "phoneNumberId",
+ )?.defaultValue;
+ expect(model.phoneNumberId).toBe(value);
+ });
+ });
+ describe("#applicationId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "applicationId",
+ )?.defaultValue;
+ expect(model.applicationId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/MessageStatus.spec.ts b/__tests__/models/MessageStatus.spec.ts
index abe20f0..bc7a88e 100644
--- a/__tests__/models/MessageStatus.spec.ts
+++ b/__tests__/models/MessageStatus.spec.ts
@@ -2,59 +2,61 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("MessageStatus", () => {
- describe(".NEW", () => {
- it("resolves to correct value for NEW enum property", () => {
- expect(freeclimb.MessageStatus.NEW).toBe("new");
- });
- });
- describe(".QUEUED", () => {
- it("resolves to correct value for QUEUED enum property", () => {
- expect(freeclimb.MessageStatus.QUEUED).toBe("queued");
- });
- });
- describe(".REJECTED", () => {
- it("resolves to correct value for REJECTED enum property", () => {
- expect(freeclimb.MessageStatus.REJECTED).toBe("rejected");
- });
- });
- describe(".SENDING", () => {
- it("resolves to correct value for SENDING enum property", () => {
- expect(freeclimb.MessageStatus.SENDING).toBe("sending");
- });
- });
- describe(".SENT", () => {
- it("resolves to correct value for SENT enum property", () => {
- expect(freeclimb.MessageStatus.SENT).toBe("sent");
- });
- });
- describe(".FAILED", () => {
- it("resolves to correct value for FAILED enum property", () => {
- expect(freeclimb.MessageStatus.FAILED).toBe("failed");
- });
- });
- describe(".RECEIVED", () => {
- it("resolves to correct value for RECEIVED enum property", () => {
- expect(freeclimb.MessageStatus.RECEIVED).toBe("received");
- });
- });
- describe(".UNDELIVERED", () => {
- it("resolves to correct value for UNDELIVERED enum property", () => {
- expect(freeclimb.MessageStatus.UNDELIVERED).toBe("undelivered");
- });
- });
- describe(".EXPIRED", () => {
- it("resolves to correct value for EXPIRED enum property", () => {
- expect(freeclimb.MessageStatus.EXPIRED).toBe("expired");
- });
- });
- describe(".DELETED", () => {
- it("resolves to correct value for DELETED enum property", () => {
- expect(freeclimb.MessageStatus.DELETED).toBe("deleted");
- });
- });
- describe(".UNKNOWN", () => {
- it("resolves to correct value for UNKNOWN enum property", () => {
- expect(freeclimb.MessageStatus.UNKNOWN).toBe("unknown");
+ describe("Test with truthy values", () => {
+ describe(".NEW", () => {
+ it("resolves to correct value for NEW enum property", () => {
+ expect(freeclimb.MessageStatus.NEW).toBe("new");
+ });
+ });
+ describe(".QUEUED", () => {
+ it("resolves to correct value for QUEUED enum property", () => {
+ expect(freeclimb.MessageStatus.QUEUED).toBe("queued");
+ });
+ });
+ describe(".REJECTED", () => {
+ it("resolves to correct value for REJECTED enum property", () => {
+ expect(freeclimb.MessageStatus.REJECTED).toBe("rejected");
+ });
+ });
+ describe(".SENDING", () => {
+ it("resolves to correct value for SENDING enum property", () => {
+ expect(freeclimb.MessageStatus.SENDING).toBe("sending");
+ });
+ });
+ describe(".SENT", () => {
+ it("resolves to correct value for SENT enum property", () => {
+ expect(freeclimb.MessageStatus.SENT).toBe("sent");
+ });
+ });
+ describe(".FAILED", () => {
+ it("resolves to correct value for FAILED enum property", () => {
+ expect(freeclimb.MessageStatus.FAILED).toBe("failed");
+ });
+ });
+ describe(".RECEIVED", () => {
+ it("resolves to correct value for RECEIVED enum property", () => {
+ expect(freeclimb.MessageStatus.RECEIVED).toBe("received");
+ });
+ });
+ describe(".UNDELIVERED", () => {
+ it("resolves to correct value for UNDELIVERED enum property", () => {
+ expect(freeclimb.MessageStatus.UNDELIVERED).toBe("undelivered");
+ });
+ });
+ describe(".EXPIRED", () => {
+ it("resolves to correct value for EXPIRED enum property", () => {
+ expect(freeclimb.MessageStatus.EXPIRED).toBe("expired");
+ });
+ });
+ describe(".DELETED", () => {
+ it("resolves to correct value for DELETED enum property", () => {
+ expect(freeclimb.MessageStatus.DELETED).toBe("deleted");
+ });
+ });
+ describe(".UNKNOWN", () => {
+ it("resolves to correct value for UNKNOWN enum property", () => {
+ expect(freeclimb.MessageStatus.UNKNOWN).toBe("unknown");
+ });
});
});
});
diff --git a/__tests__/models/MessageStatusWebhook.spec.ts b/__tests__/models/MessageStatusWebhook.spec.ts
index fec2111..a8c4305 100644
--- a/__tests__/models/MessageStatusWebhook.spec.ts
+++ b/__tests__/models/MessageStatusWebhook.spec.ts
@@ -2,100 +2,297 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("MessageStatusWebhook", () => {
- let model: freeclimb.MessageStatusWebhook =
- new freeclimb.MessageStatusWebhook({
- requestType: "test_requestType",
- accountId: "test_accountId",
- messageId: "test_messageId",
- callId: "test_callId",
- from: "test_from",
- to: "test_to",
- text: "test_text",
- direction: "test_direction",
- applicationId: "test_applicationId",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.MessageStatusWebhook;
+ let model: freeclimb.MessageStatusWebhook =
+ new freeclimb.MessageStatusWebhook({
+ requestType: "test_requestType",
+ accountId: "test_accountId",
+ messageId: "test_messageId",
+ callId: "test_callId",
+ from: "test_from",
+ to: "test_to",
+ text: "test_text",
+ direction: "test_direction",
+ applicationId: "test_applicationId",
- status: freeclimb.MessageStatus.NEW,
- phoneNumberId: "test_phoneNumberId",
+ status: freeclimb.MessageStatus.NEW,
+ phoneNumberId: "test_phoneNumberId",
+ });
+ describe("MessageStatusWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MessageStatusWebhook);
+ });
});
- describe("MessageStatusWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.MessageStatusWebhook);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".messageId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_messageId";
+ expect(model.messageId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".text", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_text";
+ expect(model.text).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_direction";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_applicationId";
+ expect(model.applicationId).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "new";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".phoneNumberId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_phoneNumberId";
+ expect(model.phoneNumberId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of MessageStatusWebhook", () => {
+ expect(
+ freeclimb.MessageStatusWebhook.deserialize(
+ '{ "requestType": "messageStatus"}',
+ ),
+ ).toBeInstanceOf(freeclimb.MessageStatusWebhook);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.MessageStatusWebhook;
+ let model: freeclimb.MessageStatusWebhook =
+ new freeclimb.MessageStatusWebhook({
+ requestType: "",
+ accountId: "",
+ messageId: "",
+ callId: "",
+ from: "",
+ to: "",
+ text: "",
+ direction: "",
+ applicationId: "",
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ status: freeclimb.MessageStatus.NEW,
+ phoneNumberId: "",
+ });
+ describe("MessageStatusWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MessageStatusWebhook);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".messageId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_messageId";
- expect(model.messageId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".messageId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.messageId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".text", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_text";
- expect(model.text).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_direction";
- expect(model.direction).toBe(value);
+ describe(".text", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.text).toBe(value);
+ });
});
- });
- describe(".applicationId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_applicationId";
- expect(model.applicationId).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "new";
- expect(model.status).toBe(value);
+ describe(".applicationId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.applicationId).toBe(value);
+ });
});
- });
- describe(".phoneNumberId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_phoneNumberId";
- expect(model.phoneNumberId).toBe(value);
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "new";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".phoneNumberId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.phoneNumberId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of MessageStatusWebhook", () => {
+ expect(
+ freeclimb.MessageStatusWebhook.deserialize(
+ '{ "requestType": "messageStatus"}',
+ ),
+ ).toBeInstanceOf(freeclimb.MessageStatusWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of MessageStatusWebhook", () => {
- expect(
- freeclimb.MessageStatusWebhook.deserialize(
- '{ "requestType": "messageStatus"}',
- ),
- ).toBeInstanceOf(freeclimb.MessageStatusWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.MessageStatusWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.MessageStatusWebhook =
+ new freeclimb.MessageStatusWebhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#messageId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "messageId",
+ )?.defaultValue;
+ expect(model.messageId).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#text", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "text",
+ )?.defaultValue;
+ expect(model.text).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#applicationId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "applicationId",
+ )?.defaultValue;
+ expect(model.applicationId).toBe(value);
+ });
+ });
+ describe("#status", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "status",
+ )?.defaultValue;
+ expect(model.status).toBe(value);
+ });
+ });
+ describe("#phoneNumberId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "phoneNumberId",
+ )?.defaultValue;
+ expect(model.phoneNumberId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/MessagesList.spec.ts b/__tests__/models/MessagesList.spec.ts
index a4134af..95dd51e 100644
--- a/__tests__/models/MessagesList.spec.ts
+++ b/__tests__/models/MessagesList.spec.ts
@@ -2,67 +2,160 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("MessagesList", () => {
- let model: freeclimb.MessagesList = new freeclimb.MessagesList({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- messages: [],
- });
- describe("MessagesList class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.MessagesList);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.MessagesList;
+ let model: freeclimb.MessagesList = new freeclimb.MessagesList({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ messages: [],
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe("MessagesList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MessagesList);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".messages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.MessageResult[] = [];
+ expect(model.messages).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.MessagesList;
+ let model: freeclimb.MessagesList = new freeclimb.MessagesList({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ messages: [],
+ });
+ describe("MessagesList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MessagesList);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".messages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.MessageResult[] = [];
+ expect(model.messages).toStrictEqual(value);
+ });
});
});
- describe(".messages", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.MessageResult[] = [];
- expect(model.messages).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.MessagesList;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.MessagesList = new freeclimb.MessagesList(
+ constructorArguments,
+ );
+
+ describe("#messages", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "messages",
+ )?.defaultValue;
+ expect(model.messages).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/MutableResourceModel.spec.ts b/__tests__/models/MutableResourceModel.spec.ts
index bb1cb59..49a1fb7 100644
--- a/__tests__/models/MutableResourceModel.spec.ts
+++ b/__tests__/models/MutableResourceModel.spec.ts
@@ -2,40 +2,121 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("MutableResourceModel", () => {
- let model: freeclimb.MutableResourceModel =
- new freeclimb.MutableResourceModel({
- uri: "test_uri",
- dateCreated: "test_dateCreated",
- dateUpdated: "test_dateUpdated",
- revision: 1,
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.MutableResourceModel;
+ let model: freeclimb.MutableResourceModel =
+ new freeclimb.MutableResourceModel({
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ });
+ describe("MutableResourceModel class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MutableResourceModel);
+ });
});
- describe("MutableResourceModel class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.MutableResourceModel);
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_uri";
+ expect(model.uri).toBe(value);
+ });
});
- });
- describe(".uri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_uri";
- expect(model.uri).toBe(value);
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreated";
+ expect(model.dateCreated).toBe(value);
+ });
});
- });
- describe(".dateCreated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreated";
- expect(model.dateCreated).toBe(value);
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdated";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.revision).toBe(value);
+ });
});
});
- describe(".dateUpdated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdated";
- expect(model.dateUpdated).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.MutableResourceModel;
+ let model: freeclimb.MutableResourceModel =
+ new freeclimb.MutableResourceModel({
+ uri: "",
+ dateCreated: "",
+ dateUpdated: "",
+ revision: 0,
+ });
+ describe("MutableResourceModel class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.MutableResourceModel);
+ });
+ });
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.revision).toBe(value);
+ });
});
});
- describe(".revision", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.revision).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.MutableResourceModel;
+ let constructorArguments = {};
+ let model: freeclimb.MutableResourceModel =
+ new freeclimb.MutableResourceModel(constructorArguments);
+
+ describe("#uri", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "uri",
+ )?.defaultValue;
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe("#dateCreated", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "dateCreated",
+ )?.defaultValue;
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe("#dateUpdated", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "dateUpdated",
+ )?.defaultValue;
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe("#revision", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "revision",
+ )?.defaultValue;
+ expect(model.revision).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/OutDial.spec.ts b/__tests__/models/OutDial.spec.ts
index bc9af56..8189ae4 100644
--- a/__tests__/models/OutDial.spec.ts
+++ b/__tests__/models/OutDial.spec.ts
@@ -2,83 +2,249 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("OutDial", () => {
- let model: freeclimb.OutDial = new freeclimb.OutDial({
- actionUrl: "https://123.abc",
- callConnectUrl: "https://123.abc",
- callingNumber: "test_callingNumber",
- destination: "test_destination",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.OutDial;
+ let model: freeclimb.OutDial = new freeclimb.OutDial({
+ actionUrl: "https://123.abc",
+ callConnectUrl: "https://123.abc",
+ callingNumber: "test_callingNumber",
+ destination: "test_destination",
- ifMachine: freeclimb.IfMachine.REDIRECT,
- ifMachineUrl: "https://123.abc",
- sendDigits: "test_sendDigits",
- statusCallbackUrl: "https://123.abc",
- timeout: 1,
- privacyMode: true,
- });
- describe("OutDial class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.OutDial);
+ ifMachine: freeclimb.IfMachine.REDIRECT,
+ ifMachineUrl: "https://123.abc",
+ sendDigits: "test_sendDigits",
+ statusCallbackUrl: "https://123.abc",
+ timeout: 1,
+ privacyMode: true,
+ });
+ describe("OutDial class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.OutDial);
+ });
});
- });
- describe(".actionUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.actionUrl).toBe(value);
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.actionUrl).toBe(value);
+ });
});
- });
- describe(".callConnectUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.callConnectUrl).toBe(value);
+ describe(".callConnectUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.callConnectUrl).toBe(value);
+ });
});
- });
- describe(".callingNumber", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callingNumber";
- expect(model.callingNumber).toBe(value);
+ describe(".callingNumber", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callingNumber";
+ expect(model.callingNumber).toBe(value);
+ });
});
- });
- describe(".destination", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_destination";
- expect(model.destination).toBe(value);
+ describe(".destination", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_destination";
+ expect(model.destination).toBe(value);
+ });
});
- });
- describe(".ifMachine", () => {
- it("resolves to particular value on initialization", () => {
- const value = "redirect";
- expect(model.ifMachine).toBe(value);
+ describe(".ifMachine", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "redirect";
+ expect(model.ifMachine).toBe(value);
+ });
});
- });
- describe(".ifMachineUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.ifMachineUrl).toBe(value);
+ describe(".ifMachineUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.ifMachineUrl).toBe(value);
+ });
});
- });
- describe(".sendDigits", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_sendDigits";
- expect(model.sendDigits).toBe(value);
+ describe(".sendDigits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_sendDigits";
+ expect(model.sendDigits).toBe(value);
+ });
});
- });
- describe(".statusCallbackUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.statusCallbackUrl).toBe(value);
+ describe(".statusCallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe(".timeout", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.timeout).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".timeout", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.timeout).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.OutDial;
+ let model: freeclimb.OutDial = new freeclimb.OutDial({
+ actionUrl: "",
+ callConnectUrl: "",
+ callingNumber: "",
+ destination: "",
+
+ ifMachine: freeclimb.IfMachine.REDIRECT,
+ ifMachineUrl: "",
+ sendDigits: "",
+ statusCallbackUrl: "",
+ timeout: 0,
+ privacyMode: false,
+ });
+ describe("OutDial class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.OutDial);
+ });
+ });
+
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.actionUrl).toBe(value);
+ });
+ });
+ describe(".callConnectUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callConnectUrl).toBe(value);
+ });
+ });
+ describe(".callingNumber", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callingNumber).toBe(value);
+ });
+ });
+ describe(".destination", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.destination).toBe(value);
+ });
+ });
+ describe(".ifMachine", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "redirect";
+ expect(model.ifMachine).toBe(value);
+ });
+ });
+ describe(".ifMachineUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.ifMachineUrl).toBe(value);
+ });
+ });
+ describe(".sendDigits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.sendDigits).toBe(value);
+ });
+ });
+ describe(".statusCallbackUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe(".timeout", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.timeout).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".privacyMode", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.privacyMode).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.OutDial;
+ let constructorArguments = {
+ actionUrl: "https://123.abc",
+ callConnectUrl: "https://123.abc",
+ callingNumber: "test_callingNumber",
+ destination: "test_destination",
+ };
+ let model: freeclimb.OutDial = new freeclimb.OutDial(constructorArguments);
+
+ describe("#actionUrl", () => {
+ it("resolves to initialization value", () => {
+ expect(model.actionUrl).toBe(constructorArguments["actionUrl"]);
+ });
+ });
+ describe("#callConnectUrl", () => {
+ it("resolves to initialization value", () => {
+ expect(model.callConnectUrl).toBe(
+ constructorArguments["callConnectUrl"],
+ );
+ });
+ });
+ describe("#callingNumber", () => {
+ it("resolves to initialization value", () => {
+ expect(model.callingNumber).toBe(constructorArguments["callingNumber"]);
+ });
+ });
+ describe("#destination", () => {
+ it("resolves to initialization value", () => {
+ expect(model.destination).toBe(constructorArguments["destination"]);
+ });
+ });
+ describe("#ifMachine", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "ifMachine",
+ )?.defaultValue;
+ expect(model.ifMachine).toBe(value);
+ });
+ });
+ describe("#ifMachineUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "ifMachineUrl",
+ )?.defaultValue;
+ expect(model.ifMachineUrl).toBe(value);
+ });
+ });
+ describe("#sendDigits", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "sendDigits",
+ )?.defaultValue;
+ expect(model.sendDigits).toBe(value);
+ });
+ });
+ describe("#statusCallbackUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "statusCallbackUrl",
+ )?.defaultValue;
+ expect(model.statusCallbackUrl).toBe(value);
+ });
+ });
+ describe("#timeout", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "timeout",
+ )?.defaultValue;
+ expect(model.timeout).toBe(value);
+ });
+ });
+ describe("#privacyMode", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "privacyMode",
+ )?.defaultValue;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/OutDialApiConnectWebhook.spec.ts b/__tests__/models/OutDialApiConnectWebhook.spec.ts
index 31c12bf..a92790e 100644
--- a/__tests__/models/OutDialApiConnectWebhook.spec.ts
+++ b/__tests__/models/OutDialApiConnectWebhook.spec.ts
@@ -2,94 +2,277 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("OutDialApiConnectWebhook", () => {
- let model: freeclimb.OutDialApiConnectWebhook =
- new freeclimb.OutDialApiConnectWebhook({
- requestType: "test_requestType",
- accountId: "test_accountId",
- callId: "test_callId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.OutDialApiConnectWebhook;
+ let model: freeclimb.OutDialApiConnectWebhook =
+ new freeclimb.OutDialApiConnectWebhook({
+ requestType: "test_requestType",
+ accountId: "test_accountId",
+ callId: "test_callId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
- parentCallId: "test_parentCallId",
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
+ parentCallId: "test_parentCallId",
+ });
+ describe("OutDialApiConnectWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.OutDialApiConnectWebhook);
+ });
});
- describe("OutDialApiConnectWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.OutDialApiConnectWebhook);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_parentCallId";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of OutDialApiConnectWebhook", () => {
+ expect(
+ freeclimb.OutDialApiConnectWebhook.deserialize(
+ '{ "requestType": "outDialApiConnect"}',
+ ),
+ ).toBeInstanceOf(freeclimb.OutDialApiConnectWebhook);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.OutDialApiConnectWebhook;
+ let model: freeclimb.OutDialApiConnectWebhook =
+ new freeclimb.OutDialApiConnectWebhook({
+ requestType: "",
+ accountId: "",
+ callId: "",
+ from: "",
+ to: "",
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+ parentCallId: "",
+ });
+ describe("OutDialApiConnectWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.OutDialApiConnectWebhook);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".parentCallId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_parentCallId";
- expect(model.parentCallId).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of OutDialApiConnectWebhook", () => {
+ expect(
+ freeclimb.OutDialApiConnectWebhook.deserialize(
+ '{ "requestType": "outDialApiConnect"}',
+ ),
+ ).toBeInstanceOf(freeclimb.OutDialApiConnectWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of OutDialApiConnectWebhook", () => {
- expect(
- freeclimb.OutDialApiConnectWebhook.deserialize(
- '{ "requestType": "outDialApiConnect"}',
- ),
- ).toBeInstanceOf(freeclimb.OutDialApiConnectWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.OutDialApiConnectWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.OutDialApiConnectWebhook =
+ new freeclimb.OutDialApiConnectWebhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#parentCallId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "parentCallId",
+ )?.defaultValue;
+ expect(model.parentCallId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/OutDialConnectWebhook.spec.ts b/__tests__/models/OutDialConnectWebhook.spec.ts
index 8e1850a..b6e32bc 100644
--- a/__tests__/models/OutDialConnectWebhook.spec.ts
+++ b/__tests__/models/OutDialConnectWebhook.spec.ts
@@ -2,94 +2,277 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("OutDialConnectWebhook", () => {
- let model: freeclimb.OutDialConnectWebhook =
- new freeclimb.OutDialConnectWebhook({
- requestType: "test_requestType",
- accountId: "test_accountId",
- callId: "test_callId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.OutDialConnectWebhook;
+ let model: freeclimb.OutDialConnectWebhook =
+ new freeclimb.OutDialConnectWebhook({
+ requestType: "test_requestType",
+ accountId: "test_accountId",
+ callId: "test_callId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
- parentCallId: "test_parentCallId",
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
+ parentCallId: "test_parentCallId",
+ });
+ describe("OutDialConnectWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.OutDialConnectWebhook);
+ });
});
- describe("OutDialConnectWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.OutDialConnectWebhook);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_parentCallId";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of OutDialConnectWebhook", () => {
+ expect(
+ freeclimb.OutDialConnectWebhook.deserialize(
+ '{ "requestType": "outDialConnect"}',
+ ),
+ ).toBeInstanceOf(freeclimb.OutDialConnectWebhook);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.OutDialConnectWebhook;
+ let model: freeclimb.OutDialConnectWebhook =
+ new freeclimb.OutDialConnectWebhook({
+ requestType: "",
+ accountId: "",
+ callId: "",
+ from: "",
+ to: "",
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+ parentCallId: "",
+ });
+ describe("OutDialConnectWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.OutDialConnectWebhook);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".parentCallId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_parentCallId";
- expect(model.parentCallId).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of OutDialConnectWebhook", () => {
+ expect(
+ freeclimb.OutDialConnectWebhook.deserialize(
+ '{ "requestType": "outDialConnect"}',
+ ),
+ ).toBeInstanceOf(freeclimb.OutDialConnectWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of OutDialConnectWebhook", () => {
- expect(
- freeclimb.OutDialConnectWebhook.deserialize(
- '{ "requestType": "outDialConnect"}',
- ),
- ).toBeInstanceOf(freeclimb.OutDialConnectWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.OutDialConnectWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.OutDialConnectWebhook =
+ new freeclimb.OutDialConnectWebhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#parentCallId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "parentCallId",
+ )?.defaultValue;
+ expect(model.parentCallId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/OutDialStartWebhook.spec.ts b/__tests__/models/OutDialStartWebhook.spec.ts
index 80367c3..1638d7c 100644
--- a/__tests__/models/OutDialStartWebhook.spec.ts
+++ b/__tests__/models/OutDialStartWebhook.spec.ts
@@ -2,100 +2,299 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("OutDialStartWebhook", () => {
- let model: freeclimb.OutDialStartWebhook = new freeclimb.OutDialStartWebhook({
- requestType: "test_requestType",
- accountId: "test_accountId",
- callId: "test_callId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.OutDialStartWebhook;
+ let model: freeclimb.OutDialStartWebhook =
+ new freeclimb.OutDialStartWebhook({
+ requestType: "test_requestType",
+ accountId: "test_accountId",
+ callId: "test_callId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
- dialCallId: "test_dialCallId",
- parentCallId: "test_parentCallId",
- });
- describe("OutDialStartWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.OutDialStartWebhook);
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
+ dialCallId: "test_dialCallId",
+ parentCallId: "test_parentCallId",
+ });
+ describe("OutDialStartWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.OutDialStartWebhook);
+ });
});
- });
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
});
- });
- describe(".dialCallId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dialCallId";
- expect(model.dialCallId).toBe(value);
+ describe(".dialCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dialCallId";
+ expect(model.dialCallId).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_parentCallId";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of OutDialStartWebhook", () => {
+ expect(
+ freeclimb.OutDialStartWebhook.deserialize(
+ '{ "requestType": "outDialStart"}',
+ ),
+ ).toBeInstanceOf(freeclimb.OutDialStartWebhook);
+ });
});
});
- describe(".parentCallId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_parentCallId";
- expect(model.parentCallId).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.OutDialStartWebhook;
+ let model: freeclimb.OutDialStartWebhook =
+ new freeclimb.OutDialStartWebhook({
+ requestType: "",
+ accountId: "",
+ callId: "",
+ from: "",
+ to: "",
+
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+ dialCallId: "",
+ parentCallId: "",
+ });
+ describe("OutDialStartWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.OutDialStartWebhook);
+ });
+ });
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".dialCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dialCallId).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of OutDialStartWebhook", () => {
+ expect(
+ freeclimb.OutDialStartWebhook.deserialize(
+ '{ "requestType": "outDialStart"}',
+ ),
+ ).toBeInstanceOf(freeclimb.OutDialStartWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of OutDialStartWebhook", () => {
- expect(
- freeclimb.OutDialStartWebhook.deserialize(
- '{ "requestType": "outDialStart"}',
- ),
- ).toBeInstanceOf(freeclimb.OutDialStartWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.OutDialStartWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.OutDialStartWebhook =
+ new freeclimb.OutDialStartWebhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#dialCallId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "dialCallId",
+ )?.defaultValue;
+ expect(model.dialCallId).toBe(value);
+ });
+ });
+ describe("#parentCallId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "parentCallId",
+ )?.defaultValue;
+ expect(model.parentCallId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/PaginationModel.spec.ts b/__tests__/models/PaginationModel.spec.ts
index 0349f23..4434477 100644
--- a/__tests__/models/PaginationModel.spec.ts
+++ b/__tests__/models/PaginationModel.spec.ts
@@ -2,60 +2,186 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("PaginationModel", () => {
- let model: freeclimb.PaginationModel = new freeclimb.PaginationModel({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- });
- describe("PaginationModel class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.PaginationModel);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.PaginationModel;
+ let model: freeclimb.PaginationModel = new freeclimb.PaginationModel({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe("PaginationModel class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.PaginationModel);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
});
});
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.PaginationModel;
+ let model: freeclimb.PaginationModel = new freeclimb.PaginationModel({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ });
+ describe("PaginationModel class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.PaginationModel);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.PaginationModel;
+ let constructorArguments = {};
+ let model: freeclimb.PaginationModel = new freeclimb.PaginationModel(
+ constructorArguments,
+ );
+
+ describe("#total", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "total",
+ )?.defaultValue;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe("#start", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "start",
+ )?.defaultValue;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe("#end", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "end",
+ )?.defaultValue;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe("#page", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "page",
+ )?.defaultValue;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe("#numPages", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "numPages",
+ )?.defaultValue;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe("#pageSize", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "pageSize",
+ )?.defaultValue;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe("#nextPageUri", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "nextPageUri",
+ )?.defaultValue;
+ expect(model.nextPageUri).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/Park.spec.ts b/__tests__/models/Park.spec.ts
index 81d7ccb..2f6f62a 100644
--- a/__tests__/models/Park.spec.ts
+++ b/__tests__/models/Park.spec.ts
@@ -2,33 +2,95 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Park", () => {
- let model: freeclimb.Park = new freeclimb.Park({
- waitUrl: "https://123.abc",
- actionUrl: "https://123.abc",
- notificationUrl: "https://123.abc",
- });
- describe("Park class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.Park);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.Park;
+ let model: freeclimb.Park = new freeclimb.Park({
+ waitUrl: "https://123.abc",
+ actionUrl: "https://123.abc",
+ notificationUrl: "https://123.abc",
+ });
+ describe("Park class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Park);
+ });
});
- });
- describe(".waitUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.waitUrl).toBe(value);
+ describe(".waitUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.waitUrl).toBe(value);
+ });
+ });
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.actionUrl).toBe(value);
+ });
+ });
+ describe(".notificationUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.notificationUrl).toBe(value);
+ });
});
});
- describe(".actionUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.actionUrl).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.Park;
+ let model: freeclimb.Park = new freeclimb.Park({
+ waitUrl: "",
+ actionUrl: "",
+ notificationUrl: "",
+ });
+ describe("Park class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Park);
+ });
+ });
+
+ describe(".waitUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.waitUrl).toBe(value);
+ });
+ });
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.actionUrl).toBe(value);
+ });
+ });
+ describe(".notificationUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.notificationUrl).toBe(value);
+ });
});
});
- describe(".notificationUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.notificationUrl).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.Park;
+ let constructorArguments = {
+ waitUrl: "https://123.abc",
+ actionUrl: "https://123.abc",
+ };
+ let model: freeclimb.Park = new freeclimb.Park(constructorArguments);
+
+ describe("#waitUrl", () => {
+ it("resolves to initialization value", () => {
+ expect(model.waitUrl).toBe(constructorArguments["waitUrl"]);
+ });
+ });
+ describe("#actionUrl", () => {
+ it("resolves to initialization value", () => {
+ expect(model.actionUrl).toBe(constructorArguments["actionUrl"]);
+ });
+ });
+ describe("#notificationUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "notificationUrl",
+ )?.defaultValue;
+ expect(model.notificationUrl).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/Pause.spec.ts b/__tests__/models/Pause.spec.ts
index b6679fb..5962dd6 100644
--- a/__tests__/models/Pause.spec.ts
+++ b/__tests__/models/Pause.spec.ts
@@ -2,19 +2,53 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Pause", () => {
- let model: freeclimb.Pause = new freeclimb.Pause({
- length: 1,
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.Pause;
+ let model: freeclimb.Pause = new freeclimb.Pause({
+ length: 1,
+ });
+ describe("Pause class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Pause);
+ });
+ });
+
+ describe(".length", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.length).toBe(value);
+ });
+ });
});
- describe("Pause class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.Pause);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.Pause;
+ let model: freeclimb.Pause = new freeclimb.Pause({
+ length: 0,
+ });
+ describe("Pause class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Pause);
+ });
+ });
+
+ describe(".length", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.length).toBe(value);
+ });
});
});
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.Pause;
+ let constructorArguments = {
+ length: 1,
+ };
+ let model: freeclimb.Pause = new freeclimb.Pause(constructorArguments);
- describe(".length", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.length).toBe(value);
+ describe("#length", () => {
+ it("resolves to initialization value", () => {
+ expect(model.length).toBe(constructorArguments["length"]);
+ });
});
});
});
diff --git a/__tests__/models/PerclCommand.spec.ts b/__tests__/models/PerclCommand.spec.ts
index 2ccdff9..8f915a4 100644
--- a/__tests__/models/PerclCommand.spec.ts
+++ b/__tests__/models/PerclCommand.spec.ts
@@ -2,10 +2,38 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("PerclCommand", () => {
- let model: freeclimb.PerclCommand = new freeclimb.PerclCommand({});
- describe("PerclCommand class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.PerclCommand);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.PerclCommand;
+ let model: freeclimb.PerclCommand = new freeclimb.PerclCommand({});
+ describe("PerclCommand class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.PerclCommand);
+ });
+ });
+ });
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.PerclCommand;
+ let model: freeclimb.PerclCommand = new freeclimb.PerclCommand({});
+ describe("PerclCommand class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.PerclCommand);
+ });
+ });
+ });
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.PerclCommand;
+ let constructorArguments = {};
+ let model: freeclimb.PerclCommand = new freeclimb.PerclCommand(
+ constructorArguments,
+ );
+
+ describe("#command", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "command",
+ )?.defaultValue;
+ expect(model.command).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/PerclScript.spec.ts b/__tests__/models/PerclScript.spec.ts
index 6256e0a..d3ca17c 100644
--- a/__tests__/models/PerclScript.spec.ts
+++ b/__tests__/models/PerclScript.spec.ts
@@ -2,18 +2,54 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("PerclScript", () => {
- let model: freeclimb.PerclScript = new freeclimb.PerclScript({
- commands: [],
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.PerclScript;
+ let model: freeclimb.PerclScript = new freeclimb.PerclScript({
+ commands: [],
+ });
+ describe("PerclScript class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.PerclScript);
+ });
+ });
+ describe(".commands", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.PerclCommand[] = [];
+ expect(model.commands).toStrictEqual(value);
+ });
+ });
});
- describe("PerclScript class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.PerclScript);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.PerclScript;
+ let model: freeclimb.PerclScript = new freeclimb.PerclScript({
+ commands: [],
+ });
+ describe("PerclScript class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.PerclScript);
+ });
+ });
+ describe(".commands", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.PerclCommand[] = [];
+ expect(model.commands).toStrictEqual(value);
+ });
});
});
- describe(".commands", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.PerclCommand[] = [];
- expect(model.commands).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.PerclScript;
+ let constructorArguments = {};
+ let model: freeclimb.PerclScript = new freeclimb.PerclScript(
+ constructorArguments,
+ );
+
+ describe("#commands", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "commands",
+ )?.defaultValue;
+ expect(model.commands).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/Play.spec.ts b/__tests__/models/Play.spec.ts
index b3d63ba..e0eaaae 100644
--- a/__tests__/models/Play.spec.ts
+++ b/__tests__/models/Play.spec.ts
@@ -2,33 +2,97 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Play", () => {
- let model: freeclimb.Play = new freeclimb.Play({
- file: "test_file",
- loop: 1,
- privacyMode: true,
- });
- describe("Play class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.Play);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.Play;
+ let model: freeclimb.Play = new freeclimb.Play({
+ file: "test_file",
+ loop: 1,
+ privacyMode: true,
+ });
+ describe("Play class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Play);
+ });
});
- });
- describe(".file", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_file";
- expect(model.file).toBe(value);
+ describe(".file", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_file";
+ expect(model.file).toBe(value);
+ });
+ });
+ describe(".loop", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.loop).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".loop", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.loop).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.Play;
+ let model: freeclimb.Play = new freeclimb.Play({
+ file: "",
+ loop: 0,
+ privacyMode: false,
+ });
+ describe("Play class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Play);
+ });
+ });
+
+ describe(".file", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.file).toBe(value);
+ });
+ });
+ describe(".loop", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.loop).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".privacyMode", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.privacyMode).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.Play;
+ let constructorArguments = {
+ file: "test_file",
+ };
+ let model: freeclimb.Play = new freeclimb.Play(constructorArguments);
+
+ describe("#file", () => {
+ it("resolves to initialization value", () => {
+ expect(model.file).toBe(constructorArguments["file"]);
+ });
+ });
+ describe("#loop", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "loop",
+ )?.defaultValue;
+ expect(model.loop).toBe(value);
+ });
+ });
+ describe("#privacyMode", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "privacyMode",
+ )?.defaultValue;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/PlayBeep.spec.ts b/__tests__/models/PlayBeep.spec.ts
index faf5816..f2e9c9a 100644
--- a/__tests__/models/PlayBeep.spec.ts
+++ b/__tests__/models/PlayBeep.spec.ts
@@ -2,24 +2,26 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("PlayBeep", () => {
- describe(".ALWAYS", () => {
- it("resolves to correct value for ALWAYS enum property", () => {
- expect(freeclimb.PlayBeep.ALWAYS).toBe("always");
+ describe("Test with truthy values", () => {
+ describe(".ALWAYS", () => {
+ it("resolves to correct value for ALWAYS enum property", () => {
+ expect(freeclimb.PlayBeep.ALWAYS).toBe("always");
+ });
});
- });
- describe(".NEVER", () => {
- it("resolves to correct value for NEVER enum property", () => {
- expect(freeclimb.PlayBeep.NEVER).toBe("never");
+ describe(".NEVER", () => {
+ it("resolves to correct value for NEVER enum property", () => {
+ expect(freeclimb.PlayBeep.NEVER).toBe("never");
+ });
});
- });
- describe(".ENTRY_ONLY", () => {
- it("resolves to correct value for ENTRY_ONLY enum property", () => {
- expect(freeclimb.PlayBeep.ENTRY_ONLY).toBe("entryOnly");
+ describe(".ENTRY_ONLY", () => {
+ it("resolves to correct value for ENTRY_ONLY enum property", () => {
+ expect(freeclimb.PlayBeep.ENTRY_ONLY).toBe("entryOnly");
+ });
});
- });
- describe(".EXIT_ONLY", () => {
- it("resolves to correct value for EXIT_ONLY enum property", () => {
- expect(freeclimb.PlayBeep.EXIT_ONLY).toBe("exitOnly");
+ describe(".EXIT_ONLY", () => {
+ it("resolves to correct value for EXIT_ONLY enum property", () => {
+ expect(freeclimb.PlayBeep.EXIT_ONLY).toBe("exitOnly");
+ });
});
});
});
diff --git a/__tests__/models/PlayEarlyMedia.spec.ts b/__tests__/models/PlayEarlyMedia.spec.ts
index af8fefc..243efeb 100644
--- a/__tests__/models/PlayEarlyMedia.spec.ts
+++ b/__tests__/models/PlayEarlyMedia.spec.ts
@@ -2,19 +2,55 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("PlayEarlyMedia", () => {
- let model: freeclimb.PlayEarlyMedia = new freeclimb.PlayEarlyMedia({
- file: "test_file",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.PlayEarlyMedia;
+ let model: freeclimb.PlayEarlyMedia = new freeclimb.PlayEarlyMedia({
+ file: "test_file",
+ });
+ describe("PlayEarlyMedia class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.PlayEarlyMedia);
+ });
+ });
+
+ describe(".file", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_file";
+ expect(model.file).toBe(value);
+ });
+ });
});
- describe("PlayEarlyMedia class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.PlayEarlyMedia);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.PlayEarlyMedia;
+ let model: freeclimb.PlayEarlyMedia = new freeclimb.PlayEarlyMedia({
+ file: "",
+ });
+ describe("PlayEarlyMedia class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.PlayEarlyMedia);
+ });
+ });
+
+ describe(".file", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.file).toBe(value);
+ });
});
});
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.PlayEarlyMedia;
+ let constructorArguments = {
+ file: "test_file",
+ };
+ let model: freeclimb.PlayEarlyMedia = new freeclimb.PlayEarlyMedia(
+ constructorArguments,
+ );
- describe(".file", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_file";
- expect(model.file).toBe(value);
+ describe("#file", () => {
+ it("resolves to initialization value", () => {
+ expect(model.file).toBe(constructorArguments["file"]);
+ });
});
});
});
diff --git a/__tests__/models/QueueList.spec.ts b/__tests__/models/QueueList.spec.ts
index 6435a59..6c110c5 100644
--- a/__tests__/models/QueueList.spec.ts
+++ b/__tests__/models/QueueList.spec.ts
@@ -2,67 +2,160 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("QueueList", () => {
- let model: freeclimb.QueueList = new freeclimb.QueueList({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- queues: [],
- });
- describe("QueueList class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.QueueList);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.QueueList;
+ let model: freeclimb.QueueList = new freeclimb.QueueList({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ queues: [],
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe("QueueList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.QueueList);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".queues", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.QueueResult[] = [];
+ expect(model.queues).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.QueueList;
+ let model: freeclimb.QueueList = new freeclimb.QueueList({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ queues: [],
+ });
+ describe("QueueList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.QueueList);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".queues", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.QueueResult[] = [];
+ expect(model.queues).toStrictEqual(value);
+ });
});
});
- describe(".queues", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.QueueResult[] = [];
- expect(model.queues).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.QueueList;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.QueueList = new freeclimb.QueueList(
+ constructorArguments,
+ );
+
+ describe("#queues", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queues",
+ )?.defaultValue;
+ expect(model.queues).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/QueueMember.spec.ts b/__tests__/models/QueueMember.spec.ts
index ef4e1cc..3f3591e 100644
--- a/__tests__/models/QueueMember.spec.ts
+++ b/__tests__/models/QueueMember.spec.ts
@@ -2,46 +2,142 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("QueueMember", () => {
- let model: freeclimb.QueueMember = new freeclimb.QueueMember({
- uri: "test_uri",
- callId: "test_callId",
- waitTime: 1,
- position: 1,
- dateEnqueued: "test_dateEnqueued",
- });
- describe("QueueMember class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.QueueMember);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.QueueMember;
+ let model: freeclimb.QueueMember = new freeclimb.QueueMember({
+ uri: "test_uri",
+ callId: "test_callId",
+ waitTime: 1,
+ position: 1,
+ dateEnqueued: "test_dateEnqueued",
});
- });
- describe(".uri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_uri";
- expect(model.uri).toBe(value);
+ describe("QueueMember class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.QueueMember);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_uri";
+ expect(model.uri).toBe(value);
+ });
});
- });
- describe(".waitTime", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.waitTime).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".waitTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.waitTime).toBe(value);
+ });
+ });
+ describe(".position", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.position).toBe(value);
+ });
+ });
+ describe(".dateEnqueued", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateEnqueued";
+ expect(model.dateEnqueued).toBe(value);
+ });
});
});
- describe(".position", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.position).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.QueueMember;
+ let model: freeclimb.QueueMember = new freeclimb.QueueMember({
+ uri: "",
+ callId: "",
+ waitTime: 0,
+ position: 0,
+ dateEnqueued: "",
+ });
+ describe("QueueMember class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.QueueMember);
+ });
+ });
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".waitTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.waitTime).toBe(value);
+ });
+ });
+ describe(".position", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.position).toBe(value);
+ });
+ });
+ describe(".dateEnqueued", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateEnqueued).toBe(value);
+ });
});
});
- describe(".dateEnqueued", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateEnqueued";
- expect(model.dateEnqueued).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.QueueMember;
+ let constructorArguments = {};
+ let model: freeclimb.QueueMember = new freeclimb.QueueMember(
+ constructorArguments,
+ );
+
+ describe("#uri", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "uri",
+ )?.defaultValue;
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#waitTime", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "waitTime",
+ )?.defaultValue;
+ expect(model.waitTime).toBe(value);
+ });
+ });
+ describe("#position", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "position",
+ )?.defaultValue;
+ expect(model.position).toBe(value);
+ });
+ });
+ describe("#dateEnqueued", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "dateEnqueued",
+ )?.defaultValue;
+ expect(model.dateEnqueued).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/QueueMemberList.spec.ts b/__tests__/models/QueueMemberList.spec.ts
index 67281a7..52fa046 100644
--- a/__tests__/models/QueueMemberList.spec.ts
+++ b/__tests__/models/QueueMemberList.spec.ts
@@ -2,67 +2,160 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("QueueMemberList", () => {
- let model: freeclimb.QueueMemberList = new freeclimb.QueueMemberList({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- queueMembers: [],
- });
- describe("QueueMemberList class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.QueueMemberList);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.QueueMemberList;
+ let model: freeclimb.QueueMemberList = new freeclimb.QueueMemberList({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ queueMembers: [],
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe("QueueMemberList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.QueueMemberList);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".queueMembers", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.QueueMember[] = [];
+ expect(model.queueMembers).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.QueueMemberList;
+ let model: freeclimb.QueueMemberList = new freeclimb.QueueMemberList({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ queueMembers: [],
+ });
+ describe("QueueMemberList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.QueueMemberList);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".queueMembers", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.QueueMember[] = [];
+ expect(model.queueMembers).toStrictEqual(value);
+ });
});
});
- describe(".queueMembers", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.QueueMember[] = [];
- expect(model.queueMembers).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.QueueMemberList;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.QueueMemberList = new freeclimb.QueueMemberList(
+ constructorArguments,
+ );
+
+ describe("#queueMembers", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueMembers",
+ )?.defaultValue;
+ expect(model.queueMembers).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/QueueRequest.spec.ts b/__tests__/models/QueueRequest.spec.ts
index 5ad6ed4..726e447 100644
--- a/__tests__/models/QueueRequest.spec.ts
+++ b/__tests__/models/QueueRequest.spec.ts
@@ -2,25 +2,76 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("QueueRequest", () => {
- let model: freeclimb.QueueRequest = new freeclimb.QueueRequest({
- alias: "test_alias",
- maxSize: 1,
- });
- describe("QueueRequest class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.QueueRequest);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.QueueRequest;
+ let model: freeclimb.QueueRequest = new freeclimb.QueueRequest({
+ alias: "test_alias",
+ maxSize: 1,
+ });
+ describe("QueueRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.QueueRequest);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_alias";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".maxSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.maxSize).toBe(value);
+ });
});
});
- describe(".alias", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_alias";
- expect(model.alias).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.QueueRequest;
+ let model: freeclimb.QueueRequest = new freeclimb.QueueRequest({
+ alias: "",
+ maxSize: 0,
+ });
+ describe("QueueRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.QueueRequest);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".maxSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.maxSize).toBe(value);
+ });
});
});
- describe(".maxSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.maxSize).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.QueueRequest;
+ let constructorArguments = {};
+ let model: freeclimb.QueueRequest = new freeclimb.QueueRequest(
+ constructorArguments,
+ );
+
+ describe("#alias", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "alias",
+ )?.defaultValue;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe("#maxSize", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "maxSize",
+ )?.defaultValue;
+ expect(model.maxSize).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/QueueResult.spec.ts b/__tests__/models/QueueResult.spec.ts
index 5d7e86c..bb97a8f 100644
--- a/__tests__/models/QueueResult.spec.ts
+++ b/__tests__/models/QueueResult.spec.ts
@@ -2,89 +2,249 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("QueueResult", () => {
- let model: freeclimb.QueueResult = new freeclimb.QueueResult({
- uri: "test_uri",
- dateCreated: "test_dateCreated",
- dateUpdated: "test_dateUpdated",
- revision: 1,
- accountId: "test_accountId",
- queueId: "test_queueId",
- alias: "test_alias",
- maxSize: 1,
- currentSize: 1,
- averageQueueRemovalTime: 1,
- subresourceUris: {},
- });
- describe("QueueResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.QueueResult);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.QueueResult;
+ let model: freeclimb.QueueResult = new freeclimb.QueueResult({
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ accountId: "test_accountId",
+ queueId: "test_queueId",
+ alias: "test_alias",
+ maxSize: 1,
+ currentSize: 1,
+ averageQueueRemovalTime: 1,
+ subresourceUris: {},
});
- });
- describe(".uri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_uri";
- expect(model.uri).toBe(value);
+ describe("QueueResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.QueueResult);
+ });
});
- });
- describe(".dateCreated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreated";
- expect(model.dateCreated).toBe(value);
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_uri";
+ expect(model.uri).toBe(value);
+ });
});
- });
- describe(".dateUpdated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdated";
- expect(model.dateUpdated).toBe(value);
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreated";
+ expect(model.dateCreated).toBe(value);
+ });
});
- });
- describe(".revision", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.revision).toBe(value);
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdated";
+ expect(model.dateUpdated).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.revision).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".alias", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_alias";
- expect(model.alias).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
});
- });
- describe(".maxSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.maxSize).toBe(value);
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_alias";
+ expect(model.alias).toBe(value);
+ });
});
- });
- describe(".currentSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.currentSize).toBe(value);
+ describe(".maxSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.maxSize).toBe(value);
+ });
+ });
+ describe(".currentSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.currentSize).toBe(value);
+ });
+ });
+ describe(".averageQueueRemovalTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.averageQueueRemovalTime).toBe(value);
+ });
+ });
+ describe(".subresourceUris", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = {};
+ const receivedValue: any = model.subresourceUris;
+ expect(receivedValue).toStrictEqual(value);
+ });
});
});
- describe(".averageQueueRemovalTime", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.averageQueueRemovalTime).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.QueueResult;
+ let model: freeclimb.QueueResult = new freeclimb.QueueResult({
+ uri: "",
+ dateCreated: "",
+ dateUpdated: "",
+ revision: 0,
+ accountId: "",
+ queueId: "",
+ alias: "",
+ maxSize: 0,
+ currentSize: 0,
+ averageQueueRemovalTime: 0,
+ subresourceUris: {},
+ });
+ describe("QueueResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.QueueResult);
+ });
+ });
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.revision).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".maxSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.maxSize).toBe(value);
+ });
+ });
+ describe(".currentSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.currentSize).toBe(value);
+ });
+ });
+ describe(".averageQueueRemovalTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.averageQueueRemovalTime).toBe(value);
+ });
+ });
+ describe(".subresourceUris", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = {};
+ const receivedValue: any = model.subresourceUris;
+ expect(receivedValue).toStrictEqual(value);
+ });
});
});
- describe(".subresourceUris", () => {
- it("resolves to particular value on initialization", () => {
- const value = {};
- const receivedValue: any = model.subresourceUris;
- expect(receivedValue).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.QueueResult;
+ let constructorArguments = {
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ };
+ let model: freeclimb.QueueResult = new freeclimb.QueueResult(
+ constructorArguments,
+ );
+
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#alias", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "alias",
+ )?.defaultValue;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe("#maxSize", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "maxSize",
+ )?.defaultValue;
+ expect(model.maxSize).toBe(value);
+ });
+ });
+ describe("#currentSize", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "currentSize",
+ )?.defaultValue;
+ expect(model.currentSize).toBe(value);
+ });
+ });
+ describe("#averageQueueRemovalTime", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "averageQueueRemovalTime",
+ )?.defaultValue;
+ expect(model.averageQueueRemovalTime).toBe(value);
+ });
+ });
+ describe("#subresourceUris", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "subresourceUris",
+ )?.defaultValue;
+ expect(model.subresourceUris).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/QueueResultStatus.spec.ts b/__tests__/models/QueueResultStatus.spec.ts
index 8abbf42..5862c5d 100644
--- a/__tests__/models/QueueResultStatus.spec.ts
+++ b/__tests__/models/QueueResultStatus.spec.ts
@@ -2,24 +2,26 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("QueueResultStatus", () => {
- describe(".QUEUE_FULL", () => {
- it("resolves to correct value for QUEUE_FULL enum property", () => {
- expect(freeclimb.QueueResultStatus.QUEUE_FULL).toBe("queueFull");
+ describe("Test with truthy values", () => {
+ describe(".QUEUE_FULL", () => {
+ it("resolves to correct value for QUEUE_FULL enum property", () => {
+ expect(freeclimb.QueueResultStatus.QUEUE_FULL).toBe("queueFull");
+ });
});
- });
- describe(".DEQUEUED", () => {
- it("resolves to correct value for DEQUEUED enum property", () => {
- expect(freeclimb.QueueResultStatus.DEQUEUED).toBe("dequeued");
+ describe(".DEQUEUED", () => {
+ it("resolves to correct value for DEQUEUED enum property", () => {
+ expect(freeclimb.QueueResultStatus.DEQUEUED).toBe("dequeued");
+ });
});
- });
- describe(".HANGUP", () => {
- it("resolves to correct value for HANGUP enum property", () => {
- expect(freeclimb.QueueResultStatus.HANGUP).toBe("hangup");
+ describe(".HANGUP", () => {
+ it("resolves to correct value for HANGUP enum property", () => {
+ expect(freeclimb.QueueResultStatus.HANGUP).toBe("hangup");
+ });
});
- });
- describe(".SYSTEM_ERROR", () => {
- it("resolves to correct value for SYSTEM_ERROR enum property", () => {
- expect(freeclimb.QueueResultStatus.SYSTEM_ERROR).toBe("systemError");
+ describe(".SYSTEM_ERROR", () => {
+ it("resolves to correct value for SYSTEM_ERROR enum property", () => {
+ expect(freeclimb.QueueResultStatus.SYSTEM_ERROR).toBe("systemError");
+ });
});
});
});
diff --git a/__tests__/models/QueueWaitWebhook.spec.ts b/__tests__/models/QueueWaitWebhook.spec.ts
index 1e123f0..5f503bf 100644
--- a/__tests__/models/QueueWaitWebhook.spec.ts
+++ b/__tests__/models/QueueWaitWebhook.spec.ts
@@ -2,105 +2,320 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("QueueWaitWebhook", () => {
- let model: freeclimb.QueueWaitWebhook = new freeclimb.QueueWaitWebhook({
- requestType: "test_requestType",
- accountId: "test_accountId",
- callId: "test_callId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.QueueWaitWebhook;
+ let model: freeclimb.QueueWaitWebhook = new freeclimb.QueueWaitWebhook({
+ requestType: "test_requestType",
+ accountId: "test_accountId",
+ callId: "test_callId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
- queuePosition: "test_queuePosition",
- queueTime: 1,
- currentQueueSize: 1,
- });
- describe("QueueWaitWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.QueueWaitWebhook);
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
+ queuePosition: "test_queuePosition",
+ queueTime: 1,
+ currentQueueSize: 1,
+ });
+ describe("QueueWaitWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.QueueWaitWebhook);
+ });
});
- });
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
});
- });
- describe(".queuePosition", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queuePosition";
- expect(model.queuePosition).toBe(value);
+ describe(".queuePosition", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queuePosition";
+ expect(model.queuePosition).toBe(value);
+ });
});
- });
- describe(".queueTime", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.queueTime).toBe(value);
+ describe(".queueTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.queueTime).toBe(value);
+ });
+ });
+ describe(".currentQueueSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.currentQueueSize).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of QueueWaitWebhook", () => {
+ expect(
+ freeclimb.QueueWaitWebhook.deserialize(
+ '{ "requestType": "queueWait"}',
+ ),
+ ).toBeInstanceOf(freeclimb.QueueWaitWebhook);
+ });
});
});
- describe(".currentQueueSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.currentQueueSize).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.QueueWaitWebhook;
+ let model: freeclimb.QueueWaitWebhook = new freeclimb.QueueWaitWebhook({
+ requestType: "",
+ accountId: "",
+ callId: "",
+ from: "",
+ to: "",
+
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+ queuePosition: "",
+ queueTime: 0,
+ currentQueueSize: 0,
+ });
+ describe("QueueWaitWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.QueueWaitWebhook);
+ });
+ });
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".queuePosition", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queuePosition).toBe(value);
+ });
+ });
+ describe(".queueTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.queueTime).toBe(value);
+ });
+ });
+ describe(".currentQueueSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.currentQueueSize).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of QueueWaitWebhook", () => {
+ expect(
+ freeclimb.QueueWaitWebhook.deserialize(
+ '{ "requestType": "queueWait"}',
+ ),
+ ).toBeInstanceOf(freeclimb.QueueWaitWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of QueueWaitWebhook", () => {
- expect(
- freeclimb.QueueWaitWebhook.deserialize('{ "requestType": "queueWait"}'),
- ).toBeInstanceOf(freeclimb.QueueWaitWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.QueueWaitWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.QueueWaitWebhook = new freeclimb.QueueWaitWebhook(
+ constructorArguments,
+ );
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#queuePosition", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queuePosition",
+ )?.defaultValue;
+ expect(model.queuePosition).toBe(value);
+ });
+ });
+ describe("#queueTime", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueTime",
+ )?.defaultValue;
+ expect(model.queueTime).toBe(value);
+ });
+ });
+ describe("#currentQueueSize", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "currentQueueSize",
+ )?.defaultValue;
+ expect(model.currentQueueSize).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/RecordUtterance.spec.ts b/__tests__/models/RecordUtterance.spec.ts
index 276bc0c..d5c238a 100644
--- a/__tests__/models/RecordUtterance.spec.ts
+++ b/__tests__/models/RecordUtterance.spec.ts
@@ -2,61 +2,187 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("RecordUtterance", () => {
- let model: freeclimb.RecordUtterance = new freeclimb.RecordUtterance({
- actionUrl: "https://123.abc",
- silenceTimeoutMs: 1,
- finishOnKey: "test_finishOnKey",
- maxLengthSec: 1,
- playBeep: true,
- autoStart: true,
- privacyMode: true,
- });
- describe("RecordUtterance class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.RecordUtterance);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.RecordUtterance;
+ let model: freeclimb.RecordUtterance = new freeclimb.RecordUtterance({
+ actionUrl: "https://123.abc",
+ silenceTimeoutMs: 1,
+ finishOnKey: "test_finishOnKey",
+ maxLengthSec: 1,
+ playBeep: true,
+ autoStart: true,
+ privacyMode: true,
+ });
+ describe("RecordUtterance class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.RecordUtterance);
+ });
});
- });
- describe(".actionUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.actionUrl).toBe(value);
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.actionUrl).toBe(value);
+ });
});
- });
- describe(".silenceTimeoutMs", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.silenceTimeoutMs).toBe(value);
+ describe(".silenceTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.silenceTimeoutMs).toBe(value);
+ });
});
- });
- describe(".finishOnKey", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_finishOnKey";
- expect(model.finishOnKey).toBe(value);
+ describe(".finishOnKey", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_finishOnKey";
+ expect(model.finishOnKey).toBe(value);
+ });
});
- });
- describe(".maxLengthSec", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.maxLengthSec).toBe(value);
+ describe(".maxLengthSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.maxLengthSec).toBe(value);
+ });
});
- });
- describe(".playBeep", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.playBeep).toBe(value);
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe(".autoStart", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.autoStart).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".autoStart", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.autoStart).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.RecordUtterance;
+ let model: freeclimb.RecordUtterance = new freeclimb.RecordUtterance({
+ actionUrl: "",
+ silenceTimeoutMs: 0,
+ finishOnKey: "",
+ maxLengthSec: 0,
+ playBeep: false,
+ autoStart: false,
+ privacyMode: false,
+ });
+ describe("RecordUtterance class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.RecordUtterance);
+ });
+ });
+
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.actionUrl).toBe(value);
+ });
+ });
+ describe(".silenceTimeoutMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.silenceTimeoutMs).toBe(value);
+ });
+ });
+ describe(".finishOnKey", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.finishOnKey).toBe(value);
+ });
+ });
+ describe(".maxLengthSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.maxLengthSec).toBe(value);
+ });
+ });
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe(".autoStart", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.autoStart).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".privacyMode", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.privacyMode).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.RecordUtterance;
+ let constructorArguments = {
+ actionUrl: "https://123.abc",
+ };
+ let model: freeclimb.RecordUtterance = new freeclimb.RecordUtterance(
+ constructorArguments,
+ );
+
+ describe("#actionUrl", () => {
+ it("resolves to initialization value", () => {
+ expect(model.actionUrl).toBe(constructorArguments["actionUrl"]);
+ });
+ });
+ describe("#silenceTimeoutMs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "silenceTimeoutMs",
+ )?.defaultValue;
+ expect(model.silenceTimeoutMs).toBe(value);
+ });
+ });
+ describe("#finishOnKey", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "finishOnKey",
+ )?.defaultValue;
+ expect(model.finishOnKey).toBe(value);
+ });
+ });
+ describe("#maxLengthSec", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "maxLengthSec",
+ )?.defaultValue;
+ expect(model.maxLengthSec).toBe(value);
+ });
+ });
+ describe("#playBeep", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "playBeep",
+ )?.defaultValue;
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe("#autoStart", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "autoStart",
+ )?.defaultValue;
+ expect(model.autoStart).toBe(value);
+ });
+ });
+ describe("#privacyMode", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "privacyMode",
+ )?.defaultValue;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/RecordUtteranceTermReason.spec.ts b/__tests__/models/RecordUtteranceTermReason.spec.ts
index ec921d1..0ac9076 100644
--- a/__tests__/models/RecordUtteranceTermReason.spec.ts
+++ b/__tests__/models/RecordUtteranceTermReason.spec.ts
@@ -2,24 +2,30 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("RecordUtteranceTermReason", () => {
- describe(".FINISH_KEY", () => {
- it("resolves to correct value for FINISH_KEY enum property", () => {
- expect(freeclimb.RecordUtteranceTermReason.FINISH_KEY).toBe("finishKey");
+ describe("Test with truthy values", () => {
+ describe(".FINISH_KEY", () => {
+ it("resolves to correct value for FINISH_KEY enum property", () => {
+ expect(freeclimb.RecordUtteranceTermReason.FINISH_KEY).toBe(
+ "finishKey",
+ );
+ });
});
- });
- describe(".TIMEOUT", () => {
- it("resolves to correct value for TIMEOUT enum property", () => {
- expect(freeclimb.RecordUtteranceTermReason.TIMEOUT).toBe("timeout");
+ describe(".TIMEOUT", () => {
+ it("resolves to correct value for TIMEOUT enum property", () => {
+ expect(freeclimb.RecordUtteranceTermReason.TIMEOUT).toBe("timeout");
+ });
});
- });
- describe(".HANGUP", () => {
- it("resolves to correct value for HANGUP enum property", () => {
- expect(freeclimb.RecordUtteranceTermReason.HANGUP).toBe("hangup");
+ describe(".HANGUP", () => {
+ it("resolves to correct value for HANGUP enum property", () => {
+ expect(freeclimb.RecordUtteranceTermReason.HANGUP).toBe("hangup");
+ });
});
- });
- describe(".MAX_LENGTH", () => {
- it("resolves to correct value for MAX_LENGTH enum property", () => {
- expect(freeclimb.RecordUtteranceTermReason.MAX_LENGTH).toBe("maxLength");
+ describe(".MAX_LENGTH", () => {
+ it("resolves to correct value for MAX_LENGTH enum property", () => {
+ expect(freeclimb.RecordUtteranceTermReason.MAX_LENGTH).toBe(
+ "maxLength",
+ );
+ });
});
});
});
diff --git a/__tests__/models/RecordWebhook.spec.ts b/__tests__/models/RecordWebhook.spec.ts
index 4916e72..4571e2e 100644
--- a/__tests__/models/RecordWebhook.spec.ts
+++ b/__tests__/models/RecordWebhook.spec.ts
@@ -2,141 +2,428 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("RecordWebhook", () => {
- let model: freeclimb.RecordWebhook = new freeclimb.RecordWebhook({
- requestType: "test_requestType",
- accountId: "test_accountId",
- callId: "test_callId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.RecordWebhook;
+ let model: freeclimb.RecordWebhook = new freeclimb.RecordWebhook({
+ requestType: "test_requestType",
+ accountId: "test_accountId",
+ callId: "test_callId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
- recordingId: "test_recordingId",
- recordingUrl: "https://123.abc",
- recordingSize: "test_recordingSize",
- recordingFormat: "test_recordingFormat",
- recordingDurationSec: 1,
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
+ recordingId: "test_recordingId",
+ recordingUrl: "https://123.abc",
+ recordingSize: "test_recordingSize",
+ recordingFormat: "test_recordingFormat",
+ recordingDurationSec: 1,
- termReason: freeclimb.RecordUtteranceTermReason.FINISH_KEY,
- parentCallId: "test_parentCallId",
- privacyMode: true,
- });
- describe("RecordWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.RecordWebhook);
+ termReason: freeclimb.RecordUtteranceTermReason.FINISH_KEY,
+ parentCallId: "test_parentCallId",
+ privacyMode: true,
+ });
+ describe("RecordWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.RecordWebhook);
+ });
});
- });
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
});
- });
- describe(".recordingId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_recordingId";
- expect(model.recordingId).toBe(value);
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_recordingId";
+ expect(model.recordingId).toBe(value);
+ });
});
- });
- describe(".recordingUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.recordingUrl).toBe(value);
+ describe(".recordingUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.recordingUrl).toBe(value);
+ });
});
- });
- describe(".recordingSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_recordingSize";
- expect(model.recordingSize).toBe(value);
+ describe(".recordingSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_recordingSize";
+ expect(model.recordingSize).toBe(value);
+ });
});
- });
- describe(".recordingFormat", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_recordingFormat";
- expect(model.recordingFormat).toBe(value);
+ describe(".recordingFormat", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_recordingFormat";
+ expect(model.recordingFormat).toBe(value);
+ });
});
- });
- describe(".recordingDurationSec", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.recordingDurationSec).toBe(value);
+ describe(".recordingDurationSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.recordingDurationSec).toBe(value);
+ });
});
- });
- describe(".termReason", () => {
- it("resolves to particular value on initialization", () => {
- const value = "finishKey";
- expect(model.termReason).toBe(value);
+ describe(".termReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "finishKey";
+ expect(model.termReason).toBe(value);
+ });
});
- });
- describe(".parentCallId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_parentCallId";
- expect(model.parentCallId).toBe(value);
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_parentCallId";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.privacyMode).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of RecordWebhook", () => {
+ expect(
+ freeclimb.RecordWebhook.deserialize('{ "requestType": "record"}'),
+ ).toBeInstanceOf(freeclimb.RecordWebhook);
+ });
});
});
- describe(".privacyMode", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.privacyMode).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.RecordWebhook;
+ let model: freeclimb.RecordWebhook = new freeclimb.RecordWebhook({
+ requestType: "",
+ accountId: "",
+ callId: "",
+ from: "",
+ to: "",
+
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+ recordingId: "",
+ recordingUrl: "",
+ recordingSize: "",
+ recordingFormat: "",
+ recordingDurationSec: 0,
+
+ termReason: freeclimb.RecordUtteranceTermReason.FINISH_KEY,
+ parentCallId: "",
+ privacyMode: false,
+ });
+ describe("RecordWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.RecordWebhook);
+ });
+ });
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe(".recordingUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingUrl).toBe(value);
+ });
+ });
+ describe(".recordingSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingSize).toBe(value);
+ });
+ });
+ describe(".recordingFormat", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingFormat).toBe(value);
+ });
+ });
+ describe(".recordingDurationSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.recordingDurationSec).toBe(value);
+ });
+ });
+ describe(".termReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "finishKey";
+ expect(model.termReason).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.privacyMode).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of RecordWebhook", () => {
+ expect(
+ freeclimb.RecordWebhook.deserialize('{ "requestType": "record"}'),
+ ).toBeInstanceOf(freeclimb.RecordWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of RecordWebhook", () => {
- expect(
- freeclimb.RecordWebhook.deserialize('{ "requestType": "record"}'),
- ).toBeInstanceOf(freeclimb.RecordWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.RecordWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.RecordWebhook = new freeclimb.RecordWebhook(
+ constructorArguments,
+ );
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#recordingId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingId",
+ )?.defaultValue;
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe("#recordingUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingUrl",
+ )?.defaultValue;
+ expect(model.recordingUrl).toBe(value);
+ });
+ });
+ describe("#recordingSize", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingSize",
+ )?.defaultValue;
+ expect(model.recordingSize).toBe(value);
+ });
+ });
+ describe("#recordingFormat", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingFormat",
+ )?.defaultValue;
+ expect(model.recordingFormat).toBe(value);
+ });
+ });
+ describe("#recordingDurationSec", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingDurationSec",
+ )?.defaultValue;
+ expect(model.recordingDurationSec).toBe(value);
+ });
+ });
+ describe("#termReason", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "termReason",
+ )?.defaultValue;
+ expect(model.termReason).toBe(value);
+ });
+ });
+ describe("#parentCallId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "parentCallId",
+ )?.defaultValue;
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe("#privacyMode", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "privacyMode",
+ )?.defaultValue;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/RecordingList.spec.ts b/__tests__/models/RecordingList.spec.ts
index b6d01e8..120f709 100644
--- a/__tests__/models/RecordingList.spec.ts
+++ b/__tests__/models/RecordingList.spec.ts
@@ -2,67 +2,160 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("RecordingList", () => {
- let model: freeclimb.RecordingList = new freeclimb.RecordingList({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- recordings: [],
- });
- describe("RecordingList class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.RecordingList);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.RecordingList;
+ let model: freeclimb.RecordingList = new freeclimb.RecordingList({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ recordings: [],
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe("RecordingList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.RecordingList);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".recordings", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.RecordingResult[] = [];
+ expect(model.recordings).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.RecordingList;
+ let model: freeclimb.RecordingList = new freeclimb.RecordingList({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ recordings: [],
+ });
+ describe("RecordingList class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.RecordingList);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".recordings", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.RecordingResult[] = [];
+ expect(model.recordings).toStrictEqual(value);
+ });
});
});
- describe(".recordings", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.RecordingResult[] = [];
- expect(model.recordings).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.RecordingList;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.RecordingList = new freeclimb.RecordingList(
+ constructorArguments,
+ );
+
+ describe("#recordings", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordings",
+ )?.defaultValue;
+ expect(model.recordings).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/RecordingResult.spec.ts b/__tests__/models/RecordingResult.spec.ts
index d74b380..e92d89d 100644
--- a/__tests__/models/RecordingResult.spec.ts
+++ b/__tests__/models/RecordingResult.spec.ts
@@ -2,74 +2,203 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("RecordingResult", () => {
- let model: freeclimb.RecordingResult = new freeclimb.RecordingResult({
- uri: "test_uri",
- dateCreated: "test_dateCreated",
- dateUpdated: "test_dateUpdated",
- revision: 1,
- recordingId: "test_recordingId",
- accountId: "test_accountId",
- callId: "test_callId",
- durationSec: 1,
- conferenceId: "test_conferenceId",
- });
- describe("RecordingResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.RecordingResult);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.RecordingResult;
+ let model: freeclimb.RecordingResult = new freeclimb.RecordingResult({
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ recordingId: "test_recordingId",
+ accountId: "test_accountId",
+ callId: "test_callId",
+ durationSec: 1,
+ conferenceId: "test_conferenceId",
});
- });
- describe(".uri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_uri";
- expect(model.uri).toBe(value);
+ describe("RecordingResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.RecordingResult);
+ });
});
- });
- describe(".dateCreated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreated";
- expect(model.dateCreated).toBe(value);
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_uri";
+ expect(model.uri).toBe(value);
+ });
});
- });
- describe(".dateUpdated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdated";
- expect(model.dateUpdated).toBe(value);
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreated";
+ expect(model.dateCreated).toBe(value);
+ });
});
- });
- describe(".revision", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.revision).toBe(value);
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdated";
+ expect(model.dateUpdated).toBe(value);
+ });
});
- });
- describe(".recordingId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_recordingId";
- expect(model.recordingId).toBe(value);
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.revision).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_recordingId";
+ expect(model.recordingId).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".durationSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.durationSec).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
});
});
- describe(".durationSec", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.durationSec).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.RecordingResult;
+ let model: freeclimb.RecordingResult = new freeclimb.RecordingResult({
+ uri: "",
+ dateCreated: "",
+ dateUpdated: "",
+ revision: 0,
+ recordingId: "",
+ accountId: "",
+ callId: "",
+ durationSec: 0,
+ conferenceId: "",
+ });
+ describe("RecordingResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.RecordingResult);
+ });
+ });
+ describe(".uri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.uri).toBe(value);
+ });
+ });
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.revision).toBe(value);
+ });
+ });
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".durationSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.durationSec).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
});
});
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.RecordingResult;
+ let constructorArguments = {
+ uri: "test_uri",
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ };
+ let model: freeclimb.RecordingResult = new freeclimb.RecordingResult(
+ constructorArguments,
+ );
+
+ describe("#recordingId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingId",
+ )?.defaultValue;
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#durationSec", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "durationSec",
+ )?.defaultValue;
+ expect(model.durationSec).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/Redirect.spec.ts b/__tests__/models/Redirect.spec.ts
index 7932e0e..d93e526 100644
--- a/__tests__/models/Redirect.spec.ts
+++ b/__tests__/models/Redirect.spec.ts
@@ -2,19 +2,55 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Redirect", () => {
- let model: freeclimb.Redirect = new freeclimb.Redirect({
- actionUrl: "https://123.abc",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.Redirect;
+ let model: freeclimb.Redirect = new freeclimb.Redirect({
+ actionUrl: "https://123.abc",
+ });
+ describe("Redirect class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Redirect);
+ });
+ });
+
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.actionUrl).toBe(value);
+ });
+ });
});
- describe("Redirect class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.Redirect);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.Redirect;
+ let model: freeclimb.Redirect = new freeclimb.Redirect({
+ actionUrl: "",
+ });
+ describe("Redirect class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Redirect);
+ });
+ });
+
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.actionUrl).toBe(value);
+ });
});
});
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.Redirect;
+ let constructorArguments = {
+ actionUrl: "https://123.abc",
+ };
+ let model: freeclimb.Redirect = new freeclimb.Redirect(
+ constructorArguments,
+ );
- describe(".actionUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.actionUrl).toBe(value);
+ describe("#actionUrl", () => {
+ it("resolves to initialization value", () => {
+ expect(model.actionUrl).toBe(constructorArguments["actionUrl"]);
+ });
});
});
});
diff --git a/__tests__/models/RedirectWebhook.spec.ts b/__tests__/models/RedirectWebhook.spec.ts
index c03ce38..1e19ca1 100644
--- a/__tests__/models/RedirectWebhook.spec.ts
+++ b/__tests__/models/RedirectWebhook.spec.ts
@@ -2,91 +2,272 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("RedirectWebhook", () => {
- let model: freeclimb.RedirectWebhook = new freeclimb.RedirectWebhook({
- requestType: "test_requestType",
- accountId: "test_accountId",
- callId: "test_callId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.RedirectWebhook;
+ let model: freeclimb.RedirectWebhook = new freeclimb.RedirectWebhook({
+ requestType: "test_requestType",
+ accountId: "test_accountId",
+ callId: "test_callId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
- parentCallId: "test_parentCallId",
- });
- describe("RedirectWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.RedirectWebhook);
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
+ parentCallId: "test_parentCallId",
+ });
+ describe("RedirectWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.RedirectWebhook);
+ });
});
- });
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_parentCallId";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of RedirectWebhook", () => {
+ expect(
+ freeclimb.RedirectWebhook.deserialize('{ "requestType": "redirect"}'),
+ ).toBeInstanceOf(freeclimb.RedirectWebhook);
+ });
});
});
- describe(".parentCallId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_parentCallId";
- expect(model.parentCallId).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.RedirectWebhook;
+ let model: freeclimb.RedirectWebhook = new freeclimb.RedirectWebhook({
+ requestType: "",
+ accountId: "",
+ callId: "",
+ from: "",
+ to: "",
+
+ callStatus: freeclimb.CallStatus.QUEUED,
+
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+ parentCallId: "",
+ });
+ describe("RedirectWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.RedirectWebhook);
+ });
+ });
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".parentCallId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.parentCallId).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of RedirectWebhook", () => {
+ expect(
+ freeclimb.RedirectWebhook.deserialize('{ "requestType": "redirect"}'),
+ ).toBeInstanceOf(freeclimb.RedirectWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of RedirectWebhook", () => {
- expect(
- freeclimb.RedirectWebhook.deserialize('{ "requestType": "redirect"}'),
- ).toBeInstanceOf(freeclimb.RedirectWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.RedirectWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.RedirectWebhook = new freeclimb.RedirectWebhook(
+ constructorArguments,
+ );
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#parentCallId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "parentCallId",
+ )?.defaultValue;
+ expect(model.parentCallId).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/Reject.spec.ts b/__tests__/models/Reject.spec.ts
index b469710..8d532dc 100644
--- a/__tests__/models/Reject.spec.ts
+++ b/__tests__/models/Reject.spec.ts
@@ -2,19 +2,54 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Reject", () => {
- let model: freeclimb.Reject = new freeclimb.Reject({
- reason: "test_reason",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.Reject;
+ let model: freeclimb.Reject = new freeclimb.Reject({
+ reason: "test_reason",
+ });
+ describe("Reject class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Reject);
+ });
+ });
+
+ describe(".reason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_reason";
+ expect(model.reason).toBe(value);
+ });
+ });
});
- describe("Reject class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.Reject);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.Reject;
+ let model: freeclimb.Reject = new freeclimb.Reject({
+ reason: "",
+ });
+ describe("Reject class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Reject);
+ });
+ });
+
+ describe(".reason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.reason).toBe(value);
+ });
});
});
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.Reject;
+ let constructorArguments = {};
+ let model: freeclimb.Reject = new freeclimb.Reject(constructorArguments);
- describe(".reason", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_reason";
- expect(model.reason).toBe(value);
+ describe("#reason", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "reason",
+ )?.defaultValue;
+ expect(model.reason).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/RemoveFromConference.spec.ts b/__tests__/models/RemoveFromConference.spec.ts
index b02db97..7030936 100644
--- a/__tests__/models/RemoveFromConference.spec.ts
+++ b/__tests__/models/RemoveFromConference.spec.ts
@@ -2,11 +2,30 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("RemoveFromConference", () => {
- let model: freeclimb.RemoveFromConference =
- new freeclimb.RemoveFromConference({});
- describe("RemoveFromConference class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.RemoveFromConference);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.RemoveFromConference;
+ let model: freeclimb.RemoveFromConference =
+ new freeclimb.RemoveFromConference({});
+ describe("RemoveFromConference class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.RemoveFromConference);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.RemoveFromConference;
+ let model: freeclimb.RemoveFromConference =
+ new freeclimb.RemoveFromConference({});
+ describe("RemoveFromConference class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.RemoveFromConference);
+ });
+ });
+ });
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.RemoveFromConference;
+ let constructorArguments = {};
+ let model: freeclimb.RemoveFromConference =
+ new freeclimb.RemoveFromConference(constructorArguments);
+ });
});
diff --git a/__tests__/models/RemoveFromQueueNotificationWebhook.spec.ts b/__tests__/models/RemoveFromQueueNotificationWebhook.spec.ts
index e78ed46..8f3735f 100644
--- a/__tests__/models/RemoveFromQueueNotificationWebhook.spec.ts
+++ b/__tests__/models/RemoveFromQueueNotificationWebhook.spec.ts
@@ -2,104 +2,305 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("RemoveFromQueueNotificationWebhook", () => {
- let model: freeclimb.RemoveFromQueueNotificationWebhook =
- new freeclimb.RemoveFromQueueNotificationWebhook({
- requestType: "test_requestType",
- accountId: "test_accountId",
- callId: "test_callId",
- from: "test_from",
- to: "test_to",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.RemoveFromQueueNotificationWebhook;
+ let model: freeclimb.RemoveFromQueueNotificationWebhook =
+ new freeclimb.RemoveFromQueueNotificationWebhook({
+ requestType: "test_requestType",
+ accountId: "test_accountId",
+ callId: "test_callId",
+ from: "test_from",
+ to: "test_to",
- callStatus: freeclimb.CallStatus.QUEUED,
+ callStatus: freeclimb.CallStatus.QUEUED,
- direction: freeclimb.CallDirection.INBOUND,
- conferenceId: "test_conferenceId",
- queueId: "test_queueId",
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "test_conferenceId",
+ queueId: "test_queueId",
- queueResult: freeclimb.QueueResultStatus.QUEUE_FULL,
- queueTime: 1,
+ queueResult: freeclimb.QueueResultStatus.QUEUE_FULL,
+ queueTime: 1,
+ });
+ describe("RemoveFromQueueNotificationWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(
+ freeclimb.RemoveFromQueueNotificationWebhook,
+ );
+ });
});
- describe("RemoveFromQueueNotificationWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(
- freeclimb.RemoveFromQueueNotificationWebhook,
- );
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_conferenceId";
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_queueId";
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe(".queueResult", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queueFull";
+ expect(model.queueResult).toBe(value);
+ });
+ });
+ describe(".queueTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.queueTime).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of RemoveFromQueueNotificationWebhook", () => {
+ expect(
+ freeclimb.RemoveFromQueueNotificationWebhook.deserialize(
+ '{ "requestType": "removeFromQueueNotification"}',
+ ),
+ ).toBeInstanceOf(freeclimb.RemoveFromQueueNotificationWebhook);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.RemoveFromQueueNotificationWebhook;
+ let model: freeclimb.RemoveFromQueueNotificationWebhook =
+ new freeclimb.RemoveFromQueueNotificationWebhook({
+ requestType: "",
+ accountId: "",
+ callId: "",
+ from: "",
+ to: "",
+
+ callStatus: freeclimb.CallStatus.QUEUED,
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ direction: freeclimb.CallDirection.INBOUND,
+ conferenceId: "",
+ queueId: "",
+
+ queueResult: freeclimb.QueueResultStatus.QUEUE_FULL,
+ queueTime: 0,
+ });
+ describe("RemoveFromQueueNotificationWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(
+ freeclimb.RemoveFromQueueNotificationWebhook,
+ );
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".callStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queued";
- expect(model.callStatus).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".direction", () => {
- it("resolves to particular value on initialization", () => {
- const value = "inbound";
- expect(model.direction).toBe(value);
+ describe(".callStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queued";
+ expect(model.callStatus).toBe(value);
+ });
});
- });
- describe(".conferenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_conferenceId";
- expect(model.conferenceId).toBe(value);
+ describe(".direction", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "inbound";
+ expect(model.direction).toBe(value);
+ });
});
- });
- describe(".queueId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_queueId";
- expect(model.queueId).toBe(value);
+ describe(".conferenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.conferenceId).toBe(value);
+ });
});
- });
- describe(".queueResult", () => {
- it("resolves to particular value on initialization", () => {
- const value = "queueFull";
- expect(model.queueResult).toBe(value);
+ describe(".queueId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.queueId).toBe(value);
+ });
});
- });
- describe(".queueTime", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.queueTime).toBe(value);
+ describe(".queueResult", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "queueFull";
+ expect(model.queueResult).toBe(value);
+ });
+ });
+ describe(".queueTime", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.queueTime).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of RemoveFromQueueNotificationWebhook", () => {
+ expect(
+ freeclimb.RemoveFromQueueNotificationWebhook.deserialize(
+ '{ "requestType": "removeFromQueueNotification"}',
+ ),
+ ).toBeInstanceOf(freeclimb.RemoveFromQueueNotificationWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of RemoveFromQueueNotificationWebhook", () => {
- expect(
- freeclimb.RemoveFromQueueNotificationWebhook.deserialize(
- '{ "requestType": "removeFromQueueNotification"}',
- ),
- ).toBeInstanceOf(freeclimb.RemoveFromQueueNotificationWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.RemoveFromQueueNotificationWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.RemoveFromQueueNotificationWebhook =
+ new freeclimb.RemoveFromQueueNotificationWebhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#callStatus", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callStatus",
+ )?.defaultValue;
+ expect(model.callStatus).toBe(value);
+ });
+ });
+ describe("#direction", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "direction",
+ )?.defaultValue;
+ expect(model.direction).toBe(value);
+ });
+ });
+ describe("#conferenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "conferenceId",
+ )?.defaultValue;
+ expect(model.conferenceId).toBe(value);
+ });
+ });
+ describe("#queueId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueId",
+ )?.defaultValue;
+ expect(model.queueId).toBe(value);
+ });
+ });
+ describe("#queueResult", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueResult",
+ )?.defaultValue;
+ expect(model.queueResult).toBe(value);
+ });
+ });
+ describe("#queueTime", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "queueTime",
+ )?.defaultValue;
+ expect(model.queueTime).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/RequestType.spec.ts b/__tests__/models/RequestType.spec.ts
index b958d3e..c7ea80b 100644
--- a/__tests__/models/RequestType.spec.ts
+++ b/__tests__/models/RequestType.spec.ts
@@ -2,131 +2,137 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("RequestType", () => {
- describe(".INBOUND_CALL", () => {
- it("resolves to correct value for INBOUND_CALL enum property", () => {
- expect(freeclimb.RequestType.INBOUND_CALL).toBe("inboundCall");
- });
- });
- describe(".RECORD", () => {
- it("resolves to correct value for RECORD enum property", () => {
- expect(freeclimb.RequestType.RECORD).toBe("record");
- });
- });
- describe(".GET_DIGITS", () => {
- it("resolves to correct value for GET_DIGITS enum property", () => {
- expect(freeclimb.RequestType.GET_DIGITS).toBe("getDigits");
- });
- });
- describe(".GET_SPEECH", () => {
- it("resolves to correct value for GET_SPEECH enum property", () => {
- expect(freeclimb.RequestType.GET_SPEECH).toBe("getSpeech");
- });
- });
- describe(".REDIRECT", () => {
- it("resolves to correct value for REDIRECT enum property", () => {
- expect(freeclimb.RequestType.REDIRECT).toBe("redirect");
- });
- });
- describe(".PAUSE", () => {
- it("resolves to correct value for PAUSE enum property", () => {
- expect(freeclimb.RequestType.PAUSE).toBe("pause");
- });
- });
- describe(".OUT_DIAL_START", () => {
- it("resolves to correct value for OUT_DIAL_START enum property", () => {
- expect(freeclimb.RequestType.OUT_DIAL_START).toBe("outDialStart");
- });
- });
- describe(".OUT_DIAL_CONNECT", () => {
- it("resolves to correct value for OUT_DIAL_CONNECT enum property", () => {
- expect(freeclimb.RequestType.OUT_DIAL_CONNECT).toBe("outDialConnect");
- });
- });
- describe(".OUT_DIAL_API_CONNECT", () => {
- it("resolves to correct value for OUT_DIAL_API_CONNECT enum property", () => {
- expect(freeclimb.RequestType.OUT_DIAL_API_CONNECT).toBe(
- "outDialApiConnect",
- );
- });
- });
- describe(".MACHINE_DETECTED", () => {
- it("resolves to correct value for MACHINE_DETECTED enum property", () => {
- expect(freeclimb.RequestType.MACHINE_DETECTED).toBe("machineDetected");
- });
- });
- describe(".DEQUEUE", () => {
- it("resolves to correct value for DEQUEUE enum property", () => {
- expect(freeclimb.RequestType.DEQUEUE).toBe("dequeue");
- });
- });
- describe(".QUEUE_WAIT", () => {
- it("resolves to correct value for QUEUE_WAIT enum property", () => {
- expect(freeclimb.RequestType.QUEUE_WAIT).toBe("queueWait");
- });
- });
- describe(".ADD_TO_QUEUE_NOTIFICATION", () => {
- it("resolves to correct value for ADD_TO_QUEUE_NOTIFICATION enum property", () => {
- expect(freeclimb.RequestType.ADD_TO_QUEUE_NOTIFICATION).toBe(
- "addToQueueNotification",
- );
- });
- });
- describe(".REMOVE_FROM_QUEUE_NOTIFICATION", () => {
- it("resolves to correct value for REMOVE_FROM_QUEUE_NOTIFICATION enum property", () => {
- expect(freeclimb.RequestType.REMOVE_FROM_QUEUE_NOTIFICATION).toBe(
- "removeFromQueueNotification",
- );
- });
- });
- describe(".CALL_STATUS", () => {
- it("resolves to correct value for CALL_STATUS enum property", () => {
- expect(freeclimb.RequestType.CALL_STATUS).toBe("callStatus");
- });
- });
- describe(".CREATE_CONFERENCE", () => {
- it("resolves to correct value for CREATE_CONFERENCE enum property", () => {
- expect(freeclimb.RequestType.CREATE_CONFERENCE).toBe("createConference");
- });
- });
- describe(".CONFERENCE_STATUS", () => {
- it("resolves to correct value for CONFERENCE_STATUS enum property", () => {
- expect(freeclimb.RequestType.CONFERENCE_STATUS).toBe("conferenceStatus");
- });
- });
- describe(".LEAVE_CONFERENCE", () => {
- it("resolves to correct value for LEAVE_CONFERENCE enum property", () => {
- expect(freeclimb.RequestType.LEAVE_CONFERENCE).toBe("leaveConference");
- });
- });
- describe(".ADD_TO_CONFERENCE_NOTIFICATION", () => {
- it("resolves to correct value for ADD_TO_CONFERENCE_NOTIFICATION enum property", () => {
- expect(freeclimb.RequestType.ADD_TO_CONFERENCE_NOTIFICATION).toBe(
- "addToConferenceNotification",
- );
- });
- });
- describe(".CONFERENCE_RECORDING_STATUS", () => {
- it("resolves to correct value for CONFERENCE_RECORDING_STATUS enum property", () => {
- expect(freeclimb.RequestType.CONFERENCE_RECORDING_STATUS).toBe(
- "conferenceRecordingStatus",
- );
- });
- });
- describe(".CONFERENCE_CALL_CONTROL", () => {
- it("resolves to correct value for CONFERENCE_CALL_CONTROL enum property", () => {
- expect(freeclimb.RequestType.CONFERENCE_CALL_CONTROL).toBe(
- "conferenceCallControl",
- );
- });
- });
- describe(".MESSAGE_DELIVERY", () => {
- it("resolves to correct value for MESSAGE_DELIVERY enum property", () => {
- expect(freeclimb.RequestType.MESSAGE_DELIVERY).toBe("messageDelivery");
- });
- });
- describe(".MESSAGE_STATUS", () => {
- it("resolves to correct value for MESSAGE_STATUS enum property", () => {
- expect(freeclimb.RequestType.MESSAGE_STATUS).toBe("messageStatus");
+ describe("Test with truthy values", () => {
+ describe(".INBOUND_CALL", () => {
+ it("resolves to correct value for INBOUND_CALL enum property", () => {
+ expect(freeclimb.RequestType.INBOUND_CALL).toBe("inboundCall");
+ });
+ });
+ describe(".RECORD", () => {
+ it("resolves to correct value for RECORD enum property", () => {
+ expect(freeclimb.RequestType.RECORD).toBe("record");
+ });
+ });
+ describe(".GET_DIGITS", () => {
+ it("resolves to correct value for GET_DIGITS enum property", () => {
+ expect(freeclimb.RequestType.GET_DIGITS).toBe("getDigits");
+ });
+ });
+ describe(".GET_SPEECH", () => {
+ it("resolves to correct value for GET_SPEECH enum property", () => {
+ expect(freeclimb.RequestType.GET_SPEECH).toBe("getSpeech");
+ });
+ });
+ describe(".REDIRECT", () => {
+ it("resolves to correct value for REDIRECT enum property", () => {
+ expect(freeclimb.RequestType.REDIRECT).toBe("redirect");
+ });
+ });
+ describe(".PAUSE", () => {
+ it("resolves to correct value for PAUSE enum property", () => {
+ expect(freeclimb.RequestType.PAUSE).toBe("pause");
+ });
+ });
+ describe(".OUT_DIAL_START", () => {
+ it("resolves to correct value for OUT_DIAL_START enum property", () => {
+ expect(freeclimb.RequestType.OUT_DIAL_START).toBe("outDialStart");
+ });
+ });
+ describe(".OUT_DIAL_CONNECT", () => {
+ it("resolves to correct value for OUT_DIAL_CONNECT enum property", () => {
+ expect(freeclimb.RequestType.OUT_DIAL_CONNECT).toBe("outDialConnect");
+ });
+ });
+ describe(".OUT_DIAL_API_CONNECT", () => {
+ it("resolves to correct value for OUT_DIAL_API_CONNECT enum property", () => {
+ expect(freeclimb.RequestType.OUT_DIAL_API_CONNECT).toBe(
+ "outDialApiConnect",
+ );
+ });
+ });
+ describe(".MACHINE_DETECTED", () => {
+ it("resolves to correct value for MACHINE_DETECTED enum property", () => {
+ expect(freeclimb.RequestType.MACHINE_DETECTED).toBe("machineDetected");
+ });
+ });
+ describe(".DEQUEUE", () => {
+ it("resolves to correct value for DEQUEUE enum property", () => {
+ expect(freeclimb.RequestType.DEQUEUE).toBe("dequeue");
+ });
+ });
+ describe(".QUEUE_WAIT", () => {
+ it("resolves to correct value for QUEUE_WAIT enum property", () => {
+ expect(freeclimb.RequestType.QUEUE_WAIT).toBe("queueWait");
+ });
+ });
+ describe(".ADD_TO_QUEUE_NOTIFICATION", () => {
+ it("resolves to correct value for ADD_TO_QUEUE_NOTIFICATION enum property", () => {
+ expect(freeclimb.RequestType.ADD_TO_QUEUE_NOTIFICATION).toBe(
+ "addToQueueNotification",
+ );
+ });
+ });
+ describe(".REMOVE_FROM_QUEUE_NOTIFICATION", () => {
+ it("resolves to correct value for REMOVE_FROM_QUEUE_NOTIFICATION enum property", () => {
+ expect(freeclimb.RequestType.REMOVE_FROM_QUEUE_NOTIFICATION).toBe(
+ "removeFromQueueNotification",
+ );
+ });
+ });
+ describe(".CALL_STATUS", () => {
+ it("resolves to correct value for CALL_STATUS enum property", () => {
+ expect(freeclimb.RequestType.CALL_STATUS).toBe("callStatus");
+ });
+ });
+ describe(".CREATE_CONFERENCE", () => {
+ it("resolves to correct value for CREATE_CONFERENCE enum property", () => {
+ expect(freeclimb.RequestType.CREATE_CONFERENCE).toBe(
+ "createConference",
+ );
+ });
+ });
+ describe(".CONFERENCE_STATUS", () => {
+ it("resolves to correct value for CONFERENCE_STATUS enum property", () => {
+ expect(freeclimb.RequestType.CONFERENCE_STATUS).toBe(
+ "conferenceStatus",
+ );
+ });
+ });
+ describe(".LEAVE_CONFERENCE", () => {
+ it("resolves to correct value for LEAVE_CONFERENCE enum property", () => {
+ expect(freeclimb.RequestType.LEAVE_CONFERENCE).toBe("leaveConference");
+ });
+ });
+ describe(".ADD_TO_CONFERENCE_NOTIFICATION", () => {
+ it("resolves to correct value for ADD_TO_CONFERENCE_NOTIFICATION enum property", () => {
+ expect(freeclimb.RequestType.ADD_TO_CONFERENCE_NOTIFICATION).toBe(
+ "addToConferenceNotification",
+ );
+ });
+ });
+ describe(".CONFERENCE_RECORDING_STATUS", () => {
+ it("resolves to correct value for CONFERENCE_RECORDING_STATUS enum property", () => {
+ expect(freeclimb.RequestType.CONFERENCE_RECORDING_STATUS).toBe(
+ "conferenceRecordingStatus",
+ );
+ });
+ });
+ describe(".CONFERENCE_CALL_CONTROL", () => {
+ it("resolves to correct value for CONFERENCE_CALL_CONTROL enum property", () => {
+ expect(freeclimb.RequestType.CONFERENCE_CALL_CONTROL).toBe(
+ "conferenceCallControl",
+ );
+ });
+ });
+ describe(".MESSAGE_DELIVERY", () => {
+ it("resolves to correct value for MESSAGE_DELIVERY enum property", () => {
+ expect(freeclimb.RequestType.MESSAGE_DELIVERY).toBe("messageDelivery");
+ });
+ });
+ describe(".MESSAGE_STATUS", () => {
+ it("resolves to correct value for MESSAGE_STATUS enum property", () => {
+ expect(freeclimb.RequestType.MESSAGE_STATUS).toBe("messageStatus");
+ });
});
});
});
diff --git a/__tests__/models/SMSTenDLCBrand.spec.ts b/__tests__/models/SMSTenDLCBrand.spec.ts
index d596cba..2f51035 100644
--- a/__tests__/models/SMSTenDLCBrand.spec.ts
+++ b/__tests__/models/SMSTenDLCBrand.spec.ts
@@ -2,230 +2,707 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCBrand", () => {
- let model: freeclimb.SMSTenDLCBrand = new freeclimb.SMSTenDLCBrand({
- accountId: "test_accountId",
-
- entityType: freeclimb.SMSTenDLCBrandEntityType.PRIVATE_PROFIT,
- cspId: "test_cspId",
- brandId: "test_brandId",
- firstName: "test_firstName",
- lastName: "test_lastName",
- displayName: "test_displayName",
- companyName: "test_companyName",
- ein: "test_ein",
- einIssuingCountry: "test_einIssuingCountry",
- phone: "test_phone",
- street: "test_street",
- city: "test_city",
- state: "test_state",
- postalCode: "test_postalCode",
- country: "test_country",
- email: "test_email",
- stockSymbol: "test_stockSymbol",
-
- stockExchange: freeclimb.SMSTenDLCBrandStockExchange.NONE,
- ipAddress: "test_ipAddress",
- website: "test_website",
-
- brandRelationship: freeclimb.SMSTenDLCBrandRelationship.BASIC_ACCOUNT,
- vertical: "test_vertical",
- altBusinessId: "test_altBusinessId",
-
- altBusinessIdType: freeclimb.SMSTenDLCBrandAltBusinessIdType.NONE,
- universalEin: "test_universalEin",
- referenceId: "test_referenceId",
-
- mock: true,
-
- identityStatus: freeclimb.SMSTenDLCBrandIdentityStatus.SELF_DECLARED,
- createDate: new Date("December 17, 1995 03:24:00"),
- });
- describe("SMSTenDLCBrand class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.SMSTenDLCBrand);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.SMSTenDLCBrand;
+ let model: freeclimb.SMSTenDLCBrand = new freeclimb.SMSTenDLCBrand({
+ accountId: "test_accountId",
+
+ entityType: freeclimb.SMSTenDLCBrandEntityType.PRIVATE_PROFIT,
+ cspId: "test_cspId",
+ brandId: "test_brandId",
+ firstName: "test_firstName",
+ lastName: "test_lastName",
+ displayName: "test_displayName",
+ companyName: "test_companyName",
+ ein: "test_ein",
+ einIssuingCountry: "test_einIssuingCountry",
+ phone: "test_phone",
+ street: "test_street",
+ city: "test_city",
+ state: "test_state",
+ postalCode: "test_postalCode",
+ country: "test_country",
+ email: "test_email",
+ stockSymbol: "test_stockSymbol",
+
+ stockExchange: freeclimb.SMSTenDLCBrandStockExchange.NONE,
+ ipAddress: "test_ipAddress",
+ website: "test_website",
+
+ brandRelationship: freeclimb.SMSTenDLCBrandRelationship.BASIC_ACCOUNT,
+ vertical: "test_vertical",
+ altBusinessId: "test_altBusinessId",
+
+ altBusinessIdType: freeclimb.SMSTenDLCBrandAltBusinessIdType.NONE,
+ universalEin: "test_universalEin",
+ referenceId: "test_referenceId",
+
+ mock: true,
+
+ identityStatus: freeclimb.SMSTenDLCBrandIdentityStatus.SELF_DECLARED,
+ createDate: new Date("December 17, 1995 03:24:00"),
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe("SMSTenDLCBrand class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTenDLCBrand);
+ });
});
- });
- describe(".entityType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "PRIVATE_PROFIT";
- expect(model.entityType).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".cspId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_cspId";
- expect(model.cspId).toBe(value);
+ describe(".entityType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "PRIVATE_PROFIT";
+ expect(model.entityType).toBe(value);
+ });
});
- });
- describe(".brandId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_brandId";
- expect(model.brandId).toBe(value);
+ describe(".cspId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_cspId";
+ expect(model.cspId).toBe(value);
+ });
});
- });
- describe(".firstName", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_firstName";
- expect(model.firstName).toBe(value);
+ describe(".brandId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_brandId";
+ expect(model.brandId).toBe(value);
+ });
});
- });
- describe(".lastName", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_lastName";
- expect(model.lastName).toBe(value);
+ describe(".firstName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_firstName";
+ expect(model.firstName).toBe(value);
+ });
});
- });
- describe(".displayName", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_displayName";
- expect(model.displayName).toBe(value);
+ describe(".lastName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_lastName";
+ expect(model.lastName).toBe(value);
+ });
});
- });
- describe(".companyName", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_companyName";
- expect(model.companyName).toBe(value);
+ describe(".displayName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_displayName";
+ expect(model.displayName).toBe(value);
+ });
});
- });
- describe(".ein", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_ein";
- expect(model.ein).toBe(value);
+ describe(".companyName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_companyName";
+ expect(model.companyName).toBe(value);
+ });
});
- });
- describe(".einIssuingCountry", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_einIssuingCountry";
- expect(model.einIssuingCountry).toBe(value);
+ describe(".ein", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_ein";
+ expect(model.ein).toBe(value);
+ });
});
- });
- describe(".phone", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_phone";
- expect(model.phone).toBe(value);
+ describe(".einIssuingCountry", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_einIssuingCountry";
+ expect(model.einIssuingCountry).toBe(value);
+ });
});
- });
- describe(".street", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_street";
- expect(model.street).toBe(value);
+ describe(".phone", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_phone";
+ expect(model.phone).toBe(value);
+ });
});
- });
- describe(".city", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_city";
- expect(model.city).toBe(value);
+ describe(".street", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_street";
+ expect(model.street).toBe(value);
+ });
});
- });
- describe(".state", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_state";
- expect(model.state).toBe(value);
+ describe(".city", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_city";
+ expect(model.city).toBe(value);
+ });
});
- });
- describe(".postalCode", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_postalCode";
- expect(model.postalCode).toBe(value);
+ describe(".state", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_state";
+ expect(model.state).toBe(value);
+ });
});
- });
- describe(".country", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_country";
- expect(model.country).toBe(value);
+ describe(".postalCode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_postalCode";
+ expect(model.postalCode).toBe(value);
+ });
});
- });
- describe(".email", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_email";
- expect(model.email).toBe(value);
+ describe(".country", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_country";
+ expect(model.country).toBe(value);
+ });
});
- });
- describe(".stockSymbol", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_stockSymbol";
- expect(model.stockSymbol).toBe(value);
+ describe(".email", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_email";
+ expect(model.email).toBe(value);
+ });
});
- });
- describe(".stockExchange", () => {
- it("resolves to particular value on initialization", () => {
- const value = "NONE";
- expect(model.stockExchange).toBe(value);
+ describe(".stockSymbol", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_stockSymbol";
+ expect(model.stockSymbol).toBe(value);
+ });
});
- });
- describe(".ipAddress", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_ipAddress";
- expect(model.ipAddress).toBe(value);
+ describe(".stockExchange", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "NONE";
+ expect(model.stockExchange).toBe(value);
+ });
});
- });
- describe(".website", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_website";
- expect(model.website).toBe(value);
+ describe(".ipAddress", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_ipAddress";
+ expect(model.ipAddress).toBe(value);
+ });
});
- });
- describe(".brandRelationship", () => {
- it("resolves to particular value on initialization", () => {
- const value = "BASIC_ACCOUNT";
- expect(model.brandRelationship).toBe(value);
+ describe(".website", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_website";
+ expect(model.website).toBe(value);
+ });
});
- });
- describe(".vertical", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_vertical";
- expect(model.vertical).toBe(value);
+ describe(".brandRelationship", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "BASIC_ACCOUNT";
+ expect(model.brandRelationship).toBe(value);
+ });
});
- });
- describe(".altBusinessId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_altBusinessId";
- expect(model.altBusinessId).toBe(value);
+ describe(".vertical", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_vertical";
+ expect(model.vertical).toBe(value);
+ });
});
- });
- describe(".altBusinessIdType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "NONE";
- expect(model.altBusinessIdType).toBe(value);
+ describe(".altBusinessId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_altBusinessId";
+ expect(model.altBusinessId).toBe(value);
+ });
});
- });
- describe(".universalEin", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_universalEin";
- expect(model.universalEin).toBe(value);
+ describe(".altBusinessIdType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "NONE";
+ expect(model.altBusinessIdType).toBe(value);
+ });
});
- });
- describe(".referenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_referenceId";
- expect(model.referenceId).toBe(value);
+ describe(".universalEin", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_universalEin";
+ expect(model.universalEin).toBe(value);
+ });
});
- });
- describe(".optionalAttributes", () => {
- it("resolves to particular value on initialization", () => {});
- });
- describe(".mock", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.mock).toBe(value);
+ describe(".referenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_referenceId";
+ expect(model.referenceId).toBe(value);
+ });
+ });
+ describe(".optionalAttributes", () => {
+ it("resolves to particular value on initialization", () => {});
+ });
+ describe(".mock", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.mock).toBe(value);
+ });
+ });
+ describe(".identityStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "SELF_DECLARED";
+ expect(model.identityStatus).toBe(value);
+ });
+ });
+ describe(".createDate", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new Date("December 17, 1995 03:24:00");
+ expect(model.createDate).toStrictEqual(value);
+ });
});
});
- describe(".identityStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "SELF_DECLARED";
- expect(model.identityStatus).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.SMSTenDLCBrand;
+ let model: freeclimb.SMSTenDLCBrand = new freeclimb.SMSTenDLCBrand({
+ accountId: "",
+
+ entityType: freeclimb.SMSTenDLCBrandEntityType.PRIVATE_PROFIT,
+ cspId: "",
+ brandId: "",
+ firstName: "",
+ lastName: "",
+ displayName: "",
+ companyName: "",
+ ein: "",
+ einIssuingCountry: "",
+ phone: "",
+ street: "",
+ city: "",
+ state: "",
+ postalCode: "",
+ country: "",
+ email: "",
+ stockSymbol: "",
+
+ stockExchange: freeclimb.SMSTenDLCBrandStockExchange.NONE,
+ ipAddress: "",
+ website: "",
+
+ brandRelationship: freeclimb.SMSTenDLCBrandRelationship.BASIC_ACCOUNT,
+ vertical: "",
+ altBusinessId: "",
+
+ altBusinessIdType: freeclimb.SMSTenDLCBrandAltBusinessIdType.NONE,
+ universalEin: "",
+ referenceId: "",
+
+ mock: false,
+
+ identityStatus: freeclimb.SMSTenDLCBrandIdentityStatus.SELF_DECLARED,
+ createDate: undefined,
+ });
+ describe("SMSTenDLCBrand class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTenDLCBrand);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".entityType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "PRIVATE_PROFIT";
+ expect(model.entityType).toBe(value);
+ });
+ });
+ describe(".cspId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.cspId).toBe(value);
+ });
+ });
+ describe(".brandId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.brandId).toBe(value);
+ });
+ });
+ describe(".firstName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.firstName).toBe(value);
+ });
+ });
+ describe(".lastName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.lastName).toBe(value);
+ });
+ });
+ describe(".displayName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.displayName).toBe(value);
+ });
+ });
+ describe(".companyName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.companyName).toBe(value);
+ });
+ });
+ describe(".ein", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.ein).toBe(value);
+ });
+ });
+ describe(".einIssuingCountry", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.einIssuingCountry).toBe(value);
+ });
+ });
+ describe(".phone", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.phone).toBe(value);
+ });
+ });
+ describe(".street", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.street).toBe(value);
+ });
+ });
+ describe(".city", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.city).toBe(value);
+ });
+ });
+ describe(".state", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.state).toBe(value);
+ });
+ });
+ describe(".postalCode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.postalCode).toBe(value);
+ });
+ });
+ describe(".country", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.country).toBe(value);
+ });
+ });
+ describe(".email", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.email).toBe(value);
+ });
+ });
+ describe(".stockSymbol", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.stockSymbol).toBe(value);
+ });
+ });
+ describe(".stockExchange", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "NONE";
+ expect(model.stockExchange).toBe(value);
+ });
+ });
+ describe(".ipAddress", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.ipAddress).toBe(value);
+ });
+ });
+ describe(".website", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.website).toBe(value);
+ });
+ });
+ describe(".brandRelationship", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "BASIC_ACCOUNT";
+ expect(model.brandRelationship).toBe(value);
+ });
+ });
+ describe(".vertical", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.vertical).toBe(value);
+ });
+ });
+ describe(".altBusinessId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.altBusinessId).toBe(value);
+ });
+ });
+ describe(".altBusinessIdType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "NONE";
+ expect(model.altBusinessIdType).toBe(value);
+ });
+ });
+ describe(".universalEin", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.universalEin).toBe(value);
+ });
+ });
+ describe(".referenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.referenceId).toBe(value);
+ });
+ });
+ describe(".optionalAttributes", () => {
+ it("resolves to particular value on initialization", () => {});
+ });
+ describe(".mock", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.mock).toBe(value);
+ });
+ });
+ describe(".identityStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "SELF_DECLARED";
+ expect(model.identityStatus).toBe(value);
+ });
+ });
+ describe(".createDate", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = undefined;
+ expect(model.createDate).toStrictEqual(value);
+ });
});
});
- describe(".createDate", () => {
- it("resolves to particular value on initialization", () => {
- const value = new Date("December 17, 1995 03:24:00");
- expect(model.createDate).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.SMSTenDLCBrand;
+ let constructorArguments = {
+ entityType: freeclimb.SMSTenDLCBrandEntityType.PRIVATE_PROFIT,
+ displayName: "test_displayName",
+ phone: "test_phone",
+ country: "test_country",
+ email: "test_email",
+
+ brandRelationship: freeclimb.SMSTenDLCBrandRelationship.BASIC_ACCOUNT,
+ vertical: "test_vertical",
+ mock: true,
+
+ identityStatus: freeclimb.SMSTenDLCBrandIdentityStatus.SELF_DECLARED,
+ };
+ let model: freeclimb.SMSTenDLCBrand = new freeclimb.SMSTenDLCBrand(
+ constructorArguments,
+ );
+
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#entityType", () => {
+ it("resolves to initialization value", () => {
+ expect(model.entityType).toBe(constructorArguments["entityType"]);
+ });
+ });
+ describe("#cspId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "cspId",
+ )?.defaultValue;
+ expect(model.cspId).toBe(value);
+ });
+ });
+ describe("#brandId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "brandId",
+ )?.defaultValue;
+ expect(model.brandId).toBe(value);
+ });
+ });
+ describe("#firstName", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "firstName",
+ )?.defaultValue;
+ expect(model.firstName).toBe(value);
+ });
+ });
+ describe("#lastName", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "lastName",
+ )?.defaultValue;
+ expect(model.lastName).toBe(value);
+ });
+ });
+ describe("#displayName", () => {
+ it("resolves to initialization value", () => {
+ expect(model.displayName).toBe(constructorArguments["displayName"]);
+ });
+ });
+ describe("#companyName", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "companyName",
+ )?.defaultValue;
+ expect(model.companyName).toBe(value);
+ });
+ });
+ describe("#ein", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "ein",
+ )?.defaultValue;
+ expect(model.ein).toBe(value);
+ });
+ });
+ describe("#einIssuingCountry", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "einIssuingCountry",
+ )?.defaultValue;
+ expect(model.einIssuingCountry).toBe(value);
+ });
+ });
+ describe("#phone", () => {
+ it("resolves to initialization value", () => {
+ expect(model.phone).toBe(constructorArguments["phone"]);
+ });
+ });
+ describe("#street", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "street",
+ )?.defaultValue;
+ expect(model.street).toBe(value);
+ });
+ });
+ describe("#city", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "city",
+ )?.defaultValue;
+ expect(model.city).toBe(value);
+ });
+ });
+ describe("#state", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "state",
+ )?.defaultValue;
+ expect(model.state).toBe(value);
+ });
+ });
+ describe("#postalCode", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "postalCode",
+ )?.defaultValue;
+ expect(model.postalCode).toBe(value);
+ });
+ });
+ describe("#country", () => {
+ it("resolves to initialization value", () => {
+ expect(model.country).toBe(constructorArguments["country"]);
+ });
+ });
+ describe("#email", () => {
+ it("resolves to initialization value", () => {
+ expect(model.email).toBe(constructorArguments["email"]);
+ });
+ });
+ describe("#stockSymbol", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "stockSymbol",
+ )?.defaultValue;
+ expect(model.stockSymbol).toBe(value);
+ });
+ });
+ describe("#stockExchange", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "stockExchange",
+ )?.defaultValue;
+ expect(model.stockExchange).toBe(value);
+ });
+ });
+ describe("#ipAddress", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "ipAddress",
+ )?.defaultValue;
+ expect(model.ipAddress).toBe(value);
+ });
+ });
+ describe("#website", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "website",
+ )?.defaultValue;
+ expect(model.website).toBe(value);
+ });
+ });
+ describe("#brandRelationship", () => {
+ it("resolves to initialization value", () => {
+ expect(model.brandRelationship).toBe(
+ constructorArguments["brandRelationship"],
+ );
+ });
+ });
+ describe("#vertical", () => {
+ it("resolves to initialization value", () => {
+ expect(model.vertical).toBe(constructorArguments["vertical"]);
+ });
+ });
+ describe("#altBusinessId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "altBusinessId",
+ )?.defaultValue;
+ expect(model.altBusinessId).toBe(value);
+ });
+ });
+ describe("#altBusinessIdType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "altBusinessIdType",
+ )?.defaultValue;
+ expect(model.altBusinessIdType).toBe(value);
+ });
+ });
+ describe("#universalEin", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "universalEin",
+ )?.defaultValue;
+ expect(model.universalEin).toBe(value);
+ });
+ });
+ describe("#referenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "referenceId",
+ )?.defaultValue;
+ expect(model.referenceId).toBe(value);
+ });
+ });
+ describe("#optionalAttributes", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "optionalAttributes",
+ )?.defaultValue;
+ expect(model.optionalAttributes).toBe(value);
+ });
+ });
+ describe("#mock", () => {
+ it("resolves to initialization value", () => {
+ expect(model.mock).toBe(constructorArguments["mock"]);
+ });
+ });
+ describe("#identityStatus", () => {
+ it("resolves to initialization value", () => {
+ expect(model.identityStatus).toBe(
+ constructorArguments["identityStatus"],
+ );
+ });
+ });
+ describe("#createDate", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "createDate",
+ )?.defaultValue;
+ expect(model.createDate).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/SMSTenDLCBrandAltBusinessIdType.spec.ts b/__tests__/models/SMSTenDLCBrandAltBusinessIdType.spec.ts
index e57434c..2d74a2c 100644
--- a/__tests__/models/SMSTenDLCBrandAltBusinessIdType.spec.ts
+++ b/__tests__/models/SMSTenDLCBrandAltBusinessIdType.spec.ts
@@ -2,24 +2,26 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCBrandAltBusinessIdType", () => {
- describe(".NONE", () => {
- it("resolves to correct value for NONE enum property", () => {
- expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.NONE).toBe("NONE");
+ describe("Test with truthy values", () => {
+ describe(".NONE", () => {
+ it("resolves to correct value for NONE enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.NONE).toBe("NONE");
+ });
});
- });
- describe(".DUNS", () => {
- it("resolves to correct value for DUNS enum property", () => {
- expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.DUNS).toBe("DUNS");
+ describe(".DUNS", () => {
+ it("resolves to correct value for DUNS enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.DUNS).toBe("DUNS");
+ });
});
- });
- describe(".GIIN", () => {
- it("resolves to correct value for GIIN enum property", () => {
- expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.GIIN).toBe("GIIN");
+ describe(".GIIN", () => {
+ it("resolves to correct value for GIIN enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.GIIN).toBe("GIIN");
+ });
});
- });
- describe(".LEI", () => {
- it("resolves to correct value for LEI enum property", () => {
- expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.LEI).toBe("LEI");
+ describe(".LEI", () => {
+ it("resolves to correct value for LEI enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandAltBusinessIdType.LEI).toBe("LEI");
+ });
});
});
});
diff --git a/__tests__/models/SMSTenDLCBrandEntityType.spec.ts b/__tests__/models/SMSTenDLCBrandEntityType.spec.ts
index 15baa37..3476f57 100644
--- a/__tests__/models/SMSTenDLCBrandEntityType.spec.ts
+++ b/__tests__/models/SMSTenDLCBrandEntityType.spec.ts
@@ -2,35 +2,41 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCBrandEntityType", () => {
- describe(".PRIVATE_PROFIT", () => {
- it("resolves to correct value for PRIVATE_PROFIT enum property", () => {
- expect(freeclimb.SMSTenDLCBrandEntityType.PRIVATE_PROFIT).toBe(
- "PRIVATE_PROFIT",
- );
+ describe("Test with truthy values", () => {
+ describe(".PRIVATE_PROFIT", () => {
+ it("resolves to correct value for PRIVATE_PROFIT enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandEntityType.PRIVATE_PROFIT).toBe(
+ "PRIVATE_PROFIT",
+ );
+ });
});
- });
- describe(".PUBLIC_PROFIT", () => {
- it("resolves to correct value for PUBLIC_PROFIT enum property", () => {
- expect(freeclimb.SMSTenDLCBrandEntityType.PUBLIC_PROFIT).toBe(
- "PUBLIC_PROFIT",
- );
+ describe(".PUBLIC_PROFIT", () => {
+ it("resolves to correct value for PUBLIC_PROFIT enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandEntityType.PUBLIC_PROFIT).toBe(
+ "PUBLIC_PROFIT",
+ );
+ });
});
- });
- describe(".NON_PROFIT", () => {
- it("resolves to correct value for NON_PROFIT enum property", () => {
- expect(freeclimb.SMSTenDLCBrandEntityType.NON_PROFIT).toBe("NON_PROFIT");
+ describe(".NON_PROFIT", () => {
+ it("resolves to correct value for NON_PROFIT enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandEntityType.NON_PROFIT).toBe(
+ "NON_PROFIT",
+ );
+ });
});
- });
- describe(".GOVERNMENT", () => {
- it("resolves to correct value for GOVERNMENT enum property", () => {
- expect(freeclimb.SMSTenDLCBrandEntityType.GOVERNMENT).toBe("GOVERNMENT");
+ describe(".GOVERNMENT", () => {
+ it("resolves to correct value for GOVERNMENT enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandEntityType.GOVERNMENT).toBe(
+ "GOVERNMENT",
+ );
+ });
});
- });
- describe(".SOLE_PROPRIETOR", () => {
- it("resolves to correct value for SOLE_PROPRIETOR enum property", () => {
- expect(freeclimb.SMSTenDLCBrandEntityType.SOLE_PROPRIETOR).toBe(
- "SOLE_PROPRIETOR",
- );
+ describe(".SOLE_PROPRIETOR", () => {
+ it("resolves to correct value for SOLE_PROPRIETOR enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandEntityType.SOLE_PROPRIETOR).toBe(
+ "SOLE_PROPRIETOR",
+ );
+ });
});
});
});
diff --git a/__tests__/models/SMSTenDLCBrandIdentityStatus.spec.ts b/__tests__/models/SMSTenDLCBrandIdentityStatus.spec.ts
index 5dbaa56..f9fc2e3 100644
--- a/__tests__/models/SMSTenDLCBrandIdentityStatus.spec.ts
+++ b/__tests__/models/SMSTenDLCBrandIdentityStatus.spec.ts
@@ -2,30 +2,34 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCBrandIdentityStatus", () => {
- describe(".SELF_DECLARED", () => {
- it("resolves to correct value for SELF_DECLARED enum property", () => {
- expect(freeclimb.SMSTenDLCBrandIdentityStatus.SELF_DECLARED).toBe(
- "SELF_DECLARED",
- );
+ describe("Test with truthy values", () => {
+ describe(".SELF_DECLARED", () => {
+ it("resolves to correct value for SELF_DECLARED enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandIdentityStatus.SELF_DECLARED).toBe(
+ "SELF_DECLARED",
+ );
+ });
});
- });
- describe(".UNVERIFIED", () => {
- it("resolves to correct value for UNVERIFIED enum property", () => {
- expect(freeclimb.SMSTenDLCBrandIdentityStatus.UNVERIFIED).toBe(
- "UNVERIFIED",
- );
+ describe(".UNVERIFIED", () => {
+ it("resolves to correct value for UNVERIFIED enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandIdentityStatus.UNVERIFIED).toBe(
+ "UNVERIFIED",
+ );
+ });
});
- });
- describe(".VERIFIED", () => {
- it("resolves to correct value for VERIFIED enum property", () => {
- expect(freeclimb.SMSTenDLCBrandIdentityStatus.VERIFIED).toBe("VERIFIED");
+ describe(".VERIFIED", () => {
+ it("resolves to correct value for VERIFIED enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandIdentityStatus.VERIFIED).toBe(
+ "VERIFIED",
+ );
+ });
});
- });
- describe(".VETTED_VERIFIED", () => {
- it("resolves to correct value for VETTED_VERIFIED enum property", () => {
- expect(freeclimb.SMSTenDLCBrandIdentityStatus.VETTED_VERIFIED).toBe(
- "VETTED_VERIFIED",
- );
+ describe(".VETTED_VERIFIED", () => {
+ it("resolves to correct value for VETTED_VERIFIED enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandIdentityStatus.VETTED_VERIFIED).toBe(
+ "VETTED_VERIFIED",
+ );
+ });
});
});
});
diff --git a/__tests__/models/SMSTenDLCBrandRelationship.spec.ts b/__tests__/models/SMSTenDLCBrandRelationship.spec.ts
index 1877cea..bc4260f 100644
--- a/__tests__/models/SMSTenDLCBrandRelationship.spec.ts
+++ b/__tests__/models/SMSTenDLCBrandRelationship.spec.ts
@@ -2,39 +2,41 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCBrandRelationship", () => {
- describe(".BASIC_ACCOUNT", () => {
- it("resolves to correct value for BASIC_ACCOUNT enum property", () => {
- expect(freeclimb.SMSTenDLCBrandRelationship.BASIC_ACCOUNT).toBe(
- "BASIC_ACCOUNT",
- );
+ describe("Test with truthy values", () => {
+ describe(".BASIC_ACCOUNT", () => {
+ it("resolves to correct value for BASIC_ACCOUNT enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandRelationship.BASIC_ACCOUNT).toBe(
+ "BASIC_ACCOUNT",
+ );
+ });
});
- });
- describe(".SMALL_ACCOUNT", () => {
- it("resolves to correct value for SMALL_ACCOUNT enum property", () => {
- expect(freeclimb.SMSTenDLCBrandRelationship.SMALL_ACCOUNT).toBe(
- "SMALL_ACCOUNT",
- );
+ describe(".SMALL_ACCOUNT", () => {
+ it("resolves to correct value for SMALL_ACCOUNT enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandRelationship.SMALL_ACCOUNT).toBe(
+ "SMALL_ACCOUNT",
+ );
+ });
});
- });
- describe(".MEDIUM_ACCOUNT", () => {
- it("resolves to correct value for MEDIUM_ACCOUNT enum property", () => {
- expect(freeclimb.SMSTenDLCBrandRelationship.MEDIUM_ACCOUNT).toBe(
- "MEDIUM_ACCOUNT",
- );
+ describe(".MEDIUM_ACCOUNT", () => {
+ it("resolves to correct value for MEDIUM_ACCOUNT enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandRelationship.MEDIUM_ACCOUNT).toBe(
+ "MEDIUM_ACCOUNT",
+ );
+ });
});
- });
- describe(".LARGE_ACCOUNT", () => {
- it("resolves to correct value for LARGE_ACCOUNT enum property", () => {
- expect(freeclimb.SMSTenDLCBrandRelationship.LARGE_ACCOUNT).toBe(
- "LARGE_ACCOUNT",
- );
+ describe(".LARGE_ACCOUNT", () => {
+ it("resolves to correct value for LARGE_ACCOUNT enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandRelationship.LARGE_ACCOUNT).toBe(
+ "LARGE_ACCOUNT",
+ );
+ });
});
- });
- describe(".KEY_ACCOUNT", () => {
- it("resolves to correct value for KEY_ACCOUNT enum property", () => {
- expect(freeclimb.SMSTenDLCBrandRelationship.KEY_ACCOUNT).toBe(
- "KEY_ACCOUNT",
- );
+ describe(".KEY_ACCOUNT", () => {
+ it("resolves to correct value for KEY_ACCOUNT enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandRelationship.KEY_ACCOUNT).toBe(
+ "KEY_ACCOUNT",
+ );
+ });
});
});
});
diff --git a/__tests__/models/SMSTenDLCBrandStockExchange.spec.ts b/__tests__/models/SMSTenDLCBrandStockExchange.spec.ts
index 59f7d57..bf5b3d5 100644
--- a/__tests__/models/SMSTenDLCBrandStockExchange.spec.ts
+++ b/__tests__/models/SMSTenDLCBrandStockExchange.spec.ts
@@ -2,139 +2,141 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCBrandStockExchange", () => {
- describe(".NONE", () => {
- it("resolves to correct value for NONE enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.NONE).toBe("NONE");
- });
- });
- describe(".NASDAQ", () => {
- it("resolves to correct value for NASDAQ enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.NASDAQ).toBe("NASDAQ");
- });
- });
- describe(".NYSE", () => {
- it("resolves to correct value for NYSE enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.NYSE).toBe("NYSE");
- });
- });
- describe(".AMEX", () => {
- it("resolves to correct value for AMEX enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.AMEX).toBe("AMEX");
- });
- });
- describe(".AMX", () => {
- it("resolves to correct value for AMX enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.AMX).toBe("AMX");
- });
- });
- describe(".ASX", () => {
- it("resolves to correct value for ASX enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.ASX).toBe("ASX");
- });
- });
- describe(".B3", () => {
- it("resolves to correct value for B3 enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.B3).toBe("B3");
- });
- });
- describe(".BME", () => {
- it("resolves to correct value for BME enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.BME).toBe("BME");
- });
- });
- describe(".BSE", () => {
- it("resolves to correct value for BSE enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.BSE).toBe("BSE");
- });
- });
- describe(".FRA", () => {
- it("resolves to correct value for FRA enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.FRA).toBe("FRA");
- });
- });
- describe(".ICEX", () => {
- it("resolves to correct value for ICEX enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.ICEX).toBe("ICEX");
- });
- });
- describe(".JPX", () => {
- it("resolves to correct value for JPX enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.JPX).toBe("JPX");
- });
- });
- describe(".JSE", () => {
- it("resolves to correct value for JSE enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.JSE).toBe("JSE");
- });
- });
- describe(".KRX", () => {
- it("resolves to correct value for KRX enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.KRX).toBe("KRX");
- });
- });
- describe(".LON", () => {
- it("resolves to correct value for LON enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.LON).toBe("LON");
- });
- });
- describe(".NSE", () => {
- it("resolves to correct value for NSE enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.NSE).toBe("NSE");
- });
- });
- describe(".OMX", () => {
- it("resolves to correct value for OMX enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.OMX).toBe("OMX");
- });
- });
- describe(".SEHK", () => {
- it("resolves to correct value for SEHK enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.SEHK).toBe("SEHK");
- });
- });
- describe(".SGX", () => {
- it("resolves to correct value for SGX enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.SGX).toBe("SGX");
- });
- });
- describe(".SSE", () => {
- it("resolves to correct value for SSE enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.SSE).toBe("SSE");
- });
- });
- describe(".STO", () => {
- it("resolves to correct value for STO enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.STO).toBe("STO");
- });
- });
- describe(".SWX", () => {
- it("resolves to correct value for SWX enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.SWX).toBe("SWX");
- });
- });
- describe(".SZSE", () => {
- it("resolves to correct value for SZSE enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.SZSE).toBe("SZSE");
- });
- });
- describe(".TSX", () => {
- it("resolves to correct value for TSX enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.TSX).toBe("TSX");
- });
- });
- describe(".TWSE", () => {
- it("resolves to correct value for TWSE enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.TWSE).toBe("TWSE");
- });
- });
- describe(".VSE", () => {
- it("resolves to correct value for VSE enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.VSE).toBe("VSE");
- });
- });
- describe(".OTHER", () => {
- it("resolves to correct value for OTHER enum property", () => {
- expect(freeclimb.SMSTenDLCBrandStockExchange.OTHER).toBe("OTHER");
+ describe("Test with truthy values", () => {
+ describe(".NONE", () => {
+ it("resolves to correct value for NONE enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.NONE).toBe("NONE");
+ });
+ });
+ describe(".NASDAQ", () => {
+ it("resolves to correct value for NASDAQ enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.NASDAQ).toBe("NASDAQ");
+ });
+ });
+ describe(".NYSE", () => {
+ it("resolves to correct value for NYSE enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.NYSE).toBe("NYSE");
+ });
+ });
+ describe(".AMEX", () => {
+ it("resolves to correct value for AMEX enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.AMEX).toBe("AMEX");
+ });
+ });
+ describe(".AMX", () => {
+ it("resolves to correct value for AMX enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.AMX).toBe("AMX");
+ });
+ });
+ describe(".ASX", () => {
+ it("resolves to correct value for ASX enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.ASX).toBe("ASX");
+ });
+ });
+ describe(".B3", () => {
+ it("resolves to correct value for B3 enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.B3).toBe("B3");
+ });
+ });
+ describe(".BME", () => {
+ it("resolves to correct value for BME enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.BME).toBe("BME");
+ });
+ });
+ describe(".BSE", () => {
+ it("resolves to correct value for BSE enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.BSE).toBe("BSE");
+ });
+ });
+ describe(".FRA", () => {
+ it("resolves to correct value for FRA enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.FRA).toBe("FRA");
+ });
+ });
+ describe(".ICEX", () => {
+ it("resolves to correct value for ICEX enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.ICEX).toBe("ICEX");
+ });
+ });
+ describe(".JPX", () => {
+ it("resolves to correct value for JPX enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.JPX).toBe("JPX");
+ });
+ });
+ describe(".JSE", () => {
+ it("resolves to correct value for JSE enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.JSE).toBe("JSE");
+ });
+ });
+ describe(".KRX", () => {
+ it("resolves to correct value for KRX enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.KRX).toBe("KRX");
+ });
+ });
+ describe(".LON", () => {
+ it("resolves to correct value for LON enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.LON).toBe("LON");
+ });
+ });
+ describe(".NSE", () => {
+ it("resolves to correct value for NSE enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.NSE).toBe("NSE");
+ });
+ });
+ describe(".OMX", () => {
+ it("resolves to correct value for OMX enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.OMX).toBe("OMX");
+ });
+ });
+ describe(".SEHK", () => {
+ it("resolves to correct value for SEHK enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.SEHK).toBe("SEHK");
+ });
+ });
+ describe(".SGX", () => {
+ it("resolves to correct value for SGX enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.SGX).toBe("SGX");
+ });
+ });
+ describe(".SSE", () => {
+ it("resolves to correct value for SSE enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.SSE).toBe("SSE");
+ });
+ });
+ describe(".STO", () => {
+ it("resolves to correct value for STO enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.STO).toBe("STO");
+ });
+ });
+ describe(".SWX", () => {
+ it("resolves to correct value for SWX enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.SWX).toBe("SWX");
+ });
+ });
+ describe(".SZSE", () => {
+ it("resolves to correct value for SZSE enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.SZSE).toBe("SZSE");
+ });
+ });
+ describe(".TSX", () => {
+ it("resolves to correct value for TSX enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.TSX).toBe("TSX");
+ });
+ });
+ describe(".TWSE", () => {
+ it("resolves to correct value for TWSE enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.TWSE).toBe("TWSE");
+ });
+ });
+ describe(".VSE", () => {
+ it("resolves to correct value for VSE enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.VSE).toBe("VSE");
+ });
+ });
+ describe(".OTHER", () => {
+ it("resolves to correct value for OTHER enum property", () => {
+ expect(freeclimb.SMSTenDLCBrandStockExchange.OTHER).toBe("OTHER");
+ });
});
});
});
diff --git a/__tests__/models/SMSTenDLCBrandsListResult.spec.ts b/__tests__/models/SMSTenDLCBrandsListResult.spec.ts
index 8b8f3df..6fc417b 100644
--- a/__tests__/models/SMSTenDLCBrandsListResult.spec.ts
+++ b/__tests__/models/SMSTenDLCBrandsListResult.spec.ts
@@ -2,68 +2,161 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCBrandsListResult", () => {
- let model: freeclimb.SMSTenDLCBrandsListResult =
- new freeclimb.SMSTenDLCBrandsListResult({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- brands: [],
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.SMSTenDLCBrandsListResult;
+ let model: freeclimb.SMSTenDLCBrandsListResult =
+ new freeclimb.SMSTenDLCBrandsListResult({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ brands: [],
+ });
+ describe("SMSTenDLCBrandsListResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTenDLCBrandsListResult);
+ });
});
- describe("SMSTenDLCBrandsListResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.SMSTenDLCBrandsListResult);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".brands", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.SMSTenDLCBrand[] = [];
+ expect(model.brands).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.SMSTenDLCBrandsListResult;
+ let model: freeclimb.SMSTenDLCBrandsListResult =
+ new freeclimb.SMSTenDLCBrandsListResult({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ brands: [],
+ });
+ describe("SMSTenDLCBrandsListResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTenDLCBrandsListResult);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".brands", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.SMSTenDLCBrand[] = [];
+ expect(model.brands).toStrictEqual(value);
+ });
});
});
- describe(".brands", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.SMSTenDLCBrand[] = [];
- expect(model.brands).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.SMSTenDLCBrandsListResult;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.SMSTenDLCBrandsListResult =
+ new freeclimb.SMSTenDLCBrandsListResult(constructorArguments);
+
+ describe("#brands", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "brands",
+ )?.defaultValue;
+ expect(model.brands).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/SMSTenDLCCampaign.spec.ts b/__tests__/models/SMSTenDLCCampaign.spec.ts
index 899da10..a43abc8 100644
--- a/__tests__/models/SMSTenDLCCampaign.spec.ts
+++ b/__tests__/models/SMSTenDLCCampaign.spec.ts
@@ -2,264 +2,813 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCCampaign", () => {
- let model: freeclimb.SMSTenDLCCampaign = new freeclimb.SMSTenDLCCampaign({
- accountId: "test_accountId",
- campaignId: "test_campaignId",
- cspId: "test_cspId",
- resellerId: "test_resellerId",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.SMSTenDLCCampaign;
+ let model: freeclimb.SMSTenDLCCampaign = new freeclimb.SMSTenDLCCampaign({
+ accountId: "test_accountId",
+ campaignId: "test_campaignId",
+ cspId: "test_cspId",
+ resellerId: "test_resellerId",
- status: freeclimb.SMSTenDLCCampaignStatus.ACTIVE,
- createDate: new Date("December 17, 1995 03:24:00"),
- autoRenewal: true,
- billedDate: new Date("December 17, 1995 03:24:00"),
- brandId: "test_brandId",
- usecase: "test_usecase",
- subUsecases: new Set([]),
- description: "test_description",
- embeddedLink: true,
- embeddedPhone: true,
- affiliateMarketing: true,
- numberPool: true,
- ageGated: true,
- directLending: true,
- subscriberOptin: true,
- subscriberOptout: true,
- subscriberHelp: true,
- sample1: "test_sample1",
- sample2: "test_sample2",
- sample3: "test_sample3",
- sample4: "test_sample4",
- sample5: "test_sample5",
- messageFlow: "test_messageFlow",
- helpMessage: "test_helpMessage",
- optinKeywords: "test_optinKeywords",
- optoutKeywords: "test_optoutKeywords",
- helpKeywords: "test_helpKeywords",
- optinMessage: "test_optinMessage",
- optoutMessage: "test_optoutMessage",
- referenceId: "test_referenceId",
- mock: true,
- nextRenewalOrExpirationDate: "test_nextRenewalOrExpirationDate",
- });
- describe("SMSTenDLCCampaign class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.SMSTenDLCCampaign);
- });
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
- });
- });
- describe(".campaignId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_campaignId";
- expect(model.campaignId).toBe(value);
- });
- });
- describe(".cspId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_cspId";
- expect(model.cspId).toBe(value);
- });
- });
- describe(".resellerId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_resellerId";
- expect(model.resellerId).toBe(value);
- });
- });
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "ACTIVE";
- expect(model.status).toBe(value);
- });
- });
- describe(".createDate", () => {
- it("resolves to particular value on initialization", () => {
- const value = new Date("December 17, 1995 03:24:00");
- expect(model.createDate).toStrictEqual(value);
- });
- });
- describe(".autoRenewal", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.autoRenewal).toBe(value);
- });
- });
- describe(".billedDate", () => {
- it("resolves to particular value on initialization", () => {
- const value = new Date("December 17, 1995 03:24:00");
- expect(model.billedDate).toStrictEqual(value);
- });
- });
- describe(".brandId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_brandId";
- expect(model.brandId).toBe(value);
- });
- });
- describe(".usecase", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_usecase";
- expect(model.usecase).toBe(value);
- });
- });
- describe(".subUsecases", () => {
- it("resolves to particular value on initialization", () => {
- const value = new Set([]);
- expect(model.subUsecases).toStrictEqual(value);
- });
- });
- describe(".description", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_description";
- expect(model.description).toBe(value);
- });
- });
- describe(".embeddedLink", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.embeddedLink).toBe(value);
- });
- });
- describe(".embeddedPhone", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.embeddedPhone).toBe(value);
- });
- });
- describe(".affiliateMarketing", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.affiliateMarketing).toBe(value);
- });
- });
- describe(".numberPool", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.numberPool).toBe(value);
- });
- });
- describe(".ageGated", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.ageGated).toBe(value);
- });
- });
- describe(".directLending", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.directLending).toBe(value);
- });
- });
- describe(".subscriberOptin", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.subscriberOptin).toBe(value);
- });
- });
- describe(".subscriberOptout", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.subscriberOptout).toBe(value);
- });
- });
- describe(".subscriberHelp", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.subscriberHelp).toBe(value);
- });
- });
- describe(".sample1", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_sample1";
- expect(model.sample1).toBe(value);
- });
- });
- describe(".sample2", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_sample2";
- expect(model.sample2).toBe(value);
- });
- });
- describe(".sample3", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_sample3";
- expect(model.sample3).toBe(value);
- });
- });
- describe(".sample4", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_sample4";
- expect(model.sample4).toBe(value);
- });
- });
- describe(".sample5", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_sample5";
- expect(model.sample5).toBe(value);
- });
- });
- describe(".messageFlow", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_messageFlow";
- expect(model.messageFlow).toBe(value);
- });
- });
- describe(".helpMessage", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_helpMessage";
- expect(model.helpMessage).toBe(value);
- });
- });
- describe(".optinKeywords", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_optinKeywords";
- expect(model.optinKeywords).toBe(value);
- });
- });
- describe(".optoutKeywords", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_optoutKeywords";
- expect(model.optoutKeywords).toBe(value);
- });
- });
- describe(".helpKeywords", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_helpKeywords";
- expect(model.helpKeywords).toBe(value);
- });
- });
- describe(".optinMessage", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_optinMessage";
- expect(model.optinMessage).toBe(value);
- });
- });
- describe(".optoutMessage", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_optoutMessage";
- expect(model.optoutMessage).toBe(value);
- });
- });
- describe(".referenceId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_referenceId";
- expect(model.referenceId).toBe(value);
- });
- });
- describe(".mock", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.mock).toBe(value);
- });
- });
- describe(".nextRenewalOrExpirationDate", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextRenewalOrExpirationDate";
- expect(model.nextRenewalOrExpirationDate).toBe(value);
+ status: freeclimb.SMSTenDLCCampaignStatus.ACTIVE,
+ createDate: new Date("December 17, 1995 03:24:00"),
+ autoRenewal: true,
+ billedDate: new Date("December 17, 1995 03:24:00"),
+ brandId: "test_brandId",
+ usecase: "test_usecase",
+ subUsecases: new Set([]),
+ description: "test_description",
+ embeddedLink: true,
+ embeddedPhone: true,
+ affiliateMarketing: true,
+ numberPool: true,
+ ageGated: true,
+ directLending: true,
+ subscriberOptin: true,
+ subscriberOptout: true,
+ subscriberHelp: true,
+ sample1: "test_sample1",
+ sample2: "test_sample2",
+ sample3: "test_sample3",
+ sample4: "test_sample4",
+ sample5: "test_sample5",
+ messageFlow: "test_messageFlow",
+ helpMessage: "test_helpMessage",
+ optinKeywords: "test_optinKeywords",
+ optoutKeywords: "test_optoutKeywords",
+ helpKeywords: "test_helpKeywords",
+ optinMessage: "test_optinMessage",
+ optoutMessage: "test_optoutMessage",
+ referenceId: "test_referenceId",
+ mock: true,
+ nextRenewalOrExpirationDate: "test_nextRenewalOrExpirationDate",
+ });
+ describe("SMSTenDLCCampaign class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTenDLCCampaign);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_campaignId";
+ expect(model.campaignId).toBe(value);
+ });
+ });
+ describe(".cspId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_cspId";
+ expect(model.cspId).toBe(value);
+ });
+ });
+ describe(".resellerId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_resellerId";
+ expect(model.resellerId).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "ACTIVE";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".createDate", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new Date("December 17, 1995 03:24:00");
+ expect(model.createDate).toStrictEqual(value);
+ });
+ });
+ describe(".autoRenewal", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.autoRenewal).toBe(value);
+ });
+ });
+ describe(".billedDate", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new Date("December 17, 1995 03:24:00");
+ expect(model.billedDate).toStrictEqual(value);
+ });
+ });
+ describe(".brandId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_brandId";
+ expect(model.brandId).toBe(value);
+ });
+ });
+ describe(".usecase", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_usecase";
+ expect(model.usecase).toBe(value);
+ });
+ });
+ describe(".subUsecases", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new Set([]);
+ expect(model.subUsecases).toStrictEqual(value);
+ });
+ });
+ describe(".description", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_description";
+ expect(model.description).toBe(value);
+ });
+ });
+ describe(".embeddedLink", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.embeddedLink).toBe(value);
+ });
+ });
+ describe(".embeddedPhone", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.embeddedPhone).toBe(value);
+ });
+ });
+ describe(".affiliateMarketing", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.affiliateMarketing).toBe(value);
+ });
+ });
+ describe(".numberPool", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.numberPool).toBe(value);
+ });
+ });
+ describe(".ageGated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.ageGated).toBe(value);
+ });
+ });
+ describe(".directLending", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.directLending).toBe(value);
+ });
+ });
+ describe(".subscriberOptin", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.subscriberOptin).toBe(value);
+ });
+ });
+ describe(".subscriberOptout", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.subscriberOptout).toBe(value);
+ });
+ });
+ describe(".subscriberHelp", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.subscriberHelp).toBe(value);
+ });
+ });
+ describe(".sample1", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_sample1";
+ expect(model.sample1).toBe(value);
+ });
+ });
+ describe(".sample2", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_sample2";
+ expect(model.sample2).toBe(value);
+ });
+ });
+ describe(".sample3", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_sample3";
+ expect(model.sample3).toBe(value);
+ });
+ });
+ describe(".sample4", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_sample4";
+ expect(model.sample4).toBe(value);
+ });
+ });
+ describe(".sample5", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_sample5";
+ expect(model.sample5).toBe(value);
+ });
+ });
+ describe(".messageFlow", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_messageFlow";
+ expect(model.messageFlow).toBe(value);
+ });
+ });
+ describe(".helpMessage", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_helpMessage";
+ expect(model.helpMessage).toBe(value);
+ });
+ });
+ describe(".optinKeywords", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_optinKeywords";
+ expect(model.optinKeywords).toBe(value);
+ });
+ });
+ describe(".optoutKeywords", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_optoutKeywords";
+ expect(model.optoutKeywords).toBe(value);
+ });
+ });
+ describe(".helpKeywords", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_helpKeywords";
+ expect(model.helpKeywords).toBe(value);
+ });
+ });
+ describe(".optinMessage", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_optinMessage";
+ expect(model.optinMessage).toBe(value);
+ });
+ });
+ describe(".optoutMessage", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_optoutMessage";
+ expect(model.optoutMessage).toBe(value);
+ });
+ });
+ describe(".referenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_referenceId";
+ expect(model.referenceId).toBe(value);
+ });
+ });
+ describe(".mock", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.mock).toBe(value);
+ });
+ });
+ describe(".nextRenewalOrExpirationDate", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextRenewalOrExpirationDate";
+ expect(model.nextRenewalOrExpirationDate).toBe(value);
+ });
+ });
+ });
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.SMSTenDLCCampaign;
+ let model: freeclimb.SMSTenDLCCampaign = new freeclimb.SMSTenDLCCampaign({
+ accountId: "",
+ campaignId: "",
+ cspId: "",
+ resellerId: "",
+
+ status: freeclimb.SMSTenDLCCampaignStatus.ACTIVE,
+ createDate: undefined,
+ autoRenewal: false,
+ billedDate: undefined,
+ brandId: "",
+ usecase: "",
+ subUsecases: new Set([]),
+ description: "",
+ embeddedLink: false,
+ embeddedPhone: false,
+ affiliateMarketing: false,
+ numberPool: false,
+ ageGated: false,
+ directLending: false,
+ subscriberOptin: false,
+ subscriberOptout: false,
+ subscriberHelp: false,
+ sample1: "",
+ sample2: "",
+ sample3: "",
+ sample4: "",
+ sample5: "",
+ messageFlow: "",
+ helpMessage: "",
+ optinKeywords: "",
+ optoutKeywords: "",
+ helpKeywords: "",
+ optinMessage: "",
+ optoutMessage: "",
+ referenceId: "",
+ mock: false,
+ nextRenewalOrExpirationDate: "",
+ });
+ describe("SMSTenDLCCampaign class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTenDLCCampaign);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.campaignId).toBe(value);
+ });
+ });
+ describe(".cspId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.cspId).toBe(value);
+ });
+ });
+ describe(".resellerId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.resellerId).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "ACTIVE";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".createDate", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = undefined;
+ expect(model.createDate).toStrictEqual(value);
+ });
+ });
+ describe(".autoRenewal", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.autoRenewal).toBe(value);
+ });
+ });
+ describe(".billedDate", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = undefined;
+ expect(model.billedDate).toStrictEqual(value);
+ });
+ });
+ describe(".brandId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.brandId).toBe(value);
+ });
+ });
+ describe(".usecase", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.usecase).toBe(value);
+ });
+ });
+ describe(".subUsecases", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new Set([]);
+ expect(model.subUsecases).toStrictEqual(value);
+ });
+ });
+ describe(".description", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.description).toBe(value);
+ });
+ });
+ describe(".embeddedLink", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.embeddedLink).toBe(value);
+ });
+ });
+ describe(".embeddedPhone", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.embeddedPhone).toBe(value);
+ });
+ });
+ describe(".affiliateMarketing", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.affiliateMarketing).toBe(value);
+ });
+ });
+ describe(".numberPool", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.numberPool).toBe(value);
+ });
+ });
+ describe(".ageGated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.ageGated).toBe(value);
+ });
+ });
+ describe(".directLending", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.directLending).toBe(value);
+ });
+ });
+ describe(".subscriberOptin", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.subscriberOptin).toBe(value);
+ });
+ });
+ describe(".subscriberOptout", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.subscriberOptout).toBe(value);
+ });
+ });
+ describe(".subscriberHelp", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.subscriberHelp).toBe(value);
+ });
+ });
+ describe(".sample1", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.sample1).toBe(value);
+ });
+ });
+ describe(".sample2", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.sample2).toBe(value);
+ });
+ });
+ describe(".sample3", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.sample3).toBe(value);
+ });
+ });
+ describe(".sample4", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.sample4).toBe(value);
+ });
+ });
+ describe(".sample5", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.sample5).toBe(value);
+ });
+ });
+ describe(".messageFlow", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.messageFlow).toBe(value);
+ });
+ });
+ describe(".helpMessage", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.helpMessage).toBe(value);
+ });
+ });
+ describe(".optinKeywords", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.optinKeywords).toBe(value);
+ });
+ });
+ describe(".optoutKeywords", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.optoutKeywords).toBe(value);
+ });
+ });
+ describe(".helpKeywords", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.helpKeywords).toBe(value);
+ });
+ });
+ describe(".optinMessage", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.optinMessage).toBe(value);
+ });
+ });
+ describe(".optoutMessage", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.optoutMessage).toBe(value);
+ });
+ });
+ describe(".referenceId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.referenceId).toBe(value);
+ });
+ });
+ describe(".mock", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.mock).toBe(value);
+ });
+ });
+ describe(".nextRenewalOrExpirationDate", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextRenewalOrExpirationDate).toBe(value);
+ });
+ });
+ });
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.SMSTenDLCCampaign;
+ let constructorArguments = {
+ campaignId: "test_campaignId",
+ cspId: "test_cspId",
+ brandId: "test_brandId",
+ usecase: "test_usecase",
+ subUsecases: new Set([]),
+ description: "test_description",
+ mock: true,
+ };
+ let model: freeclimb.SMSTenDLCCampaign = new freeclimb.SMSTenDLCCampaign(
+ constructorArguments,
+ );
+
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#campaignId", () => {
+ it("resolves to initialization value", () => {
+ expect(model.campaignId).toBe(constructorArguments["campaignId"]);
+ });
+ });
+ describe("#cspId", () => {
+ it("resolves to initialization value", () => {
+ expect(model.cspId).toBe(constructorArguments["cspId"]);
+ });
+ });
+ describe("#resellerId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "resellerId",
+ )?.defaultValue;
+ expect(model.resellerId).toBe(value);
+ });
+ });
+ describe("#status", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "status",
+ )?.defaultValue;
+ expect(model.status).toBe(value);
+ });
+ });
+ describe("#createDate", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "createDate",
+ )?.defaultValue;
+ expect(model.createDate).toBe(value);
+ });
+ });
+ describe("#autoRenewal", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "autoRenewal",
+ )?.defaultValue;
+ expect(model.autoRenewal).toBe(value);
+ });
+ });
+ describe("#billedDate", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "billedDate",
+ )?.defaultValue;
+ expect(model.billedDate).toBe(value);
+ });
+ });
+ describe("#brandId", () => {
+ it("resolves to initialization value", () => {
+ expect(model.brandId).toBe(constructorArguments["brandId"]);
+ });
+ });
+ describe("#usecase", () => {
+ it("resolves to initialization value", () => {
+ expect(model.usecase).toBe(constructorArguments["usecase"]);
+ });
+ });
+ describe("#subUsecases", () => {
+ it("resolves to initialization value", () => {
+ expect(model.subUsecases).toBe(constructorArguments["subUsecases"]);
+ });
+ });
+ describe("#description", () => {
+ it("resolves to initialization value", () => {
+ expect(model.description).toBe(constructorArguments["description"]);
+ });
+ });
+ describe("#embeddedLink", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "embeddedLink",
+ )?.defaultValue;
+ expect(model.embeddedLink).toBe(value);
+ });
+ });
+ describe("#embeddedPhone", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "embeddedPhone",
+ )?.defaultValue;
+ expect(model.embeddedPhone).toBe(value);
+ });
+ });
+ describe("#affiliateMarketing", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "affiliateMarketing",
+ )?.defaultValue;
+ expect(model.affiliateMarketing).toBe(value);
+ });
+ });
+ describe("#numberPool", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "numberPool",
+ )?.defaultValue;
+ expect(model.numberPool).toBe(value);
+ });
+ });
+ describe("#ageGated", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "ageGated",
+ )?.defaultValue;
+ expect(model.ageGated).toBe(value);
+ });
+ });
+ describe("#directLending", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "directLending",
+ )?.defaultValue;
+ expect(model.directLending).toBe(value);
+ });
+ });
+ describe("#subscriberOptin", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "subscriberOptin",
+ )?.defaultValue;
+ expect(model.subscriberOptin).toBe(value);
+ });
+ });
+ describe("#subscriberOptout", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "subscriberOptout",
+ )?.defaultValue;
+ expect(model.subscriberOptout).toBe(value);
+ });
+ });
+ describe("#subscriberHelp", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "subscriberHelp",
+ )?.defaultValue;
+ expect(model.subscriberHelp).toBe(value);
+ });
+ });
+ describe("#sample1", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "sample1",
+ )?.defaultValue;
+ expect(model.sample1).toBe(value);
+ });
+ });
+ describe("#sample2", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "sample2",
+ )?.defaultValue;
+ expect(model.sample2).toBe(value);
+ });
+ });
+ describe("#sample3", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "sample3",
+ )?.defaultValue;
+ expect(model.sample3).toBe(value);
+ });
+ });
+ describe("#sample4", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "sample4",
+ )?.defaultValue;
+ expect(model.sample4).toBe(value);
+ });
+ });
+ describe("#sample5", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "sample5",
+ )?.defaultValue;
+ expect(model.sample5).toBe(value);
+ });
+ });
+ describe("#messageFlow", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "messageFlow",
+ )?.defaultValue;
+ expect(model.messageFlow).toBe(value);
+ });
+ });
+ describe("#helpMessage", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "helpMessage",
+ )?.defaultValue;
+ expect(model.helpMessage).toBe(value);
+ });
+ });
+ describe("#optinKeywords", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "optinKeywords",
+ )?.defaultValue;
+ expect(model.optinKeywords).toBe(value);
+ });
+ });
+ describe("#optoutKeywords", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "optoutKeywords",
+ )?.defaultValue;
+ expect(model.optoutKeywords).toBe(value);
+ });
+ });
+ describe("#helpKeywords", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "helpKeywords",
+ )?.defaultValue;
+ expect(model.helpKeywords).toBe(value);
+ });
+ });
+ describe("#optinMessage", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "optinMessage",
+ )?.defaultValue;
+ expect(model.optinMessage).toBe(value);
+ });
+ });
+ describe("#optoutMessage", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "optoutMessage",
+ )?.defaultValue;
+ expect(model.optoutMessage).toBe(value);
+ });
+ });
+ describe("#referenceId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "referenceId",
+ )?.defaultValue;
+ expect(model.referenceId).toBe(value);
+ });
+ });
+ describe("#mock", () => {
+ it("resolves to initialization value", () => {
+ expect(model.mock).toBe(constructorArguments["mock"]);
+ });
+ });
+ describe("#nextRenewalOrExpirationDate", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "nextRenewalOrExpirationDate",
+ )?.defaultValue;
+ expect(model.nextRenewalOrExpirationDate).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/SMSTenDLCCampaignStatus.spec.ts b/__tests__/models/SMSTenDLCCampaignStatus.spec.ts
index 84f0f7a..d85c596 100644
--- a/__tests__/models/SMSTenDLCCampaignStatus.spec.ts
+++ b/__tests__/models/SMSTenDLCCampaignStatus.spec.ts
@@ -2,14 +2,16 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCCampaignStatus", () => {
- describe(".ACTIVE", () => {
- it("resolves to correct value for ACTIVE enum property", () => {
- expect(freeclimb.SMSTenDLCCampaignStatus.ACTIVE).toBe("ACTIVE");
+ describe("Test with truthy values", () => {
+ describe(".ACTIVE", () => {
+ it("resolves to correct value for ACTIVE enum property", () => {
+ expect(freeclimb.SMSTenDLCCampaignStatus.ACTIVE).toBe("ACTIVE");
+ });
});
- });
- describe(".EXPIRED", () => {
- it("resolves to correct value for EXPIRED enum property", () => {
- expect(freeclimb.SMSTenDLCCampaignStatus.EXPIRED).toBe("EXPIRED");
+ describe(".EXPIRED", () => {
+ it("resolves to correct value for EXPIRED enum property", () => {
+ expect(freeclimb.SMSTenDLCCampaignStatus.EXPIRED).toBe("EXPIRED");
+ });
});
});
});
diff --git a/__tests__/models/SMSTenDLCCampaignsListResult.spec.ts b/__tests__/models/SMSTenDLCCampaignsListResult.spec.ts
index 5b3924e..113a977 100644
--- a/__tests__/models/SMSTenDLCCampaignsListResult.spec.ts
+++ b/__tests__/models/SMSTenDLCCampaignsListResult.spec.ts
@@ -2,68 +2,161 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCCampaignsListResult", () => {
- let model: freeclimb.SMSTenDLCCampaignsListResult =
- new freeclimb.SMSTenDLCCampaignsListResult({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- campaigns: [],
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.SMSTenDLCCampaignsListResult;
+ let model: freeclimb.SMSTenDLCCampaignsListResult =
+ new freeclimb.SMSTenDLCCampaignsListResult({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ campaigns: [],
+ });
+ describe("SMSTenDLCCampaignsListResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTenDLCCampaignsListResult);
+ });
});
- describe("SMSTenDLCCampaignsListResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.SMSTenDLCCampaignsListResult);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".campaigns", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.SMSTenDLCCampaign[] = [];
+ expect(model.campaigns).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.SMSTenDLCCampaignsListResult;
+ let model: freeclimb.SMSTenDLCCampaignsListResult =
+ new freeclimb.SMSTenDLCCampaignsListResult({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ campaigns: [],
+ });
+ describe("SMSTenDLCCampaignsListResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTenDLCCampaignsListResult);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".campaigns", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.SMSTenDLCCampaign[] = [];
+ expect(model.campaigns).toStrictEqual(value);
+ });
});
});
- describe(".campaigns", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.SMSTenDLCCampaign[] = [];
- expect(model.campaigns).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.SMSTenDLCCampaignsListResult;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.SMSTenDLCCampaignsListResult =
+ new freeclimb.SMSTenDLCCampaignsListResult(constructorArguments);
+
+ describe("#campaigns", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "campaigns",
+ )?.defaultValue;
+ expect(model.campaigns).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/SMSTenDLCPartnerCampaign.spec.ts b/__tests__/models/SMSTenDLCPartnerCampaign.spec.ts
index 5411acb..171fa5b 100644
--- a/__tests__/models/SMSTenDLCPartnerCampaign.spec.ts
+++ b/__tests__/models/SMSTenDLCPartnerCampaign.spec.ts
@@ -2,223 +2,680 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCPartnerCampaign", () => {
- let model: freeclimb.SMSTenDLCPartnerCampaign =
- new freeclimb.SMSTenDLCPartnerCampaign({
- accountId: "test_accountId",
- campaignId: "test_campaignId",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.SMSTenDLCPartnerCampaign;
+ let model: freeclimb.SMSTenDLCPartnerCampaign =
+ new freeclimb.SMSTenDLCPartnerCampaign({
+ accountId: "test_accountId",
+ campaignId: "test_campaignId",
- status: freeclimb.SMSTenDLCPartnerCampaignStatus.ACTIVE,
- createDate: new Date("December 17, 1995 03:24:00"),
- brandId: "test_brandId",
- usecase: "test_usecase",
- description: "test_description",
- embeddedLink: true,
- embeddedPhone: true,
- affiliateMarketing: true,
- numberPool: true,
- ageGated: true,
- directLending: true,
- subscriberOptin: true,
- subscriberOptout: true,
- subscriberHelp: true,
- sample1: "test_sample1",
- sample2: "test_sample2",
- sample3: "test_sample3",
- sample4: "test_sample4",
- sample5: "test_sample5",
- messageFlow: "test_messageFlow",
- helpMessage: "test_helpMessage",
- optinKeywords: "test_optinKeywords",
- optoutKeywords: "test_optoutKeywords",
- helpKeywords: "test_helpKeywords",
- optinMessage: "test_optinMessage",
- optoutMessage: "test_optoutMessage",
+ status: freeclimb.SMSTenDLCPartnerCampaignStatus.ACTIVE,
+ createDate: new Date("December 17, 1995 03:24:00"),
+ brandId: "test_brandId",
+ usecase: "test_usecase",
+ description: "test_description",
+ embeddedLink: true,
+ embeddedPhone: true,
+ affiliateMarketing: true,
+ numberPool: true,
+ ageGated: true,
+ directLending: true,
+ subscriberOptin: true,
+ subscriberOptout: true,
+ subscriberHelp: true,
+ sample1: "test_sample1",
+ sample2: "test_sample2",
+ sample3: "test_sample3",
+ sample4: "test_sample4",
+ sample5: "test_sample5",
+ messageFlow: "test_messageFlow",
+ helpMessage: "test_helpMessage",
+ optinKeywords: "test_optinKeywords",
+ optoutKeywords: "test_optoutKeywords",
+ helpKeywords: "test_helpKeywords",
+ optinMessage: "test_optinMessage",
+ optoutMessage: "test_optoutMessage",
- brand: new freeclimb.SMSTenDLCPartnerCampaignBrand({
- email: null as any,
- phone: null as any,
- }),
+ brand: new freeclimb.SMSTenDLCPartnerCampaignBrand({
+ email: null as any,
+ phone: null as any,
+ }),
+ });
+ describe("SMSTenDLCPartnerCampaign class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTenDLCPartnerCampaign);
+ });
});
- describe("SMSTenDLCPartnerCampaign class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.SMSTenDLCPartnerCampaign);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_campaignId";
+ expect(model.campaignId).toBe(value);
+ });
});
- });
- describe(".campaignId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_campaignId";
- expect(model.campaignId).toBe(value);
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "ACTIVE";
+ expect(model.status).toBe(value);
+ });
});
- });
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "ACTIVE";
- expect(model.status).toBe(value);
+ describe(".createDate", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new Date("December 17, 1995 03:24:00");
+ expect(model.createDate).toStrictEqual(value);
+ });
});
- });
- describe(".createDate", () => {
- it("resolves to particular value on initialization", () => {
- const value = new Date("December 17, 1995 03:24:00");
- expect(model.createDate).toStrictEqual(value);
+ describe(".brandId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_brandId";
+ expect(model.brandId).toBe(value);
+ });
});
- });
- describe(".brandId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_brandId";
- expect(model.brandId).toBe(value);
+ describe(".usecase", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_usecase";
+ expect(model.usecase).toBe(value);
+ });
});
- });
- describe(".usecase", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_usecase";
- expect(model.usecase).toBe(value);
+ describe(".description", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_description";
+ expect(model.description).toBe(value);
+ });
});
- });
- describe(".description", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_description";
- expect(model.description).toBe(value);
+ describe(".embeddedLink", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.embeddedLink).toBe(value);
+ });
});
- });
- describe(".embeddedLink", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.embeddedLink).toBe(value);
+ describe(".embeddedPhone", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.embeddedPhone).toBe(value);
+ });
});
- });
- describe(".embeddedPhone", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.embeddedPhone).toBe(value);
+ describe(".affiliateMarketing", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.affiliateMarketing).toBe(value);
+ });
});
- });
- describe(".affiliateMarketing", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.affiliateMarketing).toBe(value);
+ describe(".numberPool", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.numberPool).toBe(value);
+ });
});
- });
- describe(".numberPool", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.numberPool).toBe(value);
+ describe(".ageGated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.ageGated).toBe(value);
+ });
});
- });
- describe(".ageGated", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.ageGated).toBe(value);
+ describe(".directLending", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.directLending).toBe(value);
+ });
});
- });
- describe(".directLending", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.directLending).toBe(value);
+ describe(".subscriberOptin", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.subscriberOptin).toBe(value);
+ });
});
- });
- describe(".subscriberOptin", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.subscriberOptin).toBe(value);
+ describe(".subscriberOptout", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.subscriberOptout).toBe(value);
+ });
});
- });
- describe(".subscriberOptout", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.subscriberOptout).toBe(value);
+ describe(".subscriberHelp", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.subscriberHelp).toBe(value);
+ });
});
- });
- describe(".subscriberHelp", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.subscriberHelp).toBe(value);
+ describe(".sample1", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_sample1";
+ expect(model.sample1).toBe(value);
+ });
});
- });
- describe(".sample1", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_sample1";
- expect(model.sample1).toBe(value);
+ describe(".sample2", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_sample2";
+ expect(model.sample2).toBe(value);
+ });
});
- });
- describe(".sample2", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_sample2";
- expect(model.sample2).toBe(value);
+ describe(".sample3", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_sample3";
+ expect(model.sample3).toBe(value);
+ });
});
- });
- describe(".sample3", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_sample3";
- expect(model.sample3).toBe(value);
+ describe(".sample4", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_sample4";
+ expect(model.sample4).toBe(value);
+ });
});
- });
- describe(".sample4", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_sample4";
- expect(model.sample4).toBe(value);
+ describe(".sample5", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_sample5";
+ expect(model.sample5).toBe(value);
+ });
});
- });
- describe(".sample5", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_sample5";
- expect(model.sample5).toBe(value);
+ describe(".messageFlow", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_messageFlow";
+ expect(model.messageFlow).toBe(value);
+ });
});
- });
- describe(".messageFlow", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_messageFlow";
- expect(model.messageFlow).toBe(value);
+ describe(".helpMessage", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_helpMessage";
+ expect(model.helpMessage).toBe(value);
+ });
});
- });
- describe(".helpMessage", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_helpMessage";
- expect(model.helpMessage).toBe(value);
+ describe(".optinKeywords", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_optinKeywords";
+ expect(model.optinKeywords).toBe(value);
+ });
});
- });
- describe(".optinKeywords", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_optinKeywords";
- expect(model.optinKeywords).toBe(value);
+ describe(".optoutKeywords", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_optoutKeywords";
+ expect(model.optoutKeywords).toBe(value);
+ });
});
- });
- describe(".optoutKeywords", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_optoutKeywords";
- expect(model.optoutKeywords).toBe(value);
+ describe(".helpKeywords", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_helpKeywords";
+ expect(model.helpKeywords).toBe(value);
+ });
});
- });
- describe(".helpKeywords", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_helpKeywords";
- expect(model.helpKeywords).toBe(value);
+ describe(".optinMessage", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_optinMessage";
+ expect(model.optinMessage).toBe(value);
+ });
});
- });
- describe(".optinMessage", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_optinMessage";
- expect(model.optinMessage).toBe(value);
+ describe(".optoutMessage", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_optoutMessage";
+ expect(model.optoutMessage).toBe(value);
+ });
+ });
+ describe(".brand", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new freeclimb.SMSTenDLCPartnerCampaignBrand({
+ email: null as any,
+ phone: null as any,
+ });
+ expect(model.brand).toStrictEqual(value);
+ });
});
});
- describe(".optoutMessage", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_optoutMessage";
- expect(model.optoutMessage).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.SMSTenDLCPartnerCampaign;
+ let model: freeclimb.SMSTenDLCPartnerCampaign =
+ new freeclimb.SMSTenDLCPartnerCampaign({
+ accountId: "",
+ campaignId: "",
+
+ status: freeclimb.SMSTenDLCPartnerCampaignStatus.ACTIVE,
+ createDate: undefined,
+ brandId: "",
+ usecase: "",
+ description: "",
+ embeddedLink: false,
+ embeddedPhone: false,
+ affiliateMarketing: false,
+ numberPool: false,
+ ageGated: false,
+ directLending: false,
+ subscriberOptin: false,
+ subscriberOptout: false,
+ subscriberHelp: false,
+ sample1: "",
+ sample2: "",
+ sample3: "",
+ sample4: "",
+ sample5: "",
+ messageFlow: "",
+ helpMessage: "",
+ optinKeywords: "",
+ optoutKeywords: "",
+ helpKeywords: "",
+ optinMessage: "",
+ optoutMessage: "",
+
+ brand: new freeclimb.SMSTenDLCPartnerCampaignBrand({
+ email: null as any,
+ phone: null as any,
+ }),
+ });
+ describe("SMSTenDLCPartnerCampaign class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTenDLCPartnerCampaign);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.campaignId).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "ACTIVE";
+ expect(model.status).toBe(value);
+ });
+ });
+ describe(".createDate", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = undefined;
+ expect(model.createDate).toStrictEqual(value);
+ });
+ });
+ describe(".brandId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.brandId).toBe(value);
+ });
+ });
+ describe(".usecase", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.usecase).toBe(value);
+ });
+ });
+ describe(".description", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.description).toBe(value);
+ });
+ });
+ describe(".embeddedLink", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.embeddedLink).toBe(value);
+ });
+ });
+ describe(".embeddedPhone", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.embeddedPhone).toBe(value);
+ });
+ });
+ describe(".affiliateMarketing", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.affiliateMarketing).toBe(value);
+ });
+ });
+ describe(".numberPool", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.numberPool).toBe(value);
+ });
+ });
+ describe(".ageGated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.ageGated).toBe(value);
+ });
+ });
+ describe(".directLending", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.directLending).toBe(value);
+ });
+ });
+ describe(".subscriberOptin", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.subscriberOptin).toBe(value);
+ });
+ });
+ describe(".subscriberOptout", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.subscriberOptout).toBe(value);
+ });
+ });
+ describe(".subscriberHelp", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.subscriberHelp).toBe(value);
+ });
+ });
+ describe(".sample1", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.sample1).toBe(value);
+ });
+ });
+ describe(".sample2", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.sample2).toBe(value);
+ });
+ });
+ describe(".sample3", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.sample3).toBe(value);
+ });
+ });
+ describe(".sample4", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.sample4).toBe(value);
+ });
+ });
+ describe(".sample5", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.sample5).toBe(value);
+ });
+ });
+ describe(".messageFlow", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.messageFlow).toBe(value);
+ });
+ });
+ describe(".helpMessage", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.helpMessage).toBe(value);
+ });
+ });
+ describe(".optinKeywords", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.optinKeywords).toBe(value);
+ });
+ });
+ describe(".optoutKeywords", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.optoutKeywords).toBe(value);
+ });
+ });
+ describe(".helpKeywords", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.helpKeywords).toBe(value);
+ });
+ });
+ describe(".optinMessage", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.optinMessage).toBe(value);
+ });
+ });
+ describe(".optoutMessage", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.optoutMessage).toBe(value);
+ });
+ });
+ describe(".brand", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = new freeclimb.SMSTenDLCPartnerCampaignBrand({
+ email: null as any,
+ phone: null as any,
+ });
+ expect(model.brand).toStrictEqual(value);
+ });
});
});
- describe(".brand", () => {
- it("resolves to particular value on initialization", () => {
- const value = new freeclimb.SMSTenDLCPartnerCampaignBrand({
- email: null as any,
- phone: null as any,
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.SMSTenDLCPartnerCampaign;
+ let constructorArguments = {
+ campaignId: "test_campaignId",
+ brandId: "test_brandId",
+ usecase: "test_usecase",
+ description: "test_description",
+ };
+ let model: freeclimb.SMSTenDLCPartnerCampaign =
+ new freeclimb.SMSTenDLCPartnerCampaign(constructorArguments);
+
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#campaignId", () => {
+ it("resolves to initialization value", () => {
+ expect(model.campaignId).toBe(constructorArguments["campaignId"]);
+ });
+ });
+ describe("#status", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "status",
+ )?.defaultValue;
+ expect(model.status).toBe(value);
+ });
+ });
+ describe("#createDate", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "createDate",
+ )?.defaultValue;
+ expect(model.createDate).toBe(value);
+ });
+ });
+ describe("#brandId", () => {
+ it("resolves to initialization value", () => {
+ expect(model.brandId).toBe(constructorArguments["brandId"]);
+ });
+ });
+ describe("#usecase", () => {
+ it("resolves to initialization value", () => {
+ expect(model.usecase).toBe(constructorArguments["usecase"]);
+ });
+ });
+ describe("#description", () => {
+ it("resolves to initialization value", () => {
+ expect(model.description).toBe(constructorArguments["description"]);
+ });
+ });
+ describe("#embeddedLink", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "embeddedLink",
+ )?.defaultValue;
+ expect(model.embeddedLink).toBe(value);
+ });
+ });
+ describe("#embeddedPhone", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "embeddedPhone",
+ )?.defaultValue;
+ expect(model.embeddedPhone).toBe(value);
+ });
+ });
+ describe("#affiliateMarketing", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "affiliateMarketing",
+ )?.defaultValue;
+ expect(model.affiliateMarketing).toBe(value);
+ });
+ });
+ describe("#numberPool", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "numberPool",
+ )?.defaultValue;
+ expect(model.numberPool).toBe(value);
+ });
+ });
+ describe("#ageGated", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "ageGated",
+ )?.defaultValue;
+ expect(model.ageGated).toBe(value);
+ });
+ });
+ describe("#directLending", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "directLending",
+ )?.defaultValue;
+ expect(model.directLending).toBe(value);
+ });
+ });
+ describe("#subscriberOptin", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "subscriberOptin",
+ )?.defaultValue;
+ expect(model.subscriberOptin).toBe(value);
+ });
+ });
+ describe("#subscriberOptout", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "subscriberOptout",
+ )?.defaultValue;
+ expect(model.subscriberOptout).toBe(value);
+ });
+ });
+ describe("#subscriberHelp", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "subscriberHelp",
+ )?.defaultValue;
+ expect(model.subscriberHelp).toBe(value);
+ });
+ });
+ describe("#sample1", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "sample1",
+ )?.defaultValue;
+ expect(model.sample1).toBe(value);
+ });
+ });
+ describe("#sample2", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "sample2",
+ )?.defaultValue;
+ expect(model.sample2).toBe(value);
+ });
+ });
+ describe("#sample3", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "sample3",
+ )?.defaultValue;
+ expect(model.sample3).toBe(value);
+ });
+ });
+ describe("#sample4", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "sample4",
+ )?.defaultValue;
+ expect(model.sample4).toBe(value);
+ });
+ });
+ describe("#sample5", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "sample5",
+ )?.defaultValue;
+ expect(model.sample5).toBe(value);
+ });
+ });
+ describe("#messageFlow", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "messageFlow",
+ )?.defaultValue;
+ expect(model.messageFlow).toBe(value);
+ });
+ });
+ describe("#helpMessage", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "helpMessage",
+ )?.defaultValue;
+ expect(model.helpMessage).toBe(value);
+ });
+ });
+ describe("#optinKeywords", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "optinKeywords",
+ )?.defaultValue;
+ expect(model.optinKeywords).toBe(value);
+ });
+ });
+ describe("#optoutKeywords", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "optoutKeywords",
+ )?.defaultValue;
+ expect(model.optoutKeywords).toBe(value);
+ });
+ });
+ describe("#helpKeywords", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "helpKeywords",
+ )?.defaultValue;
+ expect(model.helpKeywords).toBe(value);
+ });
+ });
+ describe("#optinMessage", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "optinMessage",
+ )?.defaultValue;
+ expect(model.optinMessage).toBe(value);
+ });
+ });
+ describe("#optoutMessage", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "optoutMessage",
+ )?.defaultValue;
+ expect(model.optoutMessage).toBe(value);
+ });
+ });
+ describe("#brand", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "brand",
+ )?.defaultValue;
+ expect(model.brand).toBe(value);
});
- expect(model.brand).toStrictEqual(value);
});
});
});
diff --git a/__tests__/models/SMSTenDLCPartnerCampaignBrand.spec.ts b/__tests__/models/SMSTenDLCPartnerCampaignBrand.spec.ts
index b3fbd84..d4a741b 100644
--- a/__tests__/models/SMSTenDLCPartnerCampaignBrand.spec.ts
+++ b/__tests__/models/SMSTenDLCPartnerCampaignBrand.spec.ts
@@ -2,86 +2,266 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCPartnerCampaignBrand", () => {
- let model: freeclimb.SMSTenDLCPartnerCampaignBrand =
- new freeclimb.SMSTenDLCPartnerCampaignBrand({
- accountId: "test_accountId",
- brandId: "test_brandId",
- firstName: "test_firstName",
- lastName: "test_lastName",
- displayName: "test_displayName",
- companyName: "test_companyName",
- phone: "test_phone",
- email: "test_email",
- website: "test_website",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.SMSTenDLCPartnerCampaignBrand;
+ let model: freeclimb.SMSTenDLCPartnerCampaignBrand =
+ new freeclimb.SMSTenDLCPartnerCampaignBrand({
+ accountId: "test_accountId",
+ brandId: "test_brandId",
+ firstName: "test_firstName",
+ lastName: "test_lastName",
+ displayName: "test_displayName",
+ companyName: "test_companyName",
+ phone: "test_phone",
+ email: "test_email",
+ website: "test_website",
- evpVettingScore: 1,
+ evpVettingScore: 1,
+ });
+ describe("SMSTenDLCPartnerCampaignBrand class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTenDLCPartnerCampaignBrand);
+ });
});
- describe("SMSTenDLCPartnerCampaignBrand class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.SMSTenDLCPartnerCampaignBrand);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".brandId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_brandId";
+ expect(model.brandId).toBe(value);
+ });
});
- });
- describe(".brandId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_brandId";
- expect(model.brandId).toBe(value);
+ describe(".firstName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_firstName";
+ expect(model.firstName).toBe(value);
+ });
});
- });
- describe(".firstName", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_firstName";
- expect(model.firstName).toBe(value);
+ describe(".lastName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_lastName";
+ expect(model.lastName).toBe(value);
+ });
});
- });
- describe(".lastName", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_lastName";
- expect(model.lastName).toBe(value);
+ describe(".displayName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_displayName";
+ expect(model.displayName).toBe(value);
+ });
});
- });
- describe(".displayName", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_displayName";
- expect(model.displayName).toBe(value);
+ describe(".companyName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_companyName";
+ expect(model.companyName).toBe(value);
+ });
});
- });
- describe(".companyName", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_companyName";
- expect(model.companyName).toBe(value);
+ describe(".phone", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_phone";
+ expect(model.phone).toBe(value);
+ });
});
- });
- describe(".phone", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_phone";
- expect(model.phone).toBe(value);
+ describe(".email", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_email";
+ expect(model.email).toBe(value);
+ });
});
- });
- describe(".email", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_email";
- expect(model.email).toBe(value);
+ describe(".website", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_website";
+ expect(model.website).toBe(value);
+ });
});
- });
- describe(".website", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_website";
- expect(model.website).toBe(value);
+ describe(".optionalAttributes", () => {
+ it("resolves to particular value on initialization", () => {});
+ });
+ describe(".evpVettingScore", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.evpVettingScore).toBe(value);
+ });
});
});
- describe(".optionalAttributes", () => {
- it("resolves to particular value on initialization", () => {});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.SMSTenDLCPartnerCampaignBrand;
+ let model: freeclimb.SMSTenDLCPartnerCampaignBrand =
+ new freeclimb.SMSTenDLCPartnerCampaignBrand({
+ accountId: "",
+ brandId: "",
+ firstName: "",
+ lastName: "",
+ displayName: "",
+ companyName: "",
+ phone: "",
+ email: "",
+ website: "",
+
+ evpVettingScore: 0,
+ });
+ describe("SMSTenDLCPartnerCampaignBrand class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTenDLCPartnerCampaignBrand);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".brandId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.brandId).toBe(value);
+ });
+ });
+ describe(".firstName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.firstName).toBe(value);
+ });
+ });
+ describe(".lastName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.lastName).toBe(value);
+ });
+ });
+ describe(".displayName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.displayName).toBe(value);
+ });
+ });
+ describe(".companyName", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.companyName).toBe(value);
+ });
+ });
+ describe(".phone", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.phone).toBe(value);
+ });
+ });
+ describe(".email", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.email).toBe(value);
+ });
+ });
+ describe(".website", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.website).toBe(value);
+ });
+ });
+ describe(".optionalAttributes", () => {
+ it("resolves to particular value on initialization", () => {});
+ });
+ describe(".evpVettingScore", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.evpVettingScore).toBe(value);
+ });
+ });
});
- describe(".evpVettingScore", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.evpVettingScore).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.SMSTenDLCPartnerCampaignBrand;
+ let constructorArguments = {
+ phone: "test_phone",
+ email: "test_email",
+ };
+ let model: freeclimb.SMSTenDLCPartnerCampaignBrand =
+ new freeclimb.SMSTenDLCPartnerCampaignBrand(constructorArguments);
+
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#brandId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "brandId",
+ )?.defaultValue;
+ expect(model.brandId).toBe(value);
+ });
+ });
+ describe("#firstName", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "firstName",
+ )?.defaultValue;
+ expect(model.firstName).toBe(value);
+ });
+ });
+ describe("#lastName", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "lastName",
+ )?.defaultValue;
+ expect(model.lastName).toBe(value);
+ });
+ });
+ describe("#displayName", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "displayName",
+ )?.defaultValue;
+ expect(model.displayName).toBe(value);
+ });
+ });
+ describe("#companyName", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "companyName",
+ )?.defaultValue;
+ expect(model.companyName).toBe(value);
+ });
+ });
+ describe("#phone", () => {
+ it("resolves to initialization value", () => {
+ expect(model.phone).toBe(constructorArguments["phone"]);
+ });
+ });
+ describe("#email", () => {
+ it("resolves to initialization value", () => {
+ expect(model.email).toBe(constructorArguments["email"]);
+ });
+ });
+ describe("#website", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "website",
+ )?.defaultValue;
+ expect(model.website).toBe(value);
+ });
+ });
+ describe("#optionalAttributes", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "optionalAttributes",
+ )?.defaultValue;
+ expect(model.optionalAttributes).toBe(value);
+ });
+ });
+ describe("#evpVettingScore", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "evpVettingScore",
+ )?.defaultValue;
+ expect(model.evpVettingScore).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/SMSTenDLCPartnerCampaignStatus.spec.ts b/__tests__/models/SMSTenDLCPartnerCampaignStatus.spec.ts
index a48a442..89fd790 100644
--- a/__tests__/models/SMSTenDLCPartnerCampaignStatus.spec.ts
+++ b/__tests__/models/SMSTenDLCPartnerCampaignStatus.spec.ts
@@ -2,14 +2,18 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCPartnerCampaignStatus", () => {
- describe(".ACTIVE", () => {
- it("resolves to correct value for ACTIVE enum property", () => {
- expect(freeclimb.SMSTenDLCPartnerCampaignStatus.ACTIVE).toBe("ACTIVE");
+ describe("Test with truthy values", () => {
+ describe(".ACTIVE", () => {
+ it("resolves to correct value for ACTIVE enum property", () => {
+ expect(freeclimb.SMSTenDLCPartnerCampaignStatus.ACTIVE).toBe("ACTIVE");
+ });
});
- });
- describe(".EXPIRED", () => {
- it("resolves to correct value for EXPIRED enum property", () => {
- expect(freeclimb.SMSTenDLCPartnerCampaignStatus.EXPIRED).toBe("EXPIRED");
+ describe(".EXPIRED", () => {
+ it("resolves to correct value for EXPIRED enum property", () => {
+ expect(freeclimb.SMSTenDLCPartnerCampaignStatus.EXPIRED).toBe(
+ "EXPIRED",
+ );
+ });
});
});
});
diff --git a/__tests__/models/SMSTenDLCPartnerCampaignsListResult.spec.ts b/__tests__/models/SMSTenDLCPartnerCampaignsListResult.spec.ts
index 3addab8..a9291e7 100644
--- a/__tests__/models/SMSTenDLCPartnerCampaignsListResult.spec.ts
+++ b/__tests__/models/SMSTenDLCPartnerCampaignsListResult.spec.ts
@@ -2,70 +2,165 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTenDLCPartnerCampaignsListResult", () => {
- let model: freeclimb.SMSTenDLCPartnerCampaignsListResult =
- new freeclimb.SMSTenDLCPartnerCampaignsListResult({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- partnerCampaigns: [],
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.SMSTenDLCPartnerCampaignsListResult;
+ let model: freeclimb.SMSTenDLCPartnerCampaignsListResult =
+ new freeclimb.SMSTenDLCPartnerCampaignsListResult({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ partnerCampaigns: [],
+ });
+ describe("SMSTenDLCPartnerCampaignsListResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(
+ freeclimb.SMSTenDLCPartnerCampaignsListResult,
+ );
+ });
});
- describe("SMSTenDLCPartnerCampaignsListResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(
- freeclimb.SMSTenDLCPartnerCampaignsListResult,
- );
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".partnerCampaigns", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.SMSTenDLCPartnerCampaign[] = [];
+ expect(model.partnerCampaigns).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.SMSTenDLCPartnerCampaignsListResult;
+ let model: freeclimb.SMSTenDLCPartnerCampaignsListResult =
+ new freeclimb.SMSTenDLCPartnerCampaignsListResult({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ partnerCampaigns: [],
+ });
+ describe("SMSTenDLCPartnerCampaignsListResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(
+ freeclimb.SMSTenDLCPartnerCampaignsListResult,
+ );
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".partnerCampaigns", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.SMSTenDLCPartnerCampaign[] = [];
+ expect(model.partnerCampaigns).toStrictEqual(value);
+ });
});
});
- describe(".partnerCampaigns", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.SMSTenDLCPartnerCampaign[] = [];
- expect(model.partnerCampaigns).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.SMSTenDLCPartnerCampaignsListResult;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.SMSTenDLCPartnerCampaignsListResult =
+ new freeclimb.SMSTenDLCPartnerCampaignsListResult(constructorArguments);
+
+ describe("#partnerCampaigns", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "partnerCampaigns",
+ )?.defaultValue;
+ expect(model.partnerCampaigns).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/SMSTollFreeCampaign.spec.ts b/__tests__/models/SMSTollFreeCampaign.spec.ts
index 1aa1cc5..e0dff3b 100644
--- a/__tests__/models/SMSTollFreeCampaign.spec.ts
+++ b/__tests__/models/SMSTollFreeCampaign.spec.ts
@@ -2,62 +2,182 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTollFreeCampaign", () => {
- let model: freeclimb.SMSTollFreeCampaign = new freeclimb.SMSTollFreeCampaign({
- accountId: "test_accountId",
- campaignId: "test_campaignId",
- useCase: "test_useCase",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.SMSTollFreeCampaign;
+ let model: freeclimb.SMSTollFreeCampaign =
+ new freeclimb.SMSTollFreeCampaign({
+ accountId: "test_accountId",
+ campaignId: "test_campaignId",
+ useCase: "test_useCase",
- registrationStatus:
- freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED,
- dateCreated: "test_dateCreated",
- dateUpdated: "test_dateUpdated",
- revision: 1,
- });
- describe("SMSTollFreeCampaign class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.SMSTollFreeCampaign);
+ registrationStatus:
+ freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED,
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ });
+ describe("SMSTollFreeCampaign class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTollFreeCampaign);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".campaignId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_campaignId";
- expect(model.campaignId).toBe(value);
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_campaignId";
+ expect(model.campaignId).toBe(value);
+ });
});
- });
- describe(".useCase", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_useCase";
- expect(model.useCase).toBe(value);
+ describe(".useCase", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_useCase";
+ expect(model.useCase).toBe(value);
+ });
});
- });
- describe(".registrationStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "UNREGISTERED";
- expect(model.registrationStatus).toBe(value);
+ describe(".registrationStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "UNREGISTERED";
+ expect(model.registrationStatus).toBe(value);
+ });
});
- });
- describe(".dateCreated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreated";
- expect(model.dateCreated).toBe(value);
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreated";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdated";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.revision).toBe(value);
+ });
});
});
- describe(".dateUpdated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdated";
- expect(model.dateUpdated).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.SMSTollFreeCampaign;
+ let model: freeclimb.SMSTollFreeCampaign =
+ new freeclimb.SMSTollFreeCampaign({
+ accountId: "",
+ campaignId: "",
+ useCase: "",
+
+ registrationStatus:
+ freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED,
+ dateCreated: "",
+ dateUpdated: "",
+ revision: 0,
+ });
+ describe("SMSTollFreeCampaign class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTollFreeCampaign);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.campaignId).toBe(value);
+ });
+ });
+ describe(".useCase", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.useCase).toBe(value);
+ });
+ });
+ describe(".registrationStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "UNREGISTERED";
+ expect(model.registrationStatus).toBe(value);
+ });
+ });
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.revision).toBe(value);
+ });
});
});
- describe(".revision", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.revision).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.SMSTollFreeCampaign;
+ let constructorArguments = {
+ accountId: "test_accountId",
+ campaignId: "test_campaignId",
+ useCase: "test_useCase",
+
+ registrationStatus:
+ freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED,
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ revision: 1,
+ };
+ let model: freeclimb.SMSTollFreeCampaign =
+ new freeclimb.SMSTollFreeCampaign(constructorArguments);
+
+ describe("#accountId", () => {
+ it("resolves to initialization value", () => {
+ expect(model.accountId).toBe(constructorArguments["accountId"]);
+ });
+ });
+ describe("#campaignId", () => {
+ it("resolves to initialization value", () => {
+ expect(model.campaignId).toBe(constructorArguments["campaignId"]);
+ });
+ });
+ describe("#useCase", () => {
+ it("resolves to initialization value", () => {
+ expect(model.useCase).toBe(constructorArguments["useCase"]);
+ });
+ });
+ describe("#registrationStatus", () => {
+ it("resolves to initialization value", () => {
+ expect(model.registrationStatus).toBe(
+ constructorArguments["registrationStatus"],
+ );
+ });
+ });
+ describe("#dateCreated", () => {
+ it("resolves to initialization value", () => {
+ expect(model.dateCreated).toBe(constructorArguments["dateCreated"]);
+ });
+ });
+ describe("#dateUpdated", () => {
+ it("resolves to initialization value", () => {
+ expect(model.dateUpdated).toBe(constructorArguments["dateUpdated"]);
+ });
+ });
+ describe("#revision", () => {
+ it("resolves to initialization value", () => {
+ expect(model.revision).toBe(constructorArguments["revision"]);
+ });
});
});
});
diff --git a/__tests__/models/SMSTollFreeCampaignRegistrationStatus.spec.ts b/__tests__/models/SMSTollFreeCampaignRegistrationStatus.spec.ts
index 43ccde2..1f62e46 100644
--- a/__tests__/models/SMSTollFreeCampaignRegistrationStatus.spec.ts
+++ b/__tests__/models/SMSTollFreeCampaignRegistrationStatus.spec.ts
@@ -2,39 +2,41 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTollFreeCampaignRegistrationStatus", () => {
- describe(".UNREGISTERED", () => {
- it("resolves to correct value for UNREGISTERED enum property", () => {
- expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED).toBe(
- "UNREGISTERED",
- );
+ describe("Test with truthy values", () => {
+ describe(".UNREGISTERED", () => {
+ it("resolves to correct value for UNREGISTERED enum property", () => {
+ expect(
+ freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED,
+ ).toBe("UNREGISTERED");
+ });
});
- });
- describe(".INITIATED", () => {
- it("resolves to correct value for INITIATED enum property", () => {
- expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.INITIATED).toBe(
- "INITIATED",
- );
+ describe(".INITIATED", () => {
+ it("resolves to correct value for INITIATED enum property", () => {
+ expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.INITIATED).toBe(
+ "INITIATED",
+ );
+ });
});
- });
- describe(".PENDING", () => {
- it("resolves to correct value for PENDING enum property", () => {
- expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.PENDING).toBe(
- "PENDING",
- );
+ describe(".PENDING", () => {
+ it("resolves to correct value for PENDING enum property", () => {
+ expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.PENDING).toBe(
+ "PENDING",
+ );
+ });
});
- });
- describe(".DECLINED", () => {
- it("resolves to correct value for DECLINED enum property", () => {
- expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.DECLINED).toBe(
- "DECLINED",
- );
+ describe(".DECLINED", () => {
+ it("resolves to correct value for DECLINED enum property", () => {
+ expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.DECLINED).toBe(
+ "DECLINED",
+ );
+ });
});
- });
- describe(".REGISTERED", () => {
- it("resolves to correct value for REGISTERED enum property", () => {
- expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.REGISTERED).toBe(
- "REGISTERED",
- );
+ describe(".REGISTERED", () => {
+ it("resolves to correct value for REGISTERED enum property", () => {
+ expect(freeclimb.SMSTollFreeCampaignRegistrationStatus.REGISTERED).toBe(
+ "REGISTERED",
+ );
+ });
});
});
});
diff --git a/__tests__/models/SMSTollFreeCampaignsListResult.spec.ts b/__tests__/models/SMSTollFreeCampaignsListResult.spec.ts
index ebae732..7c21a36 100644
--- a/__tests__/models/SMSTollFreeCampaignsListResult.spec.ts
+++ b/__tests__/models/SMSTollFreeCampaignsListResult.spec.ts
@@ -2,68 +2,161 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SMSTollFreeCampaignsListResult", () => {
- let model: freeclimb.SMSTollFreeCampaignsListResult =
- new freeclimb.SMSTollFreeCampaignsListResult({
- total: 1,
- start: 1,
- end: 1,
- page: 1,
- numPages: 1,
- pageSize: 1,
- nextPageUri: "test_nextPageUri",
- brands: [],
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.SMSTollFreeCampaignsListResult;
+ let model: freeclimb.SMSTollFreeCampaignsListResult =
+ new freeclimb.SMSTollFreeCampaignsListResult({
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ brands: [],
+ });
+ describe("SMSTollFreeCampaignsListResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTollFreeCampaignsListResult);
+ });
});
- describe("SMSTollFreeCampaignsListResult class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.SMSTollFreeCampaignsListResult);
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.total).toBe(value);
+ });
});
- });
- describe(".total", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.total).toBe(value);
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.start).toBe(value);
+ });
});
- });
- describe(".start", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.start).toBe(value);
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.end).toBe(value);
+ });
});
- });
- describe(".end", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.end).toBe(value);
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.page).toBe(value);
+ });
});
- });
- describe(".page", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.page).toBe(value);
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.numPages).toBe(value);
+ });
});
- });
- describe(".numPages", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.numPages).toBe(value);
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pageSize).toBe(value);
+ });
});
- });
- describe(".pageSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pageSize).toBe(value);
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_nextPageUri";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".brands", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.SMSTollFreeCampaign[] = [];
+ expect(model.brands).toStrictEqual(value);
+ });
});
});
- describe(".nextPageUri", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_nextPageUri";
- expect(model.nextPageUri).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.SMSTollFreeCampaignsListResult;
+ let model: freeclimb.SMSTollFreeCampaignsListResult =
+ new freeclimb.SMSTollFreeCampaignsListResult({
+ total: 0,
+ start: 0,
+ end: 0,
+ page: 0,
+ numPages: 0,
+ pageSize: 0,
+ nextPageUri: "",
+ brands: [],
+ });
+ describe("SMSTollFreeCampaignsListResult class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SMSTollFreeCampaignsListResult);
+ });
+ });
+ describe(".total", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.total).toBe(value);
+ });
+ });
+ describe(".start", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.start).toBe(value);
+ });
+ });
+ describe(".end", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.end).toBe(value);
+ });
+ });
+ describe(".page", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.page).toBe(value);
+ });
+ });
+ describe(".numPages", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.numPages).toBe(value);
+ });
+ });
+ describe(".pageSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pageSize).toBe(value);
+ });
+ });
+ describe(".nextPageUri", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.nextPageUri).toBe(value);
+ });
+ });
+ describe(".brands", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.SMSTollFreeCampaign[] = [];
+ expect(model.brands).toStrictEqual(value);
+ });
});
});
- describe(".brands", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.SMSTollFreeCampaign[] = [];
- expect(model.brands).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.SMSTollFreeCampaignsListResult;
+ let constructorArguments = {
+ total: 1,
+ start: 1,
+ end: 1,
+ page: 1,
+ numPages: 1,
+ pageSize: 1,
+ nextPageUri: "test_nextPageUri",
+ };
+ let model: freeclimb.SMSTollFreeCampaignsListResult =
+ new freeclimb.SMSTollFreeCampaignsListResult(constructorArguments);
+
+ describe("#brands", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "brands",
+ )?.defaultValue;
+ expect(model.brands).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/Say.spec.ts b/__tests__/models/Say.spec.ts
index bf4e809..a8c3200 100644
--- a/__tests__/models/Say.spec.ts
+++ b/__tests__/models/Say.spec.ts
@@ -2,40 +2,119 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Say", () => {
- let model: freeclimb.Say = new freeclimb.Say({
- text: "test_text",
- language: "test_language",
- loop: 1,
- privacyMode: true,
- });
- describe("Say class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.Say);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.Say;
+ let model: freeclimb.Say = new freeclimb.Say({
+ text: "test_text",
+ language: "test_language",
+ loop: 1,
+ privacyMode: true,
+ });
+ describe("Say class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Say);
+ });
});
- });
- describe(".text", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_text";
- expect(model.text).toBe(value);
+ describe(".text", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_text";
+ expect(model.text).toBe(value);
+ });
});
- });
- describe(".language", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_language";
- expect(model.language).toBe(value);
+ describe(".language", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_language";
+ expect(model.language).toBe(value);
+ });
+ });
+ describe(".loop", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.loop).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".loop", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.loop).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.Say;
+ let model: freeclimb.Say = new freeclimb.Say({
+ text: "",
+ language: "",
+ loop: 0,
+ privacyMode: false,
+ });
+ describe("Say class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Say);
+ });
+ });
+
+ describe(".text", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.text).toBe(value);
+ });
+ });
+ describe(".language", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.language).toBe(value);
+ });
+ });
+ describe(".loop", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.loop).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".privacyMode", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.privacyMode).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.Say;
+ let constructorArguments = {
+ text: "test_text",
+ };
+ let model: freeclimb.Say = new freeclimb.Say(constructorArguments);
+
+ describe("#text", () => {
+ it("resolves to initialization value", () => {
+ expect(model.text).toBe(constructorArguments["text"]);
+ });
+ });
+ describe("#language", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "language",
+ )?.defaultValue;
+ expect(model.language).toBe(value);
+ });
+ });
+ describe("#loop", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "loop",
+ )?.defaultValue;
+ expect(model.loop).toBe(value);
+ });
+ });
+ describe("#privacyMode", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "privacyMode",
+ )?.defaultValue;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/SendDigits.spec.ts b/__tests__/models/SendDigits.spec.ts
index 829729e..231c56c 100644
--- a/__tests__/models/SendDigits.spec.ts
+++ b/__tests__/models/SendDigits.spec.ts
@@ -2,33 +2,99 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SendDigits", () => {
- let model: freeclimb.SendDigits = new freeclimb.SendDigits({
- digits: "test_digits",
- pauseMs: 1,
- privacyMode: true,
- });
- describe("SendDigits class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.SendDigits);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.SendDigits;
+ let model: freeclimb.SendDigits = new freeclimb.SendDigits({
+ digits: "test_digits",
+ pauseMs: 1,
+ privacyMode: true,
+ });
+ describe("SendDigits class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SendDigits);
+ });
});
- });
- describe(".digits", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_digits";
- expect(model.digits).toBe(value);
+ describe(".digits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_digits";
+ expect(model.digits).toBe(value);
+ });
+ });
+ describe(".pauseMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.pauseMs).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".pauseMs", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.pauseMs).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.SendDigits;
+ let model: freeclimb.SendDigits = new freeclimb.SendDigits({
+ digits: "",
+ pauseMs: 0,
+ privacyMode: false,
+ });
+ describe("SendDigits class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SendDigits);
+ });
+ });
+
+ describe(".digits", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.digits).toBe(value);
+ });
+ });
+ describe(".pauseMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.pauseMs).toBe(value);
+ });
+ });
+ describe(".privacyMode", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
- describe(".privacyMode", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.privacyMode).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.SendDigits;
+ let constructorArguments = {
+ digits: "test_digits",
+ };
+ let model: freeclimb.SendDigits = new freeclimb.SendDigits(
+ constructorArguments,
+ );
+
+ describe("#digits", () => {
+ it("resolves to initialization value", () => {
+ expect(model.digits).toBe(constructorArguments["digits"]);
+ });
+ });
+ describe("#pauseMs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "pauseMs",
+ )?.defaultValue;
+ expect(model.pauseMs).toBe(value);
+ });
+ });
+ describe("#privacyMode", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "privacyMode",
+ )?.defaultValue;
+ expect(model.privacyMode).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/SetDTMFPassThrough.spec.ts b/__tests__/models/SetDTMFPassThrough.spec.ts
index eab0ec4..efb6c83 100644
--- a/__tests__/models/SetDTMFPassThrough.spec.ts
+++ b/__tests__/models/SetDTMFPassThrough.spec.ts
@@ -2,19 +2,56 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SetDTMFPassThrough", () => {
- let model: freeclimb.SetDTMFPassThrough = new freeclimb.SetDTMFPassThrough({
- dtmfPassThrough: true,
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.SetDTMFPassThrough;
+ let model: freeclimb.SetDTMFPassThrough = new freeclimb.SetDTMFPassThrough({
+ dtmfPassThrough: true,
+ });
+ describe("SetDTMFPassThrough class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SetDTMFPassThrough);
+ });
+ });
+
+ describe(".dtmfPassThrough", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.dtmfPassThrough).toBe(value);
+ });
+ });
});
- describe("SetDTMFPassThrough class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.SetDTMFPassThrough);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.SetDTMFPassThrough;
+ let model: freeclimb.SetDTMFPassThrough = new freeclimb.SetDTMFPassThrough({
+ dtmfPassThrough: false,
+ });
+ describe("SetDTMFPassThrough class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SetDTMFPassThrough);
+ });
+ });
+
+ describe(".dtmfPassThrough", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.dtmfPassThrough).toBe(value);
+ });
});
});
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.SetDTMFPassThrough;
+ let constructorArguments = {};
+ let model: freeclimb.SetDTMFPassThrough = new freeclimb.SetDTMFPassThrough(
+ constructorArguments,
+ );
- describe(".dtmfPassThrough", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.dtmfPassThrough).toBe(value);
+ describe("#dtmfPassThrough", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "dtmfPassThrough",
+ )?.defaultValue;
+ expect(model.dtmfPassThrough).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/SetListen.spec.ts b/__tests__/models/SetListen.spec.ts
index fd82988..34519dc 100644
--- a/__tests__/models/SetListen.spec.ts
+++ b/__tests__/models/SetListen.spec.ts
@@ -2,19 +2,56 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SetListen", () => {
- let model: freeclimb.SetListen = new freeclimb.SetListen({
- listen: true,
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.SetListen;
+ let model: freeclimb.SetListen = new freeclimb.SetListen({
+ listen: true,
+ });
+ describe("SetListen class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SetListen);
+ });
+ });
+
+ describe(".listen", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.listen).toBe(value);
+ });
+ });
});
- describe("SetListen class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.SetListen);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.SetListen;
+ let model: freeclimb.SetListen = new freeclimb.SetListen({
+ listen: false,
+ });
+ describe("SetListen class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SetListen);
+ });
+ });
+
+ describe(".listen", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.listen).toBe(value);
+ });
});
});
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.SetListen;
+ let constructorArguments = {};
+ let model: freeclimb.SetListen = new freeclimb.SetListen(
+ constructorArguments,
+ );
- describe(".listen", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.listen).toBe(value);
+ describe("#listen", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "listen",
+ )?.defaultValue;
+ expect(model.listen).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/SetTalk.spec.ts b/__tests__/models/SetTalk.spec.ts
index 3e6de5b..9534b2e 100644
--- a/__tests__/models/SetTalk.spec.ts
+++ b/__tests__/models/SetTalk.spec.ts
@@ -2,19 +2,54 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("SetTalk", () => {
- let model: freeclimb.SetTalk = new freeclimb.SetTalk({
- talk: true,
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.SetTalk;
+ let model: freeclimb.SetTalk = new freeclimb.SetTalk({
+ talk: true,
+ });
+ describe("SetTalk class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SetTalk);
+ });
+ });
+
+ describe(".talk", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.talk).toBe(value);
+ });
+ });
});
- describe("SetTalk class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.SetTalk);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.SetTalk;
+ let model: freeclimb.SetTalk = new freeclimb.SetTalk({
+ talk: false,
+ });
+ describe("SetTalk class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.SetTalk);
+ });
+ });
+
+ describe(".talk", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.talk).toBe(value);
+ });
});
});
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.SetTalk;
+ let constructorArguments = {};
+ let model: freeclimb.SetTalk = new freeclimb.SetTalk(constructorArguments);
- describe(".talk", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.talk).toBe(value);
+ describe("#talk", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "talk",
+ )?.defaultValue;
+ expect(model.talk).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/Sms.spec.ts b/__tests__/models/Sms.spec.ts
index ae2ae9c..a5369d9 100644
--- a/__tests__/models/Sms.spec.ts
+++ b/__tests__/models/Sms.spec.ts
@@ -2,40 +2,115 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Sms", () => {
- let model: freeclimb.Sms = new freeclimb.Sms({
- to: "test_to",
- from: "test_from",
- text: "test_text",
- notificationUrl: "https://123.abc",
- });
- describe("Sms class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.Sms);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.Sms;
+ let model: freeclimb.Sms = new freeclimb.Sms({
+ to: "test_to",
+ from: "test_from",
+ text: "test_text",
+ notificationUrl: "https://123.abc",
+ });
+ describe("Sms class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Sms);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".text", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_text";
+ expect(model.text).toBe(value);
+ });
+ });
+ describe(".notificationUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.notificationUrl).toBe(value);
+ });
});
});
- describe(".text", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_text";
- expect(model.text).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.Sms;
+ let model: freeclimb.Sms = new freeclimb.Sms({
+ to: "",
+ from: "",
+ text: "",
+ notificationUrl: "",
+ });
+ describe("Sms class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Sms);
+ });
+ });
+
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".text", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.text).toBe(value);
+ });
+ });
+ describe(".notificationUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.notificationUrl).toBe(value);
+ });
});
});
- describe(".notificationUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.notificationUrl).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.Sms;
+ let constructorArguments = {
+ to: "test_to",
+ from: "test_from",
+ text: "test_text",
+ };
+ let model: freeclimb.Sms = new freeclimb.Sms(constructorArguments);
+
+ describe("#to", () => {
+ it("resolves to initialization value", () => {
+ expect(model.to).toBe(constructorArguments["to"]);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to initialization value", () => {
+ expect(model.from).toBe(constructorArguments["from"]);
+ });
+ });
+ describe("#text", () => {
+ it("resolves to initialization value", () => {
+ expect(model.text).toBe(constructorArguments["text"]);
+ });
+ });
+ describe("#notificationUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "notificationUrl",
+ )?.defaultValue;
+ expect(model.notificationUrl).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/StartRecordCall.spec.ts b/__tests__/models/StartRecordCall.spec.ts
index 9e1d270..ab4fcae 100644
--- a/__tests__/models/StartRecordCall.spec.ts
+++ b/__tests__/models/StartRecordCall.spec.ts
@@ -2,10 +2,29 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("StartRecordCall", () => {
- let model: freeclimb.StartRecordCall = new freeclimb.StartRecordCall({});
- describe("StartRecordCall class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.StartRecordCall);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.StartRecordCall;
+ let model: freeclimb.StartRecordCall = new freeclimb.StartRecordCall({});
+ describe("StartRecordCall class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.StartRecordCall);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.StartRecordCall;
+ let model: freeclimb.StartRecordCall = new freeclimb.StartRecordCall({});
+ describe("StartRecordCall class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.StartRecordCall);
+ });
+ });
+ });
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.StartRecordCall;
+ let constructorArguments = {};
+ let model: freeclimb.StartRecordCall = new freeclimb.StartRecordCall(
+ constructorArguments,
+ );
+ });
});
diff --git a/__tests__/models/TFN.spec.ts b/__tests__/models/TFN.spec.ts
index 01b6760..aed18e2 100644
--- a/__tests__/models/TFN.spec.ts
+++ b/__tests__/models/TFN.spec.ts
@@ -2,18 +2,51 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("TFN", () => {
- let model: freeclimb.TFN = new freeclimb.TFN({
- campaignId: "test_campaignId",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.TFN;
+ let model: freeclimb.TFN = new freeclimb.TFN({
+ campaignId: "test_campaignId",
+ });
+ describe("TFN class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.TFN);
+ });
+ });
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_campaignId";
+ expect(model.campaignId).toBe(value);
+ });
+ });
});
- describe("TFN class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.TFN);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.TFN;
+ let model: freeclimb.TFN = new freeclimb.TFN({
+ campaignId: "",
+ });
+ describe("TFN class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.TFN);
+ });
+ });
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.campaignId).toBe(value);
+ });
});
});
- describe(".campaignId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_campaignId";
- expect(model.campaignId).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.TFN;
+ let constructorArguments = {
+ campaignId: "test_campaignId",
+ };
+ let model: freeclimb.TFN = new freeclimb.TFN(constructorArguments);
+
+ describe("#campaignId", () => {
+ it("resolves to initialization value", () => {
+ expect(model.campaignId).toBe(constructorArguments["campaignId"]);
+ });
});
});
});
diff --git a/__tests__/models/TFNCampaign.spec.ts b/__tests__/models/TFNCampaign.spec.ts
index 7e895da..686f75b 100644
--- a/__tests__/models/TFNCampaign.spec.ts
+++ b/__tests__/models/TFNCampaign.spec.ts
@@ -2,77 +2,228 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("TFNCampaign", () => {
- let model: freeclimb.TFNCampaign = new freeclimb.TFNCampaign({
- accountId: "test_accountId",
- campaignId: "test_campaignId",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.TFNCampaign;
+ let model: freeclimb.TFNCampaign = new freeclimb.TFNCampaign({
+ accountId: "test_accountId",
+ campaignId: "test_campaignId",
- useCase: "test_useCase",
+ useCase: "test_useCase",
- registrationStatus:
- freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED,
- dateCreated: "test_dateCreated",
- dateUpdated: "test_dateUpdated",
- dateCreatedISO: "test_dateCreatedISO",
- dateUpdatedISO: "test_dateUpdatedISO",
- revision: 1,
- });
- describe("TFNCampaign class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.TFNCampaign);
+ registrationStatus:
+ freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED,
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ dateCreatedISO: "test_dateCreatedISO",
+ dateUpdatedISO: "test_dateUpdatedISO",
+ revision: 1,
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe("TFNCampaign class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.TFNCampaign);
+ });
});
- });
- describe(".campaignId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_campaignId";
- expect(model.campaignId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".useCase", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_useCase";
- expect(model.useCase).toBe(value);
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_campaignId";
+ expect(model.campaignId).toBe(value);
+ });
});
- });
- describe(".registrationStatus", () => {
- it("resolves to particular value on initialization", () => {
- const value = "UNREGISTERED";
- expect(model.registrationStatus).toBe(value);
+ describe(".useCase", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_useCase";
+ expect(model.useCase).toBe(value);
+ });
});
- });
- describe(".dateCreated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreated";
- expect(model.dateCreated).toBe(value);
+ describe(".registrationStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "UNREGISTERED";
+ expect(model.registrationStatus).toBe(value);
+ });
});
- });
- describe(".dateUpdated", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdated";
- expect(model.dateUpdated).toBe(value);
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreated";
+ expect(model.dateCreated).toBe(value);
+ });
});
- });
- describe(".dateCreatedISO", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateCreatedISO";
- expect(model.dateCreatedISO).toBe(value);
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdated";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".dateCreatedISO", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateCreatedISO";
+ expect(model.dateCreatedISO).toBe(value);
+ });
+ });
+ describe(".dateUpdatedISO", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_dateUpdatedISO";
+ expect(model.dateUpdatedISO).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.revision).toBe(value);
+ });
});
});
- describe(".dateUpdatedISO", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_dateUpdatedISO";
- expect(model.dateUpdatedISO).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.TFNCampaign;
+ let model: freeclimb.TFNCampaign = new freeclimb.TFNCampaign({
+ accountId: "",
+ campaignId: "",
+
+ useCase: "",
+
+ registrationStatus:
+ freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED,
+ dateCreated: "",
+ dateUpdated: "",
+ dateCreatedISO: "",
+ dateUpdatedISO: "",
+ revision: 0,
+ });
+ describe("TFNCampaign class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.TFNCampaign);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".campaignId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.campaignId).toBe(value);
+ });
+ });
+ describe(".useCase", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.useCase).toBe(value);
+ });
+ });
+ describe(".registrationStatus", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "UNREGISTERED";
+ expect(model.registrationStatus).toBe(value);
+ });
+ });
+ describe(".dateCreated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreated).toBe(value);
+ });
+ });
+ describe(".dateUpdated", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdated).toBe(value);
+ });
+ });
+ describe(".dateCreatedISO", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateCreatedISO).toBe(value);
+ });
+ });
+ describe(".dateUpdatedISO", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.dateUpdatedISO).toBe(value);
+ });
+ });
+ describe(".revision", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.revision).toBe(value);
+ });
});
});
- describe(".revision", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.revision).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.TFNCampaign;
+ let constructorArguments = {
+ accountId: "test_accountId",
+ campaignId: "test_campaignId",
+
+ useCase: "test_useCase",
+
+ registrationStatus:
+ freeclimb.SMSTollFreeCampaignRegistrationStatus.UNREGISTERED,
+ dateCreated: "test_dateCreated",
+ dateUpdated: "test_dateUpdated",
+ dateCreatedISO: "test_dateCreatedISO",
+ dateUpdatedISO: "test_dateUpdatedISO",
+ revision: 1,
+ };
+ let model: freeclimb.TFNCampaign = new freeclimb.TFNCampaign(
+ constructorArguments,
+ );
+
+ describe("#accountId", () => {
+ it("resolves to initialization value", () => {
+ expect(model.accountId).toBe(constructorArguments["accountId"]);
+ });
+ });
+ describe("#campaignId", () => {
+ it("resolves to initialization value", () => {
+ expect(model.campaignId).toBe(constructorArguments["campaignId"]);
+ });
+ });
+ describe("#useCase", () => {
+ it("resolves to initialization value", () => {
+ expect(model.useCase).toBe(constructorArguments["useCase"]);
+ });
+ });
+ describe("#registrationStatus", () => {
+ it("resolves to initialization value", () => {
+ expect(model.registrationStatus).toBe(
+ constructorArguments["registrationStatus"],
+ );
+ });
+ });
+ describe("#dateCreated", () => {
+ it("resolves to initialization value", () => {
+ expect(model.dateCreated).toBe(constructorArguments["dateCreated"]);
+ });
+ });
+ describe("#dateUpdated", () => {
+ it("resolves to initialization value", () => {
+ expect(model.dateUpdated).toBe(constructorArguments["dateUpdated"]);
+ });
+ });
+ describe("#dateCreatedISO", () => {
+ it("resolves to initialization value", () => {
+ expect(model.dateCreatedISO).toBe(
+ constructorArguments["dateCreatedISO"],
+ );
+ });
+ });
+ describe("#dateUpdatedISO", () => {
+ it("resolves to initialization value", () => {
+ expect(model.dateUpdatedISO).toBe(
+ constructorArguments["dateUpdatedISO"],
+ );
+ });
+ });
+ describe("#revision", () => {
+ it("resolves to initialization value", () => {
+ expect(model.revision).toBe(constructorArguments["revision"]);
+ });
});
});
});
diff --git a/__tests__/models/TerminateConference.spec.ts b/__tests__/models/TerminateConference.spec.ts
index e7c3f87..9bf1f7d 100644
--- a/__tests__/models/TerminateConference.spec.ts
+++ b/__tests__/models/TerminateConference.spec.ts
@@ -2,12 +2,30 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("TerminateConference", () => {
- let model: freeclimb.TerminateConference = new freeclimb.TerminateConference(
- {},
- );
- describe("TerminateConference class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.TerminateConference);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.TerminateConference;
+ let model: freeclimb.TerminateConference =
+ new freeclimb.TerminateConference({});
+ describe("TerminateConference class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.TerminateConference);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.TerminateConference;
+ let model: freeclimb.TerminateConference =
+ new freeclimb.TerminateConference({});
+ describe("TerminateConference class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.TerminateConference);
+ });
+ });
+ });
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.TerminateConference;
+ let constructorArguments = {};
+ let model: freeclimb.TerminateConference =
+ new freeclimb.TerminateConference(constructorArguments);
+ });
});
diff --git a/__tests__/models/TranscribeReason.spec.ts b/__tests__/models/TranscribeReason.spec.ts
index 1af9d26..ac4b1b6 100644
--- a/__tests__/models/TranscribeReason.spec.ts
+++ b/__tests__/models/TranscribeReason.spec.ts
@@ -2,29 +2,31 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("TranscribeReason", () => {
- describe(".INTERNAL_ERROR", () => {
- it("resolves to correct value for INTERNAL_ERROR enum property", () => {
- expect(freeclimb.TranscribeReason.INTERNAL_ERROR).toBe("internalError");
+ describe("Test with truthy values", () => {
+ describe(".INTERNAL_ERROR", () => {
+ it("resolves to correct value for INTERNAL_ERROR enum property", () => {
+ expect(freeclimb.TranscribeReason.INTERNAL_ERROR).toBe("internalError");
+ });
});
- });
- describe(".HANGUP", () => {
- it("resolves to correct value for HANGUP enum property", () => {
- expect(freeclimb.TranscribeReason.HANGUP).toBe("hangup");
+ describe(".HANGUP", () => {
+ it("resolves to correct value for HANGUP enum property", () => {
+ expect(freeclimb.TranscribeReason.HANGUP).toBe("hangup");
+ });
});
- });
- describe(".MAX_LENGTH", () => {
- it("resolves to correct value for MAX_LENGTH enum property", () => {
- expect(freeclimb.TranscribeReason.MAX_LENGTH).toBe("maxLength");
+ describe(".MAX_LENGTH", () => {
+ it("resolves to correct value for MAX_LENGTH enum property", () => {
+ expect(freeclimb.TranscribeReason.MAX_LENGTH).toBe("maxLength");
+ });
});
- });
- describe(".DIGIT", () => {
- it("resolves to correct value for DIGIT enum property", () => {
- expect(freeclimb.TranscribeReason.DIGIT).toBe("digit");
+ describe(".DIGIT", () => {
+ it("resolves to correct value for DIGIT enum property", () => {
+ expect(freeclimb.TranscribeReason.DIGIT).toBe("digit");
+ });
});
- });
- describe(".NO_INPUT", () => {
- it("resolves to correct value for NO_INPUT enum property", () => {
- expect(freeclimb.TranscribeReason.NO_INPUT).toBe("noInput");
+ describe(".NO_INPUT", () => {
+ it("resolves to correct value for NO_INPUT enum property", () => {
+ expect(freeclimb.TranscribeReason.NO_INPUT).toBe("noInput");
+ });
});
});
});
diff --git a/__tests__/models/TranscribeTermReason.spec.ts b/__tests__/models/TranscribeTermReason.spec.ts
index 473ac19..6ac7996 100644
--- a/__tests__/models/TranscribeTermReason.spec.ts
+++ b/__tests__/models/TranscribeTermReason.spec.ts
@@ -2,14 +2,16 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("TranscribeTermReason", () => {
- describe(".ERROR", () => {
- it("resolves to correct value for ERROR enum property", () => {
- expect(freeclimb.TranscribeTermReason.ERROR).toBe("error");
+ describe("Test with truthy values", () => {
+ describe(".ERROR", () => {
+ it("resolves to correct value for ERROR enum property", () => {
+ expect(freeclimb.TranscribeTermReason.ERROR).toBe("error");
+ });
});
- });
- describe(".COMPLETED", () => {
- it("resolves to correct value for COMPLETED enum property", () => {
- expect(freeclimb.TranscribeTermReason.COMPLETED).toBe("completed");
+ describe(".COMPLETED", () => {
+ it("resolves to correct value for COMPLETED enum property", () => {
+ expect(freeclimb.TranscribeTermReason.COMPLETED).toBe("completed");
+ });
});
});
});
diff --git a/__tests__/models/TranscribeUtterance.spec.ts b/__tests__/models/TranscribeUtterance.spec.ts
index 67b7319..e2851ef 100644
--- a/__tests__/models/TranscribeUtterance.spec.ts
+++ b/__tests__/models/TranscribeUtterance.spec.ts
@@ -2,51 +2,160 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("TranscribeUtterance", () => {
- let model: freeclimb.TranscribeUtterance = new freeclimb.TranscribeUtterance({
- actionUrl: "https://123.abc",
- playBeep: true,
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.TranscribeUtterance;
+ let model: freeclimb.TranscribeUtterance =
+ new freeclimb.TranscribeUtterance({
+ actionUrl: "https://123.abc",
+ playBeep: true,
- privacyForLogging: true,
- privacyForRecording: true,
- prompts: [],
- });
- describe("TranscribeUtterance class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.TranscribeUtterance);
+ privacyForLogging: true,
+ privacyForRecording: true,
+ prompts: [],
+ });
+ describe("TranscribeUtterance class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.TranscribeUtterance);
+ });
});
- });
- describe(".actionUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.actionUrl).toBe(value);
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.actionUrl).toBe(value);
+ });
});
- });
- describe(".playBeep", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.playBeep).toBe(value);
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.playBeep).toBe(value);
+ });
});
- });
- describe(".record", () => {
- it("resolves to particular value on initialization", () => {});
- });
- describe(".privacyForLogging", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.privacyForLogging).toBe(value);
+ describe(".record", () => {
+ it("resolves to particular value on initialization", () => {});
+ });
+ describe(".privacyForLogging", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.privacyForLogging).toBe(value);
+ });
+ });
+ describe(".privacyForRecording", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.privacyForRecording).toBe(value);
+ });
+ });
+ describe(".prompts", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.PerclCommand[] = [];
+ expect(model.prompts).toStrictEqual(value);
+ });
});
});
- describe(".privacyForRecording", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.privacyForRecording).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.TranscribeUtterance;
+ let model: freeclimb.TranscribeUtterance =
+ new freeclimb.TranscribeUtterance({
+ actionUrl: "",
+ playBeep: false,
+
+ privacyForLogging: false,
+ privacyForRecording: false,
+ prompts: [],
+ });
+ describe("TranscribeUtterance class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.TranscribeUtterance);
+ });
+ });
+
+ describe(".actionUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.actionUrl).toBe(value);
+ });
+ });
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe(".record", () => {
+ it("resolves to particular value on initialization", () => {});
+ });
+ describe(".privacyForLogging", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.privacyForLogging).toBe(value);
+ });
+ });
+ describe(".privacyForRecording", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.privacyForRecording).toBe(value);
+ });
+ });
+ describe(".prompts", () => {
+ it("resolves to particular value on initialization", () => {
+ const value: freeclimb.PerclCommand[] = [];
+ expect(model.prompts).toStrictEqual(value);
+ });
});
});
- describe(".prompts", () => {
- it("resolves to particular value on initialization", () => {
- const value: freeclimb.PerclCommand[] = [];
- expect(model.prompts).toStrictEqual(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.TranscribeUtterance;
+ let constructorArguments = {
+ actionUrl: "https://123.abc",
+ };
+ let model: freeclimb.TranscribeUtterance =
+ new freeclimb.TranscribeUtterance(constructorArguments);
+
+ describe("#actionUrl", () => {
+ it("resolves to initialization value", () => {
+ expect(model.actionUrl).toBe(constructorArguments["actionUrl"]);
+ });
+ });
+ describe("#playBeep", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "playBeep",
+ )?.defaultValue;
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe("#record", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "record",
+ )?.defaultValue;
+ expect(model.record).toBe(value);
+ });
+ });
+ describe("#privacyForLogging", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "privacyForLogging",
+ )?.defaultValue;
+ expect(model.privacyForLogging).toBe(value);
+ });
+ });
+ describe("#privacyForRecording", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "privacyForRecording",
+ )?.defaultValue;
+ expect(model.privacyForRecording).toBe(value);
+ });
+ });
+ describe("#prompts", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "prompts",
+ )?.defaultValue;
+ expect(model.prompts).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/TranscribeUtteranceRecord.spec.ts b/__tests__/models/TranscribeUtteranceRecord.spec.ts
index 25061fc..3ba0b16 100644
--- a/__tests__/models/TranscribeUtteranceRecord.spec.ts
+++ b/__tests__/models/TranscribeUtteranceRecord.spec.ts
@@ -2,33 +2,99 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("TranscribeUtteranceRecord", () => {
- let model: freeclimb.TranscribeUtteranceRecord =
- new freeclimb.TranscribeUtteranceRecord({
- saveRecording: true,
- maxLengthSec: 1,
- rcrdTerminationSilenceTimeMs: 1,
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.TranscribeUtteranceRecord;
+ let model: freeclimb.TranscribeUtteranceRecord =
+ new freeclimb.TranscribeUtteranceRecord({
+ saveRecording: true,
+ maxLengthSec: 1,
+ rcrdTerminationSilenceTimeMs: 1,
+ });
+ describe("TranscribeUtteranceRecord class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.TranscribeUtteranceRecord);
+ });
});
- describe("TranscribeUtteranceRecord class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.TranscribeUtteranceRecord);
+ describe(".saveRecording", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.saveRecording).toBe(value);
+ });
});
- });
- describe(".saveRecording", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.saveRecording).toBe(value);
+ describe(".maxLengthSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.maxLengthSec).toBe(value);
+ });
+ });
+ describe(".rcrdTerminationSilenceTimeMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.rcrdTerminationSilenceTimeMs).toBe(value);
+ });
});
});
- describe(".maxLengthSec", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.maxLengthSec).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.TranscribeUtteranceRecord;
+ let model: freeclimb.TranscribeUtteranceRecord =
+ new freeclimb.TranscribeUtteranceRecord({
+ saveRecording: false,
+ maxLengthSec: 0,
+ rcrdTerminationSilenceTimeMs: 0,
+ });
+ describe("TranscribeUtteranceRecord class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.TranscribeUtteranceRecord);
+ });
+ });
+ describe(".saveRecording", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.saveRecording).toBe(value);
+ });
+ });
+ describe(".maxLengthSec", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.maxLengthSec).toBe(value);
+ });
+ });
+ describe(".rcrdTerminationSilenceTimeMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.rcrdTerminationSilenceTimeMs).toBe(value);
+ });
});
});
- describe(".rcrdTerminationSilenceTimeMs", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.rcrdTerminationSilenceTimeMs).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.TranscribeUtteranceRecord;
+ let constructorArguments = {};
+ let model: freeclimb.TranscribeUtteranceRecord =
+ new freeclimb.TranscribeUtteranceRecord(constructorArguments);
+
+ describe("#saveRecording", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "saveRecording",
+ )?.defaultValue;
+ expect(model.saveRecording).toBe(value);
+ });
+ });
+ describe("#maxLengthSec", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "maxLengthSec",
+ )?.defaultValue;
+ expect(model.maxLengthSec).toBe(value);
+ });
+ });
+ describe("#rcrdTerminationSilenceTimeMs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "rcrdTerminationSilenceTimeMs",
+ )?.defaultValue;
+ expect(model.rcrdTerminationSilenceTimeMs).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/TranscribeWebhook.spec.ts b/__tests__/models/TranscribeWebhook.spec.ts
index 46c8fc4..ddd4676 100644
--- a/__tests__/models/TranscribeWebhook.spec.ts
+++ b/__tests__/models/TranscribeWebhook.spec.ts
@@ -2,186 +2,566 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("TranscribeWebhook", () => {
- let model: freeclimb.TranscribeWebhook = new freeclimb.TranscribeWebhook({
- requestType: "test_requestType",
- accountId: "test_accountId",
- callId: "test_callId",
- from: "test_from",
- to: "test_to",
- recordingId: "test_recordingId",
- recordingUrl: "https://123.abc",
- recordingSize: 1,
- recordingFormat: "test_recordingFormat",
- recordingDurationMs: 1,
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.TranscribeWebhook;
+ let model: freeclimb.TranscribeWebhook = new freeclimb.TranscribeWebhook({
+ requestType: "test_requestType",
+ accountId: "test_accountId",
+ callId: "test_callId",
+ from: "test_from",
+ to: "test_to",
+ recordingId: "test_recordingId",
+ recordingUrl: "https://123.abc",
+ recordingSize: 1,
+ recordingFormat: "test_recordingFormat",
+ recordingDurationMs: 1,
- termReason: freeclimb.TranscribeTermReason.ERROR,
+ termReason: freeclimb.TranscribeTermReason.ERROR,
- recordTermReason: freeclimb.RecordUtteranceTermReason.FINISH_KEY,
- digit: "test_digit",
- privacyForLogging: true,
- privacyForRecording: true,
+ recordTermReason: freeclimb.RecordUtteranceTermReason.FINISH_KEY,
+ digit: "test_digit",
+ privacyForLogging: true,
+ privacyForRecording: true,
- bargeInReason: freeclimb.BargeInReason.NO_BARGE_IN,
- bargedInPromptNo: 1,
- bargedInPromptMs: 1,
- bargedInPromptLoopNo: 1,
- bargeInTimeMs: 1,
- transcript: "test_transcript",
+ bargeInReason: freeclimb.BargeInReason.NO_BARGE_IN,
+ bargedInPromptNo: 1,
+ bargedInPromptMs: 1,
+ bargedInPromptLoopNo: 1,
+ bargeInTimeMs: 1,
+ transcript: "test_transcript",
- transcribeReason: freeclimb.TranscribeReason.INTERNAL_ERROR,
- transcriptionDurationMs: 1,
- });
- describe("TranscribeWebhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.TranscribeWebhook);
+ transcribeReason: freeclimb.TranscribeReason.INTERNAL_ERROR,
+ transcriptionDurationMs: 1,
+ });
+ describe("TranscribeWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.TranscribeWebhook);
+ });
});
- });
- describe(".requestType", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_requestType";
- expect(model.requestType).toBe(value);
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_requestType";
+ expect(model.requestType).toBe(value);
+ });
});
- });
- describe(".accountId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_accountId";
- expect(model.accountId).toBe(value);
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_accountId";
+ expect(model.accountId).toBe(value);
+ });
});
- });
- describe(".callId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_callId";
- expect(model.callId).toBe(value);
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_callId";
+ expect(model.callId).toBe(value);
+ });
});
- });
- describe(".from", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_from";
- expect(model.from).toBe(value);
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_from";
+ expect(model.from).toBe(value);
+ });
});
- });
- describe(".to", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_to";
- expect(model.to).toBe(value);
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_to";
+ expect(model.to).toBe(value);
+ });
});
- });
- describe(".recordingId", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_recordingId";
- expect(model.recordingId).toBe(value);
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_recordingId";
+ expect(model.recordingId).toBe(value);
+ });
});
- });
- describe(".recordingUrl", () => {
- it("resolves to particular value on initialization", () => {
- const value = "https://123.abc";
- expect(model.recordingUrl).toBe(value);
+ describe(".recordingUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "https://123.abc";
+ expect(model.recordingUrl).toBe(value);
+ });
});
- });
- describe(".recordingSize", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.recordingSize).toBe(value);
+ describe(".recordingSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.recordingSize).toBe(value);
+ });
});
- });
- describe(".recordingFormat", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_recordingFormat";
- expect(model.recordingFormat).toBe(value);
+ describe(".recordingFormat", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_recordingFormat";
+ expect(model.recordingFormat).toBe(value);
+ });
});
- });
- describe(".recordingDurationMs", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.recordingDurationMs).toBe(value);
+ describe(".recordingDurationMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.recordingDurationMs).toBe(value);
+ });
});
- });
- describe(".termReason", () => {
- it("resolves to particular value on initialization", () => {
- const value = "error";
- expect(model.termReason).toBe(value);
+ describe(".termReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "error";
+ expect(model.termReason).toBe(value);
+ });
});
- });
- describe(".recordTermReason", () => {
- it("resolves to particular value on initialization", () => {
- const value = "finishKey";
- expect(model.recordTermReason).toBe(value);
+ describe(".recordTermReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "finishKey";
+ expect(model.recordTermReason).toBe(value);
+ });
});
- });
- describe(".digit", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_digit";
- expect(model.digit).toBe(value);
+ describe(".digit", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_digit";
+ expect(model.digit).toBe(value);
+ });
});
- });
- describe(".privacyForLogging", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.privacyForLogging).toBe(value);
+ describe(".privacyForLogging", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.privacyForLogging).toBe(value);
+ });
});
- });
- describe(".privacyForRecording", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.privacyForRecording).toBe(value);
+ describe(".privacyForRecording", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.privacyForRecording).toBe(value);
+ });
});
- });
- describe(".bargeInReason", () => {
- it("resolves to particular value on initialization", () => {
- const value = "noBargeIn";
- expect(model.bargeInReason).toBe(value);
+ describe(".bargeInReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "noBargeIn";
+ expect(model.bargeInReason).toBe(value);
+ });
});
- });
- describe(".bargedInPromptNo", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.bargedInPromptNo).toBe(value);
+ describe(".bargedInPromptNo", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.bargedInPromptNo).toBe(value);
+ });
});
- });
- describe(".bargedInPromptMs", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.bargedInPromptMs).toBe(value);
+ describe(".bargedInPromptMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.bargedInPromptMs).toBe(value);
+ });
});
- });
- describe(".bargedInPromptLoopNo", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.bargedInPromptLoopNo).toBe(value);
+ describe(".bargedInPromptLoopNo", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.bargedInPromptLoopNo).toBe(value);
+ });
});
- });
- describe(".bargeInTimeMs", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.bargeInTimeMs).toBe(value);
+ describe(".bargeInTimeMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.bargeInTimeMs).toBe(value);
+ });
});
- });
- describe(".transcript", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_transcript";
- expect(model.transcript).toBe(value);
+ describe(".transcript", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_transcript";
+ expect(model.transcript).toBe(value);
+ });
});
- });
- describe(".transcribeReason", () => {
- it("resolves to particular value on initialization", () => {
- const value = "internalError";
- expect(model.transcribeReason).toBe(value);
+ describe(".transcribeReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "internalError";
+ expect(model.transcribeReason).toBe(value);
+ });
+ });
+ describe(".transcriptionDurationMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 1;
+ expect(model.transcriptionDurationMs).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of TranscribeWebhook", () => {
+ expect(
+ freeclimb.TranscribeWebhook.deserialize(
+ '{ "requestType": "transcribe"}',
+ ),
+ ).toBeInstanceOf(freeclimb.TranscribeWebhook);
+ });
});
});
- describe(".transcriptionDurationMs", () => {
- it("resolves to particular value on initialization", () => {
- const value = 1;
- expect(model.transcriptionDurationMs).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.TranscribeWebhook;
+ let model: freeclimb.TranscribeWebhook = new freeclimb.TranscribeWebhook({
+ requestType: "",
+ accountId: "",
+ callId: "",
+ from: "",
+ to: "",
+ recordingId: "",
+ recordingUrl: "",
+ recordingSize: 0,
+ recordingFormat: "",
+ recordingDurationMs: 0,
+
+ termReason: freeclimb.TranscribeTermReason.ERROR,
+
+ recordTermReason: freeclimb.RecordUtteranceTermReason.FINISH_KEY,
+ digit: "",
+ privacyForLogging: false,
+ privacyForRecording: false,
+
+ bargeInReason: freeclimb.BargeInReason.NO_BARGE_IN,
+ bargedInPromptNo: 0,
+ bargedInPromptMs: 0,
+ bargedInPromptLoopNo: 0,
+ bargeInTimeMs: 0,
+ transcript: "",
+
+ transcribeReason: freeclimb.TranscribeReason.INTERNAL_ERROR,
+ transcriptionDurationMs: 0,
+ });
+ describe("TranscribeWebhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.TranscribeWebhook);
+ });
+ });
+
+ describe(".requestType", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe(".accountId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe(".callId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe(".from", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.from).toBe(value);
+ });
+ });
+ describe(".to", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.to).toBe(value);
+ });
+ });
+ describe(".recordingId", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe(".recordingUrl", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingUrl).toBe(value);
+ });
+ });
+ describe(".recordingSize", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.recordingSize).toBe(value);
+ });
+ });
+ describe(".recordingFormat", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.recordingFormat).toBe(value);
+ });
+ });
+ describe(".recordingDurationMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.recordingDurationMs).toBe(value);
+ });
+ });
+ describe(".termReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "error";
+ expect(model.termReason).toBe(value);
+ });
+ });
+ describe(".recordTermReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "finishKey";
+ expect(model.recordTermReason).toBe(value);
+ });
+ });
+ describe(".digit", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.digit).toBe(value);
+ });
+ });
+ describe(".privacyForLogging", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.privacyForLogging).toBe(value);
+ });
+ });
+ describe(".privacyForRecording", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.privacyForRecording).toBe(value);
+ });
+ });
+ describe(".bargeInReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "noBargeIn";
+ expect(model.bargeInReason).toBe(value);
+ });
+ });
+ describe(".bargedInPromptNo", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.bargedInPromptNo).toBe(value);
+ });
+ });
+ describe(".bargedInPromptMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.bargedInPromptMs).toBe(value);
+ });
+ });
+ describe(".bargedInPromptLoopNo", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.bargedInPromptLoopNo).toBe(value);
+ });
+ });
+ describe(".bargeInTimeMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.bargeInTimeMs).toBe(value);
+ });
+ });
+ describe(".transcript", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.transcript).toBe(value);
+ });
+ });
+ describe(".transcribeReason", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "internalError";
+ expect(model.transcribeReason).toBe(value);
+ });
+ });
+ describe(".transcriptionDurationMs", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = 0;
+ expect(model.transcriptionDurationMs).toBe(value);
+ });
+ });
+ describe(".deserialize", () => {
+ it("returns an instance of TranscribeWebhook", () => {
+ expect(
+ freeclimb.TranscribeWebhook.deserialize(
+ '{ "requestType": "transcribe"}',
+ ),
+ ).toBeInstanceOf(freeclimb.TranscribeWebhook);
+ });
});
});
- describe(".deserialize", () => {
- it("returns an instance of TranscribeWebhook", () => {
- expect(
- freeclimb.TranscribeWebhook.deserialize(
- '{ "requestType": "transcribe"}',
- ),
- ).toBeInstanceOf(freeclimb.TranscribeWebhook);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.TranscribeWebhook;
+ let constructorArguments = {};
+ let model: freeclimb.TranscribeWebhook = new freeclimb.TranscribeWebhook(
+ constructorArguments,
+ );
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
+ });
+ describe("#accountId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "accountId",
+ )?.defaultValue;
+ expect(model.accountId).toBe(value);
+ });
+ });
+ describe("#callId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "callId",
+ )?.defaultValue;
+ expect(model.callId).toBe(value);
+ });
+ });
+ describe("#from", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "from",
+ )?.defaultValue;
+ expect(model.from).toBe(value);
+ });
+ });
+ describe("#to", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "to",
+ )?.defaultValue;
+ expect(model.to).toBe(value);
+ });
+ });
+ describe("#recordingId", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingId",
+ )?.defaultValue;
+ expect(model.recordingId).toBe(value);
+ });
+ });
+ describe("#recordingUrl", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingUrl",
+ )?.defaultValue;
+ expect(model.recordingUrl).toBe(value);
+ });
+ });
+ describe("#recordingSize", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingSize",
+ )?.defaultValue;
+ expect(model.recordingSize).toBe(value);
+ });
+ });
+ describe("#recordingFormat", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingFormat",
+ )?.defaultValue;
+ expect(model.recordingFormat).toBe(value);
+ });
+ });
+ describe("#recordingDurationMs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordingDurationMs",
+ )?.defaultValue;
+ expect(model.recordingDurationMs).toBe(value);
+ });
+ });
+ describe("#termReason", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "termReason",
+ )?.defaultValue;
+ expect(model.termReason).toBe(value);
+ });
+ });
+ describe("#recordTermReason", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "recordTermReason",
+ )?.defaultValue;
+ expect(model.recordTermReason).toBe(value);
+ });
+ });
+ describe("#digit", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "digit",
+ )?.defaultValue;
+ expect(model.digit).toBe(value);
+ });
+ });
+ describe("#privacyForLogging", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "privacyForLogging",
+ )?.defaultValue;
+ expect(model.privacyForLogging).toBe(value);
+ });
+ });
+ describe("#privacyForRecording", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "privacyForRecording",
+ )?.defaultValue;
+ expect(model.privacyForRecording).toBe(value);
+ });
+ });
+ describe("#bargeInReason", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "bargeInReason",
+ )?.defaultValue;
+ expect(model.bargeInReason).toBe(value);
+ });
+ });
+ describe("#bargedInPromptNo", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "bargedInPromptNo",
+ )?.defaultValue;
+ expect(model.bargedInPromptNo).toBe(value);
+ });
+ });
+ describe("#bargedInPromptMs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "bargedInPromptMs",
+ )?.defaultValue;
+ expect(model.bargedInPromptMs).toBe(value);
+ });
+ });
+ describe("#bargedInPromptLoopNo", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "bargedInPromptLoopNo",
+ )?.defaultValue;
+ expect(model.bargedInPromptLoopNo).toBe(value);
+ });
+ });
+ describe("#bargeInTimeMs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "bargeInTimeMs",
+ )?.defaultValue;
+ expect(model.bargeInTimeMs).toBe(value);
+ });
+ });
+ describe("#transcript", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "transcript",
+ )?.defaultValue;
+ expect(model.transcript).toBe(value);
+ });
+ });
+ describe("#transcribeReason", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "transcribeReason",
+ )?.defaultValue;
+ expect(model.transcribeReason).toBe(value);
+ });
+ });
+ describe("#transcriptionDurationMs", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "transcriptionDurationMs",
+ )?.defaultValue;
+ expect(model.transcriptionDurationMs).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/Unpark.spec.ts b/__tests__/models/Unpark.spec.ts
index 2b2fb1a..8e8fc82 100644
--- a/__tests__/models/Unpark.spec.ts
+++ b/__tests__/models/Unpark.spec.ts
@@ -2,10 +2,27 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Unpark", () => {
- let model: freeclimb.Unpark = new freeclimb.Unpark({});
- describe("Unpark class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.Unpark);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.Unpark;
+ let model: freeclimb.Unpark = new freeclimb.Unpark({});
+ describe("Unpark class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Unpark);
+ });
});
});
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.Unpark;
+ let model: freeclimb.Unpark = new freeclimb.Unpark({});
+ describe("Unpark class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Unpark);
+ });
+ });
+ });
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.Unpark;
+ let constructorArguments = {};
+ let model: freeclimb.Unpark = new freeclimb.Unpark(constructorArguments);
+ });
});
diff --git a/__tests__/models/UpdateCallRequest.spec.ts b/__tests__/models/UpdateCallRequest.spec.ts
index 68466e1..0cd72d1 100644
--- a/__tests__/models/UpdateCallRequest.spec.ts
+++ b/__tests__/models/UpdateCallRequest.spec.ts
@@ -2,18 +2,53 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("UpdateCallRequest", () => {
- let model: freeclimb.UpdateCallRequest = new freeclimb.UpdateCallRequest({
- status: freeclimb.UpdateCallRequestStatus.CANCELED,
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.UpdateCallRequest;
+ let model: freeclimb.UpdateCallRequest = new freeclimb.UpdateCallRequest({
+ status: freeclimb.UpdateCallRequestStatus.CANCELED,
+ });
+ describe("UpdateCallRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.UpdateCallRequest);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "canceled";
+ expect(model.status).toBe(value);
+ });
+ });
});
- describe("UpdateCallRequest class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.UpdateCallRequest);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.UpdateCallRequest;
+ let model: freeclimb.UpdateCallRequest = new freeclimb.UpdateCallRequest({
+ status: freeclimb.UpdateCallRequestStatus.CANCELED,
+ });
+ describe("UpdateCallRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.UpdateCallRequest);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "canceled";
+ expect(model.status).toBe(value);
+ });
});
});
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "canceled";
- expect(model.status).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.UpdateCallRequest;
+ let constructorArguments = {
+ status: freeclimb.UpdateCallRequestStatus.CANCELED,
+ };
+ let model: freeclimb.UpdateCallRequest = new freeclimb.UpdateCallRequest(
+ constructorArguments,
+ );
+
+ describe("#status", () => {
+ it("resolves to initialization value", () => {
+ expect(model.status).toBe(constructorArguments["status"]);
+ });
});
});
});
diff --git a/__tests__/models/UpdateCallRequestStatus.spec.ts b/__tests__/models/UpdateCallRequestStatus.spec.ts
index e9999d2..c35826b 100644
--- a/__tests__/models/UpdateCallRequestStatus.spec.ts
+++ b/__tests__/models/UpdateCallRequestStatus.spec.ts
@@ -2,14 +2,16 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("UpdateCallRequestStatus", () => {
- describe(".CANCELED", () => {
- it("resolves to correct value for CANCELED enum property", () => {
- expect(freeclimb.UpdateCallRequestStatus.CANCELED).toBe("canceled");
+ describe("Test with truthy values", () => {
+ describe(".CANCELED", () => {
+ it("resolves to correct value for CANCELED enum property", () => {
+ expect(freeclimb.UpdateCallRequestStatus.CANCELED).toBe("canceled");
+ });
});
- });
- describe(".COMPLETED", () => {
- it("resolves to correct value for COMPLETED enum property", () => {
- expect(freeclimb.UpdateCallRequestStatus.COMPLETED).toBe("completed");
+ describe(".COMPLETED", () => {
+ it("resolves to correct value for COMPLETED enum property", () => {
+ expect(freeclimb.UpdateCallRequestStatus.COMPLETED).toBe("completed");
+ });
});
});
});
diff --git a/__tests__/models/UpdateConferenceParticipantRequest.spec.ts b/__tests__/models/UpdateConferenceParticipantRequest.spec.ts
index c5ad952..ab17a98 100644
--- a/__tests__/models/UpdateConferenceParticipantRequest.spec.ts
+++ b/__tests__/models/UpdateConferenceParticipantRequest.spec.ts
@@ -2,35 +2,103 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("UpdateConferenceParticipantRequest", () => {
- let model: freeclimb.UpdateConferenceParticipantRequest =
- new freeclimb.UpdateConferenceParticipantRequest({
- talk: true,
- listen: true,
- dtmfPassThrough: true,
- });
- describe("UpdateConferenceParticipantRequest class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(
- freeclimb.UpdateConferenceParticipantRequest,
- );
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.UpdateConferenceParticipantRequest;
+ let model: freeclimb.UpdateConferenceParticipantRequest =
+ new freeclimb.UpdateConferenceParticipantRequest({
+ talk: true,
+ listen: true,
+ dtmfPassThrough: true,
+ });
+ describe("UpdateConferenceParticipantRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(
+ freeclimb.UpdateConferenceParticipantRequest,
+ );
+ });
});
- });
- describe(".talk", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.talk).toBe(value);
+ describe(".talk", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.talk).toBe(value);
+ });
+ });
+ describe(".listen", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.listen).toBe(value);
+ });
+ });
+ describe(".dtmfPassThrough", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = true;
+ expect(model.dtmfPassThrough).toBe(value);
+ });
});
});
- describe(".listen", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.listen).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.UpdateConferenceParticipantRequest;
+ let model: freeclimb.UpdateConferenceParticipantRequest =
+ new freeclimb.UpdateConferenceParticipantRequest({
+ talk: false,
+ listen: false,
+ dtmfPassThrough: false,
+ });
+ describe("UpdateConferenceParticipantRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(
+ freeclimb.UpdateConferenceParticipantRequest,
+ );
+ });
+ });
+ describe(".talk", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.talk).toBe(value);
+ });
+ });
+ describe(".listen", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.listen).toBe(value);
+ });
+ });
+ describe(".dtmfPassThrough", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = false;
+ expect(model.dtmfPassThrough).toBe(value);
+ });
});
});
- describe(".dtmfPassThrough", () => {
- it("resolves to particular value on initialization", () => {
- const value = true;
- expect(model.dtmfPassThrough).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.UpdateConferenceParticipantRequest;
+ let constructorArguments = {};
+ let model: freeclimb.UpdateConferenceParticipantRequest =
+ new freeclimb.UpdateConferenceParticipantRequest(constructorArguments);
+
+ describe("#talk", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "talk",
+ )?.defaultValue;
+ expect(model.talk).toBe(value);
+ });
+ });
+ describe("#listen", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "listen",
+ )?.defaultValue;
+ expect(model.listen).toBe(value);
+ });
+ });
+ describe("#dtmfPassThrough", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "dtmfPassThrough",
+ )?.defaultValue;
+ expect(model.dtmfPassThrough).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/UpdateConferenceRequest.spec.ts b/__tests__/models/UpdateConferenceRequest.spec.ts
index cac88a5..022c965 100644
--- a/__tests__/models/UpdateConferenceRequest.spec.ts
+++ b/__tests__/models/UpdateConferenceRequest.spec.ts
@@ -2,35 +2,103 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("UpdateConferenceRequest", () => {
- let model: freeclimb.UpdateConferenceRequest =
- new freeclimb.UpdateConferenceRequest({
- alias: "test_alias",
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.UpdateConferenceRequest;
+ let model: freeclimb.UpdateConferenceRequest =
+ new freeclimb.UpdateConferenceRequest({
+ alias: "test_alias",
- playBeep: freeclimb.PlayBeep.ALWAYS,
+ playBeep: freeclimb.PlayBeep.ALWAYS,
- status: freeclimb.UpdateConferenceRequestStatus.EMPTY,
+ status: freeclimb.UpdateConferenceRequestStatus.EMPTY,
+ });
+ describe("UpdateConferenceRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.UpdateConferenceRequest);
+ });
});
- describe("UpdateConferenceRequest class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.UpdateConferenceRequest);
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "test_alias";
+ expect(model.alias).toBe(value);
+ });
});
- });
- describe(".alias", () => {
- it("resolves to particular value on initialization", () => {
- const value = "test_alias";
- expect(model.alias).toBe(value);
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "always";
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "empty";
+ expect(model.status).toBe(value);
+ });
});
});
- describe(".playBeep", () => {
- it("resolves to particular value on initialization", () => {
- const value = "always";
- expect(model.playBeep).toBe(value);
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.UpdateConferenceRequest;
+ let model: freeclimb.UpdateConferenceRequest =
+ new freeclimb.UpdateConferenceRequest({
+ alias: "",
+
+ playBeep: freeclimb.PlayBeep.ALWAYS,
+
+ status: freeclimb.UpdateConferenceRequestStatus.EMPTY,
+ });
+ describe("UpdateConferenceRequest class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.UpdateConferenceRequest);
+ });
+ });
+ describe(".alias", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "";
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe(".playBeep", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "always";
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe(".status", () => {
+ it("resolves to particular value on initialization", () => {
+ const value = "empty";
+ expect(model.status).toBe(value);
+ });
});
});
- describe(".status", () => {
- it("resolves to particular value on initialization", () => {
- const value = "empty";
- expect(model.status).toBe(value);
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.UpdateConferenceRequest;
+ let constructorArguments = {};
+ let model: freeclimb.UpdateConferenceRequest =
+ new freeclimb.UpdateConferenceRequest(constructorArguments);
+
+ describe("#alias", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "alias",
+ )?.defaultValue;
+ expect(model.alias).toBe(value);
+ });
+ });
+ describe("#playBeep", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "playBeep",
+ )?.defaultValue;
+ expect(model.playBeep).toBe(value);
+ });
+ });
+ describe("#status", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "status",
+ )?.defaultValue;
+ expect(model.status).toBe(value);
+ });
});
});
});
diff --git a/__tests__/models/UpdateConferenceRequestStatus.spec.ts b/__tests__/models/UpdateConferenceRequestStatus.spec.ts
index 6550d98..cec9879 100644
--- a/__tests__/models/UpdateConferenceRequestStatus.spec.ts
+++ b/__tests__/models/UpdateConferenceRequestStatus.spec.ts
@@ -2,16 +2,18 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("UpdateConferenceRequestStatus", () => {
- describe(".EMPTY", () => {
- it("resolves to correct value for EMPTY enum property", () => {
- expect(freeclimb.UpdateConferenceRequestStatus.EMPTY).toBe("empty");
+ describe("Test with truthy values", () => {
+ describe(".EMPTY", () => {
+ it("resolves to correct value for EMPTY enum property", () => {
+ expect(freeclimb.UpdateConferenceRequestStatus.EMPTY).toBe("empty");
+ });
});
- });
- describe(".TERMINATED", () => {
- it("resolves to correct value for TERMINATED enum property", () => {
- expect(freeclimb.UpdateConferenceRequestStatus.TERMINATED).toBe(
- "terminated",
- );
+ describe(".TERMINATED", () => {
+ it("resolves to correct value for TERMINATED enum property", () => {
+ expect(freeclimb.UpdateConferenceRequestStatus.TERMINATED).toBe(
+ "terminated",
+ );
+ });
});
});
});
diff --git a/__tests__/models/Webhook.spec.ts b/__tests__/models/Webhook.spec.ts
index 1f2837d..007e352 100644
--- a/__tests__/models/Webhook.spec.ts
+++ b/__tests__/models/Webhook.spec.ts
@@ -2,10 +2,36 @@ import * as freeclimb from "../../index";
import { describe, expect, it } from "@jest/globals";
describe("Webhook", () => {
- let model: freeclimb.Webhook = new freeclimb.Webhook({});
- describe("Webhook class test", () => {
- it("resolves to the class type upon initialization", () => {
- expect(model).toBeInstanceOf(freeclimb.Webhook);
+ describe("Test with truthy values", () => {
+ const Klass = freeclimb.Webhook;
+ let model: freeclimb.Webhook = new freeclimb.Webhook({});
+ describe("Webhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Webhook);
+ });
+ });
+ });
+ describe("Test with falsy values", () => {
+ const Klass = freeclimb.Webhook;
+ let model: freeclimb.Webhook = new freeclimb.Webhook({});
+ describe("Webhook class test", () => {
+ it("resolves to the class type upon initialization", () => {
+ expect(model).toBeInstanceOf(freeclimb.Webhook);
+ });
+ });
+ });
+ describe("Test with only required values", () => {
+ const Klass = freeclimb.Webhook;
+ let constructorArguments = {};
+ let model: freeclimb.Webhook = new freeclimb.Webhook(constructorArguments);
+
+ describe("#requestType", () => {
+ it("resolves to default value on initialization if no value is provided", () => {
+ const value = Klass.attributeTypeMap.find(
+ (attribute) => attribute.name === "requestType",
+ )?.defaultValue;
+ expect(model.requestType).toBe(value);
+ });
});
});
});
diff --git a/models/AccountRequest.ts b/models/AccountRequest.ts
index 86ee221..da815b3 100644
--- a/models/AccountRequest.ts
+++ b/models/AccountRequest.ts
@@ -59,15 +59,15 @@ export class AccountRequest {
}
public constructor(args: ArgumentsType) {
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- AccountRequest.attributeTypeMap.find((attr) => attr.name === attribute)
- ?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : AccountRequest.attributeTypeMap.find(
+ (attr) => attr.name === attribute,
+ )?.defaultValue
+ ) as T;
};
- if (args["alias"]) {
- this["alias"] = assign("alias");
- }
- if (args["label"]) {
- this["label"] = assign("label");
- }
+ this["alias"] = assign("alias");
+ this["label"] = assign("label");
}
}
diff --git a/models/AccountResult.ts b/models/AccountResult.ts
index 0259daf..5f0c39b 100644
--- a/models/AccountResult.ts
+++ b/models/AccountResult.ts
@@ -172,42 +172,24 @@ export class AccountResult {
}
public constructor(args: ArgumentsType) {
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- AccountResult.attributeTypeMap.find((attr) => attr.name === attribute)
- ?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : AccountResult.attributeTypeMap.find(
+ (attr) => attr.name === attribute,
+ )?.defaultValue
+ ) as T;
};
- if (args["uri"]) {
- this["uri"] = assign("uri");
- }
- if (args["dateCreated"]) {
- this["dateCreated"] = assign("dateCreated");
- }
- if (args["dateUpdated"]) {
- this["dateUpdated"] = assign("dateUpdated");
- }
- if (args["revision"]) {
- this["revision"] = assign("revision");
- }
- if (args["accountId"]) {
- this["accountId"] = assign("accountId");
- }
- if (args["apiKey"]) {
- this["apiKey"] = assign("apiKey");
- }
- if (args["alias"]) {
- this["alias"] = assign("alias");
- }
- if (args["label"]) {
- this["label"] = assign("label");
- }
- if (args["type"]) {
- this["type"] = assign("type");
- }
- if (args["status"]) {
- this["status"] = assign("status");
- }
- if (args["subresourceUris"]) {
- this["subresourceUris"] = assign("subresourceUris");
- }
+ this["uri"] = assign("uri");
+ this["dateCreated"] = assign("dateCreated");
+ this["dateUpdated"] = assign("dateUpdated");
+ this["revision"] = assign("revision");
+ this["accountId"] = assign("accountId");
+ this["apiKey"] = assign("apiKey");
+ this["alias"] = assign("alias");
+ this["label"] = assign("label");
+ this["type"] = assign("type");
+ this["status"] = assign("status");
+ this["subresourceUris"] = assign("subresourceUris");
}
}
diff --git a/models/AddToConference.ts b/models/AddToConference.ts
index 5a4c7cf..ed2d05e 100644
--- a/models/AddToConference.ts
+++ b/models/AddToConference.ts
@@ -169,39 +169,23 @@ export class AddToConference extends PerclCommand {
public constructor(args: ArgumentsType) {
super({ command: "AddToConference" });
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- AddToConference.attributeTypeMap.find((attr) => attr.name === attribute)
- ?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : AddToConference.attributeTypeMap.find(
+ (attr) => attr.name === attribute,
+ )?.defaultValue
+ ) as T;
};
- if (args["allowCallControl"]) {
- this["allowCallControl"] = assign("allowCallControl");
- }
- if (args["callControlSequence"]) {
- this["callControlSequence"] = assign("callControlSequence");
- }
- if (args["callControlUrl"]) {
- this["callControlUrl"] = assign("callControlUrl");
- }
- if (args["conferenceId"]) {
- this["conferenceId"] = assign("conferenceId");
- }
- if (args["leaveConferenceUrl"]) {
- this["leaveConferenceUrl"] = assign("leaveConferenceUrl");
- }
- if (args["listen"]) {
- this["listen"] = assign("listen");
- }
- if (args["notificationUrl"]) {
- this["notificationUrl"] = assign("notificationUrl");
- }
- if (args["startConfOnEnter"]) {
- this["startConfOnEnter"] = assign("startConfOnEnter");
- }
- if (args["talk"]) {
- this["talk"] = assign("talk");
- }
- if (args["dtmfPassThrough"]) {
- this["dtmfPassThrough"] = assign("dtmfPassThrough");
- }
+ this["allowCallControl"] = assign("allowCallControl");
+ this["callControlSequence"] = assign("callControlSequence");
+ this["callControlUrl"] = assign("callControlUrl");
+ this["conferenceId"] = assign("conferenceId");
+ this["leaveConferenceUrl"] = assign("leaveConferenceUrl");
+ this["listen"] = assign("listen");
+ this["notificationUrl"] = assign("notificationUrl");
+ this["startConfOnEnter"] = assign("startConfOnEnter");
+ this["talk"] = assign("talk");
+ this["dtmfPassThrough"] = assign("dtmfPassThrough");
}
}
diff --git a/models/AddToConferenceNotificationWebhook.ts b/models/AddToConferenceNotificationWebhook.ts
index cdcdc93..1623a3c 100644
--- a/models/AddToConferenceNotificationWebhook.ts
+++ b/models/AddToConferenceNotificationWebhook.ts
@@ -204,50 +204,27 @@ export class AddToConferenceNotificationWebhook extends Webhook {
public constructor(args: ArgumentsType) {
super({ requestType: "addToConferenceNotification" });
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- AddToConferenceNotificationWebhook.attributeTypeMap.find(
- (attr) => attr.name === attribute,
- )?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : AddToConferenceNotificationWebhook.attributeTypeMap.find(
+ (attr) => attr.name === attribute,
+ )?.defaultValue
+ ) as T;
};
- if (args["requestType"]) {
- this["requestType"] = assign("requestType");
- }
- if (args["callId"]) {
- this["callId"] = assign("callId");
- }
- if (args["accountId"]) {
- this["accountId"] = assign("accountId");
- }
- if (args["from"]) {
- this["from"] = assign("from");
- }
- if (args["to"]) {
- this["to"] = assign("to");
- }
- if (args["callStatus"]) {
- this["callStatus"] = assign("callStatus");
- }
- if (args["direction"]) {
- this["direction"] = assign("direction");
- }
- if (args["conferenceId"]) {
- this["conferenceId"] = assign("conferenceId");
- }
- if (args["queueId"]) {
- this["queueId"] = assign("queueId");
- }
- if (args["status"]) {
- this["status"] = assign("status");
- }
- if (args["recordingUrl"]) {
- this["recordingUrl"] = assign("recordingUrl");
- }
- if (args["recordingId"]) {
- this["recordingId"] = assign("recordingId");
- }
- if (args["recordingDurationSec"]) {
- this["recordingDurationSec"] = assign("recordingDurationSec");
- }
+ this["requestType"] = assign("requestType");
+ this["callId"] = assign("callId");
+ this["accountId"] = assign("accountId");
+ this["from"] = assign("from");
+ this["to"] = assign("to");
+ this["callStatus"] = assign("callStatus");
+ this["direction"] = assign("direction");
+ this["conferenceId"] = assign("conferenceId");
+ this["queueId"] = assign("queueId");
+ this["status"] = assign("status");
+ this["recordingUrl"] = assign("recordingUrl");
+ this["recordingId"] = assign("recordingId");
+ this["recordingDurationSec"] = assign("recordingDurationSec");
}
public static deserialize(
payload: string,
diff --git a/models/AddToQueueNotificationWebhook.ts b/models/AddToQueueNotificationWebhook.ts
index 34c0143..03d1c51 100644
--- a/models/AddToQueueNotificationWebhook.ts
+++ b/models/AddToQueueNotificationWebhook.ts
@@ -154,38 +154,23 @@ export class AddToQueueNotificationWebhook extends Webhook {
public constructor(args: ArgumentsType) {
super({ requestType: "addToQueueNotification" });
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- AddToQueueNotificationWebhook.attributeTypeMap.find(
- (attr) => attr.name === attribute,
- )?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : AddToQueueNotificationWebhook.attributeTypeMap.find(
+ (attr) => attr.name === attribute,
+ )?.defaultValue
+ ) as T;
};
- if (args["requestType"]) {
- this["requestType"] = assign("requestType");
- }
- if (args["callId"]) {
- this["callId"] = assign("callId");
- }
- if (args["accountId"]) {
- this["accountId"] = assign("accountId");
- }
- if (args["from"]) {
- this["from"] = assign("from");
- }
- if (args["to"]) {
- this["to"] = assign("to");
- }
- if (args["callStatus"]) {
- this["callStatus"] = assign("callStatus");
- }
- if (args["direction"]) {
- this["direction"] = assign("direction");
- }
- if (args["conferenceId"]) {
- this["conferenceId"] = assign("conferenceId");
- }
- if (args["queueId"]) {
- this["queueId"] = assign("queueId");
- }
+ this["requestType"] = assign("requestType");
+ this["callId"] = assign("callId");
+ this["accountId"] = assign("accountId");
+ this["from"] = assign("from");
+ this["to"] = assign("to");
+ this["callStatus"] = assign("callStatus");
+ this["direction"] = assign("direction");
+ this["conferenceId"] = assign("conferenceId");
+ this["queueId"] = assign("queueId");
}
public static deserialize(payload: string): AddToQueueNotificationWebhook {
return new AddToQueueNotificationWebhook(JSON.parse(payload));
diff --git a/models/ApplicationList.ts b/models/ApplicationList.ts
index 8625202..4f18cba 100644
--- a/models/ApplicationList.ts
+++ b/models/ApplicationList.ts
@@ -135,33 +135,21 @@ export class ApplicationList {
}
public constructor(args: ArgumentsType) {
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- ApplicationList.attributeTypeMap.find((attr) => attr.name === attribute)
- ?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : ApplicationList.attributeTypeMap.find(
+ (attr) => attr.name === attribute,
+ )?.defaultValue
+ ) as T;
};
- if (args["total"]) {
- this["total"] = assign("total");
- }
- if (args["start"]) {
- this["start"] = assign("start");
- }
- if (args["end"]) {
- this["end"] = assign("end");
- }
- if (args["page"]) {
- this["page"] = assign("page");
- }
- if (args["numPages"]) {
- this["numPages"] = assign("numPages");
- }
- if (args["pageSize"]) {
- this["pageSize"] = assign("pageSize");
- }
- if (args["nextPageUri"]) {
- this["nextPageUri"] = assign("nextPageUri");
- }
- if (args["applications"]) {
- this["applications"] = assign>("applications");
- }
+ this["total"] = assign("total");
+ this["start"] = assign("start");
+ this["end"] = assign("end");
+ this["page"] = assign("page");
+ this["numPages"] = assign("numPages");
+ this["pageSize"] = assign("pageSize");
+ this["nextPageUri"] = assign("nextPageUri");
+ this["applications"] = assign>("applications");
}
}
diff --git a/models/ApplicationRequest.ts b/models/ApplicationRequest.ts
index f045944..b355b3a 100644
--- a/models/ApplicationRequest.ts
+++ b/models/ApplicationRequest.ts
@@ -124,31 +124,20 @@ export class ApplicationRequest {
}
public constructor(args: ArgumentsType) {
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- ApplicationRequest.attributeTypeMap.find(
- (attr) => attr.name === attribute,
- )?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : ApplicationRequest.attributeTypeMap.find(
+ (attr) => attr.name === attribute,
+ )?.defaultValue
+ ) as T;
};
- if (args["alias"]) {
- this["alias"] = assign("alias");
- }
- if (args["voiceUrl"]) {
- this["voiceUrl"] = assign("voiceUrl");
- }
- if (args["voiceFallbackUrl"]) {
- this["voiceFallbackUrl"] = assign("voiceFallbackUrl");
- }
- if (args["callConnectUrl"]) {
- this["callConnectUrl"] = assign("callConnectUrl");
- }
- if (args["statusCallbackUrl"]) {
- this["statusCallbackUrl"] = assign("statusCallbackUrl");
- }
- if (args["smsUrl"]) {
- this["smsUrl"] = assign("smsUrl");
- }
- if (args["smsFallbackUrl"]) {
- this["smsFallbackUrl"] = assign("smsFallbackUrl");
- }
+ this["alias"] = assign("alias");
+ this["voiceUrl"] = assign("voiceUrl");
+ this["voiceFallbackUrl"] = assign("voiceFallbackUrl");
+ this["callConnectUrl"] = assign("callConnectUrl");
+ this["statusCallbackUrl"] = assign("statusCallbackUrl");
+ this["smsUrl"] = assign("smsUrl");
+ this["smsFallbackUrl"] = assign("smsFallbackUrl");
}
}
diff --git a/models/ApplicationResult.ts b/models/ApplicationResult.ts
index 04d367e..76fff1e 100644
--- a/models/ApplicationResult.ts
+++ b/models/ApplicationResult.ts
@@ -202,49 +202,26 @@ export class ApplicationResult {
}
public constructor(args: ArgumentsType) {
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- ApplicationResult.attributeTypeMap.find(
- (attr) => attr.name === attribute,
- )?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : ApplicationResult.attributeTypeMap.find(
+ (attr) => attr.name === attribute,
+ )?.defaultValue
+ ) as T;
};
- if (args["uri"]) {
- this["uri"] = assign("uri");
- }
- if (args["dateCreated"]) {
- this["dateCreated"] = assign("dateCreated");
- }
- if (args["dateUpdated"]) {
- this["dateUpdated"] = assign("dateUpdated");
- }
- if (args["revision"]) {
- this["revision"] = assign("revision");
- }
- if (args["accountId"]) {
- this["accountId"] = assign("accountId");
- }
- if (args["applicationId"]) {
- this["applicationId"] = assign("applicationId");
- }
- if (args["alias"]) {
- this["alias"] = assign("alias");
- }
- if (args["voiceUrl"]) {
- this["voiceUrl"] = assign("voiceUrl");
- }
- if (args["voiceFallbackUrl"]) {
- this["voiceFallbackUrl"] = assign("voiceFallbackUrl");
- }
- if (args["callConnectUrl"]) {
- this["callConnectUrl"] = assign("callConnectUrl");
- }
- if (args["statusCallbackUrl"]) {
- this["statusCallbackUrl"] = assign("statusCallbackUrl");
- }
- if (args["smsUrl"]) {
- this["smsUrl"] = assign("smsUrl");
- }
- if (args["smsFallbackUrl"]) {
- this["smsFallbackUrl"] = assign("smsFallbackUrl");
- }
+ this["uri"] = assign("uri");
+ this["dateCreated"] = assign("dateCreated");
+ this["dateUpdated"] = assign("dateUpdated");
+ this["revision"] = assign("revision");
+ this["accountId"] = assign("accountId");
+ this["applicationId"] = assign("applicationId");
+ this["alias"] = assign("alias");
+ this["voiceUrl"] = assign("voiceUrl");
+ this["voiceFallbackUrl"] = assign("voiceFallbackUrl");
+ this["callConnectUrl"] = assign("callConnectUrl");
+ this["statusCallbackUrl"] = assign("statusCallbackUrl");
+ this["smsUrl"] = assign("smsUrl");
+ this["smsFallbackUrl"] = assign("smsFallbackUrl");
}
}
diff --git a/models/AvailableNumber.ts b/models/AvailableNumber.ts
index 612efba..6c4e89f 100644
--- a/models/AvailableNumber.ts
+++ b/models/AvailableNumber.ts
@@ -122,30 +122,20 @@ export class AvailableNumber {
}
public constructor(args: ArgumentsType) {
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- AvailableNumber.attributeTypeMap.find((attr) => attr.name === attribute)
- ?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : AvailableNumber.attributeTypeMap.find(
+ (attr) => attr.name === attribute,
+ )?.defaultValue
+ ) as T;
};
- if (args["capabilities"]) {
- this["capabilities"] = assign("capabilities");
- }
- if (args["campaignId"]) {
- this["campaignId"] = assign("campaignId");
- }
- if (args["phoneNumber"]) {
- this["phoneNumber"] = assign("phoneNumber");
- }
- if (args["voiceEnabled"]) {
- this["voiceEnabled"] = assign("voiceEnabled");
- }
- if (args["smsEnabled"]) {
- this["smsEnabled"] = assign("smsEnabled");
- }
- if (args["region"]) {
- this["region"] = assign("region");
- }
- if (args["country"]) {
- this["country"] = assign("country");
- }
+ this["capabilities"] = assign("capabilities");
+ this["campaignId"] = assign("campaignId");
+ this["phoneNumber"] = assign("phoneNumber");
+ this["voiceEnabled"] = assign("voiceEnabled");
+ this["smsEnabled"] = assign("smsEnabled");
+ this["region"] = assign("region");
+ this["country"] = assign("country");
}
}
diff --git a/models/AvailableNumberList.ts b/models/AvailableNumberList.ts
index ff7a942..31a5558 100644
--- a/models/AvailableNumberList.ts
+++ b/models/AvailableNumberList.ts
@@ -135,36 +135,23 @@ export class AvailableNumberList {
}
public constructor(args: ArgumentsType) {
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- AvailableNumberList.attributeTypeMap.find(
- (attr) => attr.name === attribute,
- )?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : AvailableNumberList.attributeTypeMap.find(
+ (attr) => attr.name === attribute,
+ )?.defaultValue
+ ) as T;
};
- if (args["total"]) {
- this["total"] = assign("total");
- }
- if (args["start"]) {
- this["start"] = assign("start");
- }
- if (args["end"]) {
- this["end"] = assign("end");
- }
- if (args["page"]) {
- this["page"] = assign("page");
- }
- if (args["numPages"]) {
- this["numPages"] = assign("numPages");
- }
- if (args["pageSize"]) {
- this["pageSize"] = assign("pageSize");
- }
- if (args["nextPageUri"]) {
- this["nextPageUri"] = assign("nextPageUri");
- }
- if (args["availablePhoneNumbers"]) {
- this["availablePhoneNumbers"] = assign>(
- "availablePhoneNumbers",
- );
- }
+ this["total"] = assign("total");
+ this["start"] = assign("start");
+ this["end"] = assign("end");
+ this["page"] = assign("page");
+ this["numPages"] = assign("numPages");
+ this["pageSize"] = assign("pageSize");
+ this["nextPageUri"] = assign("nextPageUri");
+ this["availablePhoneNumbers"] = assign>(
+ "availablePhoneNumbers",
+ );
}
}
diff --git a/models/BuyIncomingNumberRequest.ts b/models/BuyIncomingNumberRequest.ts
index 88b0632..85e1544 100644
--- a/models/BuyIncomingNumberRequest.ts
+++ b/models/BuyIncomingNumberRequest.ts
@@ -72,19 +72,16 @@ export class BuyIncomingNumberRequest {
}
public constructor(args: ArgumentsType) {
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- BuyIncomingNumberRequest.attributeTypeMap.find(
- (attr) => attr.name === attribute,
- )?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : BuyIncomingNumberRequest.attributeTypeMap.find(
+ (attr) => attr.name === attribute,
+ )?.defaultValue
+ ) as T;
};
- if (args["phoneNumber"]) {
- this["phoneNumber"] = assign("phoneNumber");
- }
- if (args["alias"]) {
- this["alias"] = assign("alias");
- }
- if (args["applicationId"]) {
- this["applicationId"] = assign("applicationId");
- }
+ this["phoneNumber"] = assign("phoneNumber");
+ this["alias"] = assign("alias");
+ this["applicationId"] = assign("applicationId");
}
}
diff --git a/models/CallControlWebhook.ts b/models/CallControlWebhook.ts
index 4769794..92941ac 100644
--- a/models/CallControlWebhook.ts
+++ b/models/CallControlWebhook.ts
@@ -106,26 +106,19 @@ export class CallControlWebhook extends Webhook {
public constructor(args: ArgumentsType) {
super({ requestType: "callControl" });
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- CallControlWebhook.attributeTypeMap.find(
- (attr) => attr.name === attribute,
- )?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : CallControlWebhook.attributeTypeMap.find(
+ (attr) => attr.name === attribute,
+ )?.defaultValue
+ ) as T;
};
- if (args["requestType"]) {
- this["requestType"] = assign("requestType");
- }
- if (args["callId"]) {
- this["callId"] = assign("callId");
- }
- if (args["accountId"]) {
- this["accountId"] = assign("accountId");
- }
- if (args["conferenceId"]) {
- this["conferenceId"] = assign("conferenceId");
- }
- if (args["digits"]) {
- this["digits"] = assign("digits");
- }
+ this["requestType"] = assign("requestType");
+ this["callId"] = assign("callId");
+ this["accountId"] = assign("accountId");
+ this["conferenceId"] = assign("conferenceId");
+ this["digits"] = assign("digits");
}
public static deserialize(payload: string): CallControlWebhook {
return new CallControlWebhook(JSON.parse(payload));
diff --git a/models/CallList.ts b/models/CallList.ts
index e42f8ea..b211c8a 100644
--- a/models/CallList.ts
+++ b/models/CallList.ts
@@ -135,33 +135,20 @@ export class CallList {
}
public constructor(args: ArgumentsType) {
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- CallList.attributeTypeMap.find((attr) => attr.name === attribute)
- ?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : CallList.attributeTypeMap.find((attr) => attr.name === attribute)
+ ?.defaultValue
+ ) as T;
};
- if (args["total"]) {
- this["total"] = assign("total");
- }
- if (args["start"]) {
- this["start"] = assign("start");
- }
- if (args["end"]) {
- this["end"] = assign("end");
- }
- if (args["page"]) {
- this["page"] = assign("page");
- }
- if (args["numPages"]) {
- this["numPages"] = assign("numPages");
- }
- if (args["pageSize"]) {
- this["pageSize"] = assign("pageSize");
- }
- if (args["nextPageUri"]) {
- this["nextPageUri"] = assign("nextPageUri");
- }
- if (args["calls"]) {
- this["calls"] = assign>("calls");
- }
+ this["total"] = assign("total");
+ this["start"] = assign("start");
+ this["end"] = assign("end");
+ this["page"] = assign("page");
+ this["numPages"] = assign("numPages");
+ this["pageSize"] = assign("pageSize");
+ this["nextPageUri"] = assign("nextPageUri");
+ this["calls"] = assign>("calls");
}
}
diff --git a/models/CallResult.ts b/models/CallResult.ts
index f9ab984..1797718 100644
--- a/models/CallResult.ts
+++ b/models/CallResult.ts
@@ -287,69 +287,32 @@ export class CallResult {
}
public constructor(args: ArgumentsType) {
const assign = (attribute: keyof ArgumentsType): T => {
- return (args[attribute] ??
- CallResult.attributeTypeMap.find((attr) => attr.name === attribute)
- ?.defaultValue) as T;
+ return (
+ args.hasOwnProperty(attribute)
+ ? args[attribute]
+ : CallResult.attributeTypeMap.find((attr) => attr.name === attribute)
+ ?.defaultValue
+ ) as T;
};
- if (args["uri"]) {
- this["uri"] = assign("uri");
- }
- if (args["dateCreated"]) {
- this["dateCreated"] = assign("dateCreated");
- }
- if (args["dateUpdated"]) {
- this["dateUpdated"] = assign("dateUpdated");
- }
- if (args["revision"]) {
- this["revision"] = assign("revision");
- }
- if (args["callId"]) {
- this["callId"] = assign("callId");
- }
- if (args["parentCallId"]) {
- this["parentCallId"] = assign("parentCallId");
- }
- if (args["accountId"]) {
- this["accountId"] = assign("accountId");
- }
- if (args["from"]) {
- this["from"] = assign("from");
- }
- if (args["to"]) {
- this["to"] = assign("to");
- }
- if (args["phoneNumberId"]) {
- this["phoneNumberId"] = assign("phoneNumberId");
- }
- if (args["callStatus"]) {
- this["callStatus"] = assign("callStatus");
- }
- if (args["startTime"]) {
- this["startTime"] = assign("startTime");
- }
- if (args["connectTime"]) {
- this["connectTime"] = assign("connectTime");
- }
- if (args["endTime"]) {
- this["endTime"] = assign("endTime");
- }
- if (args["duration"]) {
- this["duration"] = assign("duration");
- }
- if (args["connectDuration"]) {
- this["connectDuration"] = assign("connectDuration");
- }
- if (args["direction"]) {
- this["direction"] = assign("direction");
- }
- if (args["answeredBy"]) {
- this["answeredBy"] = assign("answeredBy");
- }
- if (args["subresourceUris"]) {
- this["subresourceUris"] = assign("subresourceUris");
- }
- if (args["applicationId"]) {
- this["applicationId"] = assign("applicationId");
- }
+ this["uri"] = assign("uri");
+ this["dateCreated"] = assign("dateCreated");
+ this["dateUpdated"] = assign("dateUpdated");
+ this["revision"] = assign("revision");
+ this["callId"] = assign("callId");
+ this["parentCallId"] = assign("parentCallId");
+ this["accountId"] = assign("accountId");
+ this["from"] = assign("from");
+ this["to"] = assign("to");
+ this["phoneNumberId"] = assign("phoneNumberId");
+ this["callStatus"] = assign("callStatus");
+ this["startTime"] = assign("startTime");
+ this["connectTime"] = assign