Skip to content

Merge pull request #94 from mbc-net/develop #10

Merge pull request #94 from mbc-net/develop

Merge pull request #94 from mbc-net/develop #10

GitHub Actions / Unit Tests Reporter succeeded Dec 6, 2024 in 0s

110 passed, 0 failed and 0 skipped

Tests passed successfully

✅ report/unit.xml

110 tests were completed in 20s with 110 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
CommandService 13✅ 2s
DataSyncCommandSfnEventHandler 13✅ 13s
DataSyncCommandSfnEventHandler 2✅ 2s
DataSyncNewCommandEventHandler 1✅ 1s
DynamoDbService 12✅ 12s
DynamoDbService 3✅ 1s
EventBus 2✅ 1s
ExplorerService 5✅ 1s
getPackageVersion 2✅ 1s
isLatestCli 2✅ 1s
mergeDeep 13✅ 1s
newAction 3✅ 1s
RequestLogger.getLogLevels 6✅ 996ms
RolesGuard 4✅ 1s
SequencesService 23✅ 13s
updateEnvLocal 2✅ 1s
usePackageVersion 4✅ 4s

✅ CommandService

CommandService getLatestItem should return latest item
  ✅ CommandService getLatestItem should return latest item
CommandService getLatestItem should return null when data not have key
  ✅ CommandService getLatestItem should return null when data not have key
CommandService publishPartialUpdateAsync should update with the latest item
  ✅ CommandService publishPartialUpdateAsync should update with the latest item
CommandService publishPartialUpdateAsync should raise error with the non-existent item
  ✅ CommandService publishPartialUpdateAsync should raise error with the non-existent item
CommandService isNotCommandDirty should return true if command is not dirty
  ✅ CommandService isNotCommandDirty should return true if command is not dirty
CommandService isNotCommandDirty should return false if command is dirty
  ✅ CommandService isNotCommandDirty should return false if command is dirty
CommandService isNotCommandDirty should return true if input attributes is class instance
  ✅ CommandService isNotCommandDirty should return true if input attributes is class instance
CommandService isNotCommandDirty should return false if input attributes is class instance and not dirty
  ✅ CommandService isNotCommandDirty should return false if input attributes is class instance and not dirty
CommandService publishPartialUpdateSync should update with the latest version item
  ✅ CommandService publishPartialUpdateSync should update with the latest version item
CommandService publishPartialUpdateSync should raise error with invalid version
  ✅ CommandService publishPartialUpdateSync should raise error with invalid version
CommandService publishPartialUpdateSync should raise error with item not found
  ✅ CommandService publishPartialUpdateSync should raise error with item not found
CommandService publishSync should update with the latest version item
  ✅ CommandService publishSync should update with the latest version item
CommandService publishSync should raise error with invalid input version
  ✅ CommandService publishSync should raise error with invalid input version

✅ DataSyncCommandSfnEventHandler

DataSyncCommandSfnEventHandler execute should return result = 0 when executing the correct check version event
  ✅ DataSyncCommandSfnEventHandler execute should return result = 0 when executing the correct check version event
DataSyncCommandSfnEventHandler execute should return result = 1 when executing the correct check version event and the data is not stable
  ✅ DataSyncCommandSfnEventHandler execute should return result = 1 when executing the correct check version event and the data is not stable
DataSyncCommandSfnEventHandler execute should return result = -1 when executing the stale check version event 
  ✅ DataSyncCommandSfnEventHandler execute should return result = -1 when executing the stale check version event
DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct check version event
  ✅ DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct check version event
DataSyncCommandSfnEventHandler execute should return result = ok when executing the correct history copy event
  ✅ DataSyncCommandSfnEventHandler execute should return result = ok when executing the correct history copy event
DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct history copy event
  ✅ DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct history copy event
DataSyncCommandSfnEventHandler execute should return the array of handlers when executing the correct transform data event
  ✅ DataSyncCommandSfnEventHandler execute should return the array of handlers when executing the correct transform data event
DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct transform data event
  ✅ DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct transform data event
DataSyncCommandSfnEventHandler execute should throw not found handler error when executing the sync data event
  ✅ DataSyncCommandSfnEventHandler execute should throw not found handler error when executing the sync data event
DataSyncCommandSfnEventHandler execute should throw empty handler error when executing the sync data event
  ✅ DataSyncCommandSfnEventHandler execute should throw empty handler error when executing the sync data event
DataSyncCommandSfnEventHandler execute should call handler up when executing the correct sync data event
  ✅ DataSyncCommandSfnEventHandler execute should call handler up when executing the correct sync data event
DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct sync data event
  ✅ DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct sync data event
DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the finish data event
  ✅ DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the finish data event

✅ DataSyncCommandSfnEventHandler

DataSyncCommandSfnEventHandler execute should be call event with the correct event and handler
  ✅ DataSyncCommandSfnEventHandler execute should be call event with the correct event and handler
DataSyncCommandSfnEventHandler execute should not be call event with the wrong handler
  ✅ DataSyncCommandSfnEventHandler execute should not be call event with the wrong handler

