Skip to content

Merge pull request #65 from mbc-net/dependabot/npm_and_yarn/packages/… #3

Merge pull request #65 from mbc-net/dependabot/npm_and_yarn/packages/…

Merge pull request #65 from mbc-net/dependabot/npm_and_yarn/packages/… #3

GitHub Actions / Unit Tests Reporter succeeded Nov 24, 2024 in 0s

107 passed, 0 failed and 0 skipped

Tests passed successfully

✅ report/unit.xml

107 tests were completed in 16s with 107 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
CommandService 8✅ 2s
DataSyncCommandSfnEventHandler 13✅ 12s
DataSyncCommandSfnEventHandler 2✅ 2s
DataSyncNewCommandEventHandler 1✅ 1s
DynamoDbService 12✅ 10s
DynamoDbService 3✅ 2s
EventBus 2✅ 929ms
ExplorerService 5✅ 691ms
getPackageVersion 2✅ 472ms
isLatestCli 2✅ 421ms
mergeDeep 13✅ 623ms
newAction 3✅ 638ms
RequestLogger.getLogLevels 6✅ 522ms
RolesGuard 4✅ 710ms
SequencesService 27✅ 11s
usePackageVersion 4✅ 3s

✅ 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 publishPartialUpdate should update with the latest item
  ✅ CommandService publishPartialUpdate should update with the latest item
CommandService publishPartialUpdate should raise error with the non-existent item
  ✅ CommandService publishPartialUpdate 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 atributes is class instance
  ✅ CommandService isNotCommandDirty should return true if input atributes is class instance
CommandService isNotCommandDirty should return false if input atributes is class instance and not dirty
  ✅ CommandService isNotCommandDirty should return false if input atributes is class instance and not dirty

✅ 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 should calculate the fiscal year using default start month (April) and reference year 1953
  ✅ SequencesService should calculate the fiscal year using default start month (April) and reference year 1953
SequencesService should calculate the fiscal year using a custom start month (July)
  ✅ SequencesService should calculate the fiscal year using a custom start month (July)
SequencesService should calculate the fiscal year using a custom register time (2020)
  ✅ SequencesService should calculate the fiscal year using a custom register time (2020)
SequencesService should calculate the fiscal year using a custom register time and start month (July)
  ✅ SequencesService should calculate the fiscal year using a custom register time and start month (July)
SequencesService should handle the case where now is exactly the start of the fiscal year
  ✅ SequencesService should handle the case where now is exactly the start of the fiscal year
SequencesService should handle the case where now is just before the fiscal year starts
  ✅ SequencesService should handle the case where now is just before the fiscal year starts
SequencesService should calculate the fiscal year when now is after the fiscal year start, but before the start month
  ✅ SequencesService should calculate the fiscal year when now is after the fiscal year start, but before the start month
SequencesService should return a negative fiscal year when registerTime is in the future
  ✅ SequencesService should return a negative fiscal year when registerTime is in the future
SequencesService should return fiscal year 1 when now and registerTime fall within the same fiscal year
  ✅ SequencesService should return fiscal year 1 when now and registerTime fall within the same fiscal year
SequencesService should return the fiscal year using defaults (starting from 1953)
  ✅ SequencesService should return the fiscal year using defaults (starting from 1953)
SequencesService should return a high fiscal year number when registerTime is very early (e.g., 1900)
  ✅ SequencesService should return a high fiscal year number when registerTime is very early (e.g., 1900)
SequencesService should return fiscal year when rotateBy is FISCAL_YEARLY
  ✅ SequencesService should return fiscal year when rotateBy is FISCAL_YEARLY
SequencesService should return year when rotateBy is YEARLY
  ✅ SequencesService should return year when rotateBy is YEARLY
SequencesService should return year and month when rotateBy is MONTHLY
  ✅ SequencesService should return year and month when rotateBy is MONTHLY
SequencesService should return year, month, and day when rotateBy is DAILY
  ✅ SequencesService should return year, month, and day when rotateBy is DAILY
SequencesService should return RotateByEnum.NONE for undefined or unhandled rotateBy
  ✅ SequencesService should return RotateByEnum.NONE for undefined or unhandled rotateBy
SequencesService should return true if rotateBy is not provided
  ✅ SequencesService should return true if rotateBy is not provided
SequencesService should return true if rotateBy is FISCAL_YEARLY and fiscal year matches
  ✅ SequencesService should return true if rotateBy is FISCAL_YEARLY and fiscal year matches
SequencesService should return false if rotateBy is FISCAL_YEARLY and fiscal year does not match
  ✅ SequencesService should return false if rotateBy is FISCAL_YEARLY and fiscal year does not match
SequencesService should return false if rotateBy is MONTHLY and issued year does not match current year
  ✅ SequencesService should return false if rotateBy is MONTHLY and issued year does not match current year
SequencesService should return false if rotateBy is MONTHLY and issued month does not match current month but matches year
  ✅ SequencesService should return false if rotateBy is MONTHLY and issued month does not match current month but matches year
SequencesService should return false if rotateBy is YEARLY and issued year does not match current year
  ✅ SequencesService should return false if rotateBy is YEARLY and issued year does not match current year
SequencesService should return true if rotateBy is YEARLY and issued year matches current year
  ✅ SequencesService should return true if rotateBy is YEARLY and issued year matches current year
SequencesService should return true if rotateBy is MONTHLY and issued month matches current month and year
  ✅ SequencesService should return true if rotateBy is MONTHLY and issued month matches current month and year

✅ 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