Project Name - da-tf-project-1-1b0f Environment - beta Service Name - rightleads-v2-api-beta Build Id - 840aed62-f469-4763-81c7-948098a240b2 Executed Time - Tue Apr 2 13:47:35 UTC 2024 ------------------------------------------------ > rightleads-v2-api@0.0.0 nyc:test-unit > nyc mocha automation-test-cases/unit-test-case/**/*.spec.js AccountModel findAll ✔ should call Account.findAll with the correct arguments getOne ✔ should call Account.findOne with the correct arguments countWithFilters ✔ should call Account.count with the correct arguments countWithInclusionFilters ✔ should call Account.count with the correct arguments include ✔ should return the correct include array when includeHeadOffice is false ✔ should return the correct include array when includeHeadOffice is true select ✔ should return the correct select array getSqlQueryOfFindAll ✔ should call Account.findAll with the correct arguments and return the SQL query deleteAccount ✔ should call Account.destroy with the correct arguments ClientModel addUserToClient when add a user to a client successfully ✔ should add a user to a client addClient when add a new client successfully ✔ should add a new client removeUserFromClient when remove a user from a client successfully ✔ should remove a user from a client getOne when get a client by ID successfully ✔ should get a client by ID findAndCountAll when find and count all clients successfully ✔ should find and count all clients deleteClient when delete a client successfully ✔ should delete a client getOneClientUser when get one client user successfully ✔ should get one client user getOneClient when get one client successfully ✔ should get one client findClientUser when find client users successfully ✔ should find client users findUserClient when find user clients successfully ✔ should find user clients findClientUserMap when find client user maps successfully ✔ should find client user maps filter when filter by attribute successfully ✔ should filter by name when name is provided ✔ should filter by id when id is provided as a single value ✔ should filter by id when id is provided as an array ✔ should filter by pseudoName when pseudoName is provided ✔ should return empty object when no filter parameters are provided validate when validate client data successfully ✔ should validate client data when validate client data throws error ✔ should throw an error for invalid client data findOneClient when find one client based on query sucessfully ✔ should find one client based on query update when update a client sucessfully ✔ should update a client ContactModel ✔ should get one contact ✔ should find all contacts ✔ should log and process the SQL query ✔ should get SQL query of find all contacts ✔ should filter contacts ✔ should include account with inclusion ✔ should include account without list ✔ should include ✔ should select attributes ✔ should count with account filter ✔ should count with filters ✔ should count with inclusion filters ✔ should filter contacts by industry ✔ should filter contacts by NAICS code ✔ should ensure query.naicsCode is an array if it is not already ✔ should ensure query.industry is an array if it is not already ✔ should ensure query.sicCode is an array if it is not already ✔ should ensure query.revenueRange is an array if it is not already ✔ should ensure query.employeeRange is an array if it is not already ✔ should ensure query.subIndustry is an array if it is not already ✔ should filter contacts by sub-industry ✔ should delete a contact FileModel ✔ should create a file ✔ should get file by job id ✔ should get file by id ✔ should delete a file FileModel Singleton ✔ should return the same instance JobModel ✔ should create a job ✔ should find and count all jobs ✔ should find job by primary key ✔ should get job by id ✔ should filter jobs based on query ✔ should include related entities based on query with single file attribute ✔ should throw validation error when validation fails ✔ should include related entities based on query ✔ should validate a job ✔ should delete a job ListModel ✔ should find and count all lists ✔ should get list ✔ should find list by primary key ✔ should filter lists based on query ✔ should throw validation error when validation fails ✔ should include users in the list ✔ should validate a list ✔ should create a list ✔ should update a list ✔ should delete a list UserModel ✔ should update a user ✔ should get one user ✔ should find and count all users ✔ should filter users based on params ✔ should filter users based on params with single id ✔ should throw validation error when validation fails ✔ should validate a user Array Utility Functions filterArrayByKey should be filter Array By Key sucessfully ✔ should return the filtered array based on the specified key and search term ✔ should return the original array if any required parameter is missing ✔ should return the original array if the array is not provided filterArrayByValue should be filter Array By Value sucessfully ✔ should return the filtered array based on the specified value ✔ should return the original array if any required parameter is missing ✔ should return the original array if the array is not provided addIndexToArray should be add Index To Array sucessfully ✔ should add index to each item in the array ✔ should return an empty array if the array is not provided mergeArrays should be merge Arrays sucessfully ✔ should merge arrays when a key is provided ✔ should return an empty array when no key is provided ✔ should return an empty array if data is not provided #authJwt getVerifiedJWT - verified a jwt verified jwt successfully ✔ should verify jwt successfully should getVerifiedJWT throws error ✔ should jsonwebtoken decode gives error ✔ should json sign gives error Utils/date isValidDate Checking is date is valid or not ✔ should not throw an error for a valid date Getting error while validating date ✔ should throw a BadRequest error for an invalid date downloadService ✔ should make a POST request to download service with provided fileId and sqlQuery downloadEnqueue ✔ should create a task and log info when successful ✔ should log error and rethrow when task creation fails Utility Functions isPositiveInteger should be check isPositiveInteger sucessfully ✔ should return true for positive integers ✔ should return false for non-integer numbers ✔ should return false for zero and negative integers ✔ should return false for non-numeric values getUniqueNumber should get unique number sucessfully ✔ should return a unique number object utilty deepFreeze should deep freeze sucessfully ✔ should deeply freeze an object sortArraysInObject should sort array by object sucessfully ✔ should sort arrays of numbers ✔ should sort arrays of strings ✔ should not modify non-array properties hasAllKeys should return hasAllKeys sucessfully ✔ should return true if object has all keys ✔ should return false if object does not have all keys Test Suite parseLimitAndOffset ✔ should return default limit and offset if no query parameters are provided ✔ should throw an error if page is not a positive integer ✔ should throw an error if limit is not a positive integer unmarshalBody ✔ should return the body if it is not empty ✔ should throw an error if body is empty parseSelectFields ✔ should return undefined when fields is not provided ✔ should return undefined when fields is an empty string ✔ should return undefined when no allowed fields are selected ✔ should return an array of allowed fields when fields is a string ✔ should return an array of allowed fields when fields is an array parseFilterQueries ✔ should return where object as is if queryParams is falsy ✔ should apply OR conditions correctly ✔ should apply AND conditions correctly ✔ should handle a mix of AND and OR conditions createSequelizeOrder ✔ should return an empty array if no order parameters are provided ✔ should return a correctly formatted order array for ascending order ✔ should return a correctly formatted order array for descending order ✔ should return a correctly formatted order array for both ascending and descending order String Utility Functions isEmptyString ✔ should correctly identify empty strings isString ✔ should correctly identify strings isNonEmptyString ✔ should correctly identify non-empty strings validateStringLength should validate string length sucessfully ✔ should throw error for string length less than minimum length ✔ should throw error for string length more than maximum length should validate string length and error occur ✔ should validate string length within range ✔ should handle empty strings correctly replaceAndWithAmpersand ✔ should replace "and" with "&" removeExtraSpaces ✔ should remove extra spaces trimSpaceFromObject should trim Space From Object sucessfully ✔ should return if no object or fieldArray is provided ✔ should handle non-array fieldArray inputs ✔ should skip non-existent fields ✔ should trim spaces from object fields should trim Space From Object gives error ✔ should throw error if field value is not a string Utility Functions flattenZodError ✔ should flatten Zod error object correctly ✔ should return an empty string if no errors are provided generateOTP ✔ should generate an OTP of specified length ✔ should generate a default 6-digit OTP if length is not provided tryCatchJsonify ✔ should return value and error as null when function executes successfully ✔ should return value as null and error message when function throws an error UUID module tests validateUuid-validate a uuid validate a uuid successfully ✔ should validate a correct UUID with empty entityName ✔ should validate a correct UUID with non-empty entityName should throw error while validating uuid ✔ should throw an error for an incorrect UUID ✔ should throw an error for an incorrect UUID validateUuidInArray-validate a uuid in array validate a uuid in array successfully ✔ should validate a single UUID not in an array ✔ should validate a correct UUID array with empty entityName ✔ should validate a correct UUID array should throw error while validating uuid in array ✔ should throw an error for an incorrect UUID in array ✔ should throw an error for an incorrect UUID in array isUuidValid-checking uuid is valid should checking uuid successfully ✔ should correctly check if a UUID is valid generateShortUUID-genrating a short uuid should generating a short uuid successfully ✔ should generate a short UUID 162 passing (211ms) ---------------------------------------|---------|----------|---------|---------|------------------- File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ---------------------------------------|---------|----------|---------|---------|------------------- All files | 97.03 | 80.05 | 97.57 | 97.07 | app/configs/settings | 91.89 | 50 | 100 | 91.89 | main.config.js | 100 | 100 | 100 | 100 | settings-config.js | 89.65 | 50 | 100 | 89.65 | 8,24,32 settings.config.beta.js | 100 | 100 | 100 | 100 | app/constant | 100 | 100 | 100 | 100 | constants.js | 100 | 100 | 100 | 100 | app/lib | 100 | 100 | 100 | 100 | auth0Client.js | 100 | 100 | 100 | 100 | app/models | 96.01 | 75.35 | 96.2 | 96.2 | account-model.js | 92.85 | 95.83 | 90 | 92.85 | 7,139 client-model.js | 97.91 | 90 | 100 | 97.87 | 8 contact-model.js | 99.2 | 77.09 | 100 | 99.17 | 10 file-model.js | 64.7 | 50 | 71.42 | 68.75 | 6,23-27 job-model.js | 97.5 | 59.09 | 100 | 97.43 | 8 list-model.js | 96.96 | 50 | 100 | 96.87 | 7 user-model.js | 97.05 | 57.14 | 100 | 96.96 | 8 app/utils | 89.88 | 83.87 | 93.18 | 89.72 | array.js | 100 | 88.23 | 100 | 100 | 8,17 authJwt.js | 27.27 | 0 | 33.33 | 27.27 | 6-38,50-57 date.js | 100 | 100 | 100 | 100 | deepFreeze.js | 100 | 100 | 100 | 100 | download-service.js | 100 | 50 | 100 | 100 | 30 number.js | 100 | 100 | 100 | 100 | object.js | 100 | 90.9 | 100 | 100 | 24 request.js | 100 | 95.83 | 100 | 100 | 57-61 string.js | 95.55 | 91.66 | 100 | 95.34 | 32,35 util.js | 94.73 | 100 | 85.71 | 100 | uuid.js | 100 | 100 | 100 | 100 | ...n-test-cases/unit-test-case/models | 99.49 | 100 | 100 | 99.49 | accountModel.spec.js | 100 | 100 | 100 | 100 | clientModel.spec.js | 100 | 100 | 100 | 100 | contactModel.spec.js | 100 | 100 | 100 | 100 | fileModel.spec.js | 100 | 100 | 100 | 100 | jobModel.spec.js | 98.63 | 100 | 100 | 98.63 | 79 listModel.spec.js | 98.63 | 100 | 100 | 98.63 | 64 userModel.spec.js | 98.14 | 100 | 100 | 98.14 | 75 ...on-test-cases/unit-test-case/utils | 98.97 | 100 | 97.23 | 98.92 | array.spec.js | 100 | 100 | 100 | 100 | authJwt.spec.js | 90.74 | 100 | 68.75 | 90.74 | 45,61,70,89,98 date.spec.js | 100 | 100 | 100 | 100 | downloadService.spec.js | 100 | 100 | 100 | 100 | number.spec.js | 100 | 100 | 100 | 100 | object.spec.js | 100 | 100 | 100 | 100 | request.spec.js | 100 | 100 | 100 | 100 | string.spec.js | 100 | 100 | 100 | 100 | util.spec.js | 100 | 100 | 100 | 100 | uuid.spec.js | 100 | 100 | 100 | 100 | ---------------------------------------|---------|----------|---------|---------|-------------------