✅ DataSyncNewCommandEventHandler

DataSyncNewCommandEventHandler should trigger step function with the correct start command
  ✅ DataSyncNewCommandEventHandler should trigger step function with the correct start command

✅ DynamoDbService

DynamoDbService get should return the dynamodb client
  ✅ DynamoDbService get should return the dynamodb client
DynamoDbService putItem should send PutItemCommand with the origin data
  ✅ DynamoDbService putItem should send PutItemCommand with the origin data
DynamoDbService putItem should send a PutItemCommand with the data and store the attribute in S3
  ✅ DynamoDbService putItem should send a PutItemCommand with the data and store the attribute in S3
DynamoDbService getItem should send GetItemCommand
  ✅ DynamoDbService getItem should send GetItemCommand
DynamoDbService getItem should return the data
  ✅ DynamoDbService getItem should return the data
DynamoDbService getItem should get the attribute data from s3 and return the data
  ✅ DynamoDbService getItem should get the attribute data from s3 and return the data
DynamoDbService updateItem should return updated attributes
  ✅ DynamoDbService updateItem should return updated attributes
DynamoDbService updateItem should send UpdateItemCommand
  ✅ DynamoDbService updateItem should send UpdateItemCommand
DynamoDbService listItemsByPk should return data
  ✅ DynamoDbService listItemsByPk should return data
DynamoDbService listItemsByPk should send QueryCommand
  ✅ DynamoDbService listItemsByPk should send QueryCommand
DynamoDbService listAllItems should return data
  ✅ DynamoDbService listAllItems should return data
DynamoDbService listAllItems should send ScanCommand
  ✅ DynamoDbService listAllItems should send ScanCommand

✅ DynamoDbService

DynamoDbService get should return the dynamodb client
  ✅ DynamoDbService get should return the dynamodb client
DynamoDbService getItem should retrieve data from s3 and return it
  ✅ DynamoDbService getItem should retrieve data from s3 and return it
DynamoDbService putItem should upload data to s3
  ✅ DynamoDbService putItem should upload data to s3

✅ EventBus

EventBus should execute event correctly
  ✅ EventBus should execute event correctly
EventBus should throw not found error
  ✅ EventBus should throw not found error

✅ ExplorerService

ExplorerService explore should discover event handler correctly
  ✅ ExplorerService explore should discover event handler correctly
ExplorerService explore should be defined
  ✅ ExplorerService explore should be defined
ExplorerService explore should discover event factory correctly
  ✅ ExplorerService explore should discover event factory correctly
ExplorerService exploreDataSyncHandlers should discover data sync handler correctly
  ✅ ExplorerService exploreDataSyncHandlers should discover data sync handler correctly
ExplorerService exploreDataSyncHandlers should return no data sync handler
  ✅ ExplorerService exploreDataSyncHandlers should return no data sync handler

✅ getPackageVersion

getPackageVersion should return the latest version when isLatest is true
  ✅ getPackageVersion should return the latest version when isLatest is true
getPackageVersion should return all versions when isLatest is false
  ✅ getPackageVersion should return all versions when isLatest is false

✅ isLatestCli

isLatestCli should return true if the current version matches the latest version
  ✅ isLatestCli should return true if the current version matches the latest version
isLatestCli should return false if the current version does not match the latest version
  ✅ isLatestCli should return false if the current version does not match the latest version

✅ mergeDeep

mergeDeep should merge two objects
  ✅ mergeDeep should merge two objects
mergeDeep should merge deeply nested objects
  ✅ mergeDeep should merge deeply nested objects
mergeDeep should merge 3 nested objects
  ✅ mergeDeep should merge 3 nested objects
mergeDeep should return the target object when no sources are provided
  ✅ mergeDeep should return the target object when no sources are provided
mergeDeep should deep merge two objects
  ✅ mergeDeep should deep merge two objects
mergeDeep should deep merge multiple objects
  ✅ mergeDeep should deep merge multiple objects
mergeDeep should handle primitive values
  ✅ mergeDeep should handle primitive values
objectBytes should calculate the object bytes
  ✅ objectBytes should calculate the object bytes
objectBytes should return the correct byte length for an empty object
  ✅ objectBytes should return the correct byte length for an empty object
objectBytes should return the correct byte length for an object with properties
  ✅ objectBytes should return the correct byte length for an object with properties
objectBytes should return the correct byte length for an object with nested objects
  ✅ objectBytes should return the correct byte length for an object with nested objects
isObject should check if an object is an object
  ✅ isObject should check if an object is an object
isObject should check if an object is not an object
  ✅ isObject should check if an object is not an object

✅ newAction

newAction should generate a project with the latest version when version is not specified
  ✅ newAction should generate a project with the latest version when version is not specified
newAction should use a specific version if specified
  ✅ newAction should use a specific version if specified
newAction should throw an error for an invalid version
  ✅ newAction should throw an error for an invalid version

✅ RequestLogger.getLogLevels

RequestLogger.getLogLevels should return all log levels
  ✅ RequestLogger.getLogLevels should return all log levels
RequestLogger.getLogLevels should return log levels from debug
  ✅ RequestLogger.getLogLevels should return log levels from debug
RequestLogger.getLogLevels should return log levels from info
  ✅ RequestLogger.getLogLevels should return log levels from info
RequestLogger.getLogLevels should return log levels from warn
  ✅ RequestLogger.getLogLevels should return log levels from warn
RequestLogger.getLogLevels should return log levels from error
  ✅ RequestLogger.getLogLevels should return log levels from error
RequestLogger.getLogLevels should return log levels from fatal
  ✅ RequestLogger.getLogLevels should return log levels from fatal

✅ RolesGuard

RolesGuard should return false if tenant code does not exist
  ✅ RolesGuard should return false if tenant code does not exist
RolesGuard should return true if the user has the system admin role
  ✅ RolesGuard should return true if the user has the system admin role
RolesGuard should return true if the user has the user role
  ✅ RolesGuard should return true if the user has the user role
RolesGuard should return false if the user has only the user role
  ✅ RolesGuard should return false if the user has only the user role

✅ SequencesService

SequencesService should be defined
  ✅ SequencesService should be defined
SequencesService should get table name on initialization
  ✅ SequencesService should get table name on initialization
SequencesService getCurrentSequence should call getItem with correct parameters and return the result
  ✅ SequencesService getCurrentSequence should call getItem with correct parameters and return the result
SequencesService generateSequenceItem should call generateSequenceItem with none rotation
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with none rotation
SequencesService generateSequenceItem should call generateSequenceItem with none rotation at second time
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with none rotation at second time
SequencesService generateSequenceItem should call generateSequenceItem with fiscal yearly rotation
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with fiscal yearly rotation
SequencesService generateSequenceItem should call generateSequenceItem with fiscal yearly rotation, argument is a fiscal year that is the same as the previous fiscal year
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with fiscal yearly rotation, argument is a fiscal year that is the same as the previous fiscal year
SequencesService generateSequenceItem should call generateSequenceItem with fiscal yearly rotation, argument is a fiscal year other than the previous fiscal year
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with fiscal yearly rotation, argument is a fiscal year other than the previous fiscal year
SequencesService generateSequenceItem should call generateSequenceItem with yearly rotation
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with yearly rotation
SequencesService generateSequenceItem should call generateSequenceItem with  yearly rotation, argument is a  year that is the same as the previous year
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with  yearly rotation, argument is a  year that is the same as the previous year
SequencesService generateSequenceItem should call generateSequenceItem with  yearly rotation, argument is a  year other than the previous  year
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with  yearly rotation, argument is a  year other than the previous  year
SequencesService generateSequenceItem should call generateSequenceItem with monthly rotation
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with monthly rotation
SequencesService generateSequenceItem should call generateSequenceItem with monthly rotation, argument is a month other than the previous month
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with monthly rotation, argument is a month other than the previous month
SequencesService generateSequenceItem should call generateSequenceItem with monthly rotation, argument is a month that is the same as the previous month
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with monthly rotation, argument is a month that is the same as the previous month
SequencesService generateSequenceItem should call generateSequenceItem with daily rotation 
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with daily rotation
SequencesService generateSequenceItem should call generateSequenceItem with daily rotation, argument is a day other than the previous day
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with daily rotation, argument is a day other than the previous day
SequencesService generateSequenceItem should call generateSequenceItem with daily rotation, the argument is a day that is the same as the previous day
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with daily rotation, the argument is a day that is the same as the previous day
SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  the arguments have code 1, code 2, code 3, code4, code5 
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  the arguments have code 1, code 2, code 3, code4, code5
SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  format is %%code1%%-%%fiscal_year%%-%%no%%
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  format is %%code1%%-%%fiscal_year%%-%%no%%
SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  format is %%code1%%-%%month%%-%%no%%
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  format is %%code1%%-%%month%%-%%no%%
SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  format is %%code1%%-%%day%%-%%no%%
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  format is %%code1%%-%%day%%-%%no%%
SequencesService generateSequenceItem should call generateSequenceItem with register date,  format is %%code1%%-%%fiscal_year%%-%%no%%
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with register date,  format is %%code1%%-%%fiscal_year%%-%%no%%
SequencesService generateSequenceItem should call generateSequenceItem with minimum parameters
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with minimum parameters

✅ updateEnvLocal

updateEnvLocal should update the specified value in the .env.local file
  ✅ updateEnvLocal should update the specified value in the .env.local file
updateEnvLocal should not change the file content if searchValue is not found
  ✅ updateEnvLocal should not change the file content if searchValue is not found

✅ usePackageVersion

usePackageVersion it should update deps
  ✅ usePackageVersion it should update deps
usePackageVersion it should not update name
  ✅ usePackageVersion it should not update name
usePackageVersion it should not update name with empty name
  ✅ usePackageVersion it should not update name with empty name
usePackageVersion it should update name
  ✅ usePackageVersion it should update name