Skip to content

Test Cases

🕙 Start time⌛ Duration
10/18/2024, 1:52:30 PM10.574 s
✅ Passed❌ Failed⏩ Skipped🚧 Todo⚪ Total
Test Suites9600096
Tests252000252

tests/actionDictionary.test.ts

69 passed, 0 failed, 0 skipped, 0 todo, done in 175.75350799999978 s

✅ actionDictionary › constructor
   ✅ returns an instance of ActionDictionaryTest
   ✅ returns an instance of AbstractBaseClass
   ✅ has an autogenerated alphanumeric Correlation ID
   ✅ is empty by default
✅ actionDictionary › /setActionValidator
   ✅ accepts a function to overwrite default Action Validator
   ✅ resets the Action Validator to default when called with null
   ✅ returns self
✅ actionDictionary › /getDictionary
   ✅ returns the dictionary
   ✅ filters by namespace
   ✅ ignores invalid namespaces
✅ actionDictionary › /clearActions › when used with no arguments
   ✅ returns self
   ✅ wipes the dictionary
✅ actionDictionary › /clearActions › when used with a namespace
   ✅ returns self
   ✅ removes the particular namespace
   ✅ ignores invalid namespaces
✅ actionDictionary › /clearActions
✅ actionDictionary › /getActionValues › returns null when namespace and/or action does not match
   ✅ action from different namespace
   ✅ action from non-existent namespace
   ✅ action in default namespace that does not exist
   ✅ returns as many nulls as keys were requested
✅ actionDictionary › /getActionValues
   ✅ returns empty array for empty input
   ✅ returns a valid Action value without namespace
   ✅ returns a valid Action with namespace
   ✅ is idempotent
✅ actionDictionary › /addActions › without namespace
   ✅ returns valid numeric values
   ✅ is idempotent
   ✅ throws when adding duplicate keys
✅ actionDictionary › /addActions › with namespace
   ✅ returns valid numeric values
   ✅ is idempotent
   ✅ allows adding same keys with different namespaces
   ✅ throws when adding duplicate keys
✅ actionDictionary › /addActions
✅ actionDictionary › /removeActions › with namespace › without Keys and Actions
   ✅ does not change the dictionary with non-existing namespace
   ✅ does not change the dictionary with existing namespace
✅ actionDictionary › /removeActions › with namespace › with Keys
   ✅ does not change the dictionary with non-existing namespace
   ✅ ignores empty keys
   ✅ ignores keys from different namespace
   ✅ ignores non-existing keys
   ✅ removes the requested Keys
✅ actionDictionary › /removeActions › with namespace › with Actions
   ✅ does not change the dictionary with non-existing namespace
   ✅ ignores empty actions
   ✅ ignores actions from different namespace
   ✅ ignores non-existing actions
   ✅ removes the requested Actions
✅ actionDictionary › /removeActions › with namespace › with Keys and Actions
   ✅ does not change the dictionary with non-existing namespace
   ✅ ignores empty actions and keys
   ✅ removes the requested Actions and Keys
   ✅ restricts removed Actions and Keys to the requested namespace
✅ actionDictionary › /removeActions › with namespace
✅ actionDictionary › /removeActions › without namespace › without Keys and Actions
   ✅ does not change the dictionary
✅ actionDictionary › /removeActions › without namespace › with Keys
   ✅ ignores empty keys
   ✅ ignores non-existing keys
   ✅ removes the requested Keys
✅ actionDictionary › /removeActions › without namespace › with Actions
   ✅ ignores empty actions
   ✅ ignores Actions from namespaces
   ✅ ignores non-existent Actions
   ✅ removes the requested Actions
✅ actionDictionary › /removeActions › without namespace › with Keys and Actions
   ✅ ignores empty actions and keys
   ✅ removes the requested Actions and Keys
   ✅ restricts removed Actions and Keys to the default namespace
✅ actionDictionary › /removeActions › without namespace
✅ actionDictionary › /removeActions
   ✅ returns self
   ✅ does not change the dictionary without params
   ✅ on empty dictionary does not change anything
✅ actionDictionary › /getActionKeys › returns null when namespace and/or action does not match
   ✅ invalid action
   ✅ actions from different namespace
   ✅ action from non-existent namespace
   ✅ action in default namespace that does not exist
   ✅ returns as many nulls as keys were requested
✅ actionDictionary › /getActionKeys
   ✅ returns empty array for empty input
   ✅ is idempotent
   ✅ returns a key without namespace
   ✅ returns a key with namespace
✅ actionDictionary

tests/automata.test.ts

68 passed, 0 failed, 0 skipped, 0 todo, done in 178.70460899999944 s

✅ automata › constructor
   ✅ returns an instance of AutomataTest
   ✅ returns an instance of AbstractBaseClass
   ✅ sets the EventAdapter
✅ automata › /setEventValidator
   ✅ accepts a function to overwrite default Event Validator
   ✅ resets the Event Validator to default when called with null
   ✅ returns self
✅ automata › /setActionValidator
   ✅ accepts a function to overwrite default Action Validator
   ✅ resets the Action Validator to default when called with null
   ✅ returns self
✅ automata › /setStateValidator
   ✅ accepts a function to overwrite default State Validator
   ✅ resets the State Validator to default when called with null
   ✅ returns self
✅ automata › when not initialized properly
   ✅ throws an error when calling `dispatch`
   ✅ throws an error when calling `consumeAction`
   ✅ throws an error when calling `collapseActionQueue`
✅ automata › /init
   ✅ resets root reducer when called with null as reducer
   ✅ throws when called with non-function reducer
   ✅ assigns a reducer when passed
   ✅ initializes with provided Context, empty Queue, and is Enabled and Resumed by default
   ✅ resets the Queue and Internal State, while copying Disabled and Paused, when invoked upon stateful Automata
   ✅ throws when called with invalid state
   ✅ returns self
✅ automata › /consumeAction › with argument
   ✅ pops all Actions from Action Queue and returns computed Context, when called with number greater than queue length
   ✅ when Disabled, computes the specified quantity of Actions from the Queue without changing the internal state
   ✅ when Enabled, consumes of Actions from the Queue and changes the state
✅ automata › /consumeAction
   ✅ with empty Action Queue returns the current Context 
   ✅ with empty Action Queue returns the current Context when called with parameter 
   ✅ when Disabled, doesn't alter the Action Queue but returns computed Context
   ✅ when Enabled, pops the Action Queue and returns computed Context
✅ automata › /dispatch › when Unpaused, Enabled
   ✅ instantly updates internal Context without the Action Queue and returns new Context
   ✅ doesn't Disable or Pause
✅ automata › /dispatch › when Unpaused, Disabled
   ✅ returns new Context without altering Action Queue or changing internal Context
   ✅ doesn't Enable or Pause
✅ automata › /dispatch › when Paused, Enabled
   ✅ returns new Context, adding Action to Action Queue and not changing internal Context
   ✅ doesn't Disable or Resume
✅ automata › /dispatch › when Paused, Disabled
   ✅ returns new Context, adding Action to Action Queue and not changing internal Context
   ✅ doesn't Enable or Resume
✅ automata › /dispatch
   ✅ throws on invalid Actions
   ✅ is pure function
✅ automata › /pause, /resume, /disable, /enable › when Paused › enabling/Disabling in Paused mode
   ✅ disable is invariant to Paused and Context, but not to Action Queue
   ✅ enable is invariant to Paused, and Context, but not to Action Queue
   ✅ disable(true) clears the Action Queue but invariant to Context and Paused
✅ automata › /pause, /resume, /disable, /enable › when Paused
   ✅ resumes the Disabled Automata, preserving the queue
   ✅ resumes the Enabled Automata, Consuming the queue
   ✅ pause is idempotent
   ✅ does not Dispatch the Action but queues it
✅ automata › /pause, /resume, /disable, /enable › when not Paused › enabling/Disabling not in Paused mode
   ✅ disable is invariant to Action Queue, Context and Paused
   ✅ disable with 'true' is invariant to Action Queue, Context and Paused
   ✅ enable is invariant to Paused and Action Queue, but not to Context
✅ automata › /pause, /resume, /disable, /enable › when not Paused
   ✅ pauses the enabled Automata
   ✅ pauses the disabled Automata
   ✅ resume is idempotent
✅ automata › /pause, /resume, /disable, /enable
✅ automata › /getActionQueue
   ✅ returns the Action Queue when Paused
   ✅ is always empty when Resumed and Enabled
   ✅ every call returns a new object
✅ automata › /getContext
   ✅ returns the Context passed at initialization
   ✅ every call returns a new object
✅ automata › /getReducer
   ✅ returns the RootReducer passed at initialization
   ✅ returns Null when RootReducer is reset
✅ automata › /clearActionQueue
   ✅ clears the Action Queue when Paused, Enabled
   ✅ clears the Action Queue when Paused, Disabled
   ✅ isn't needed when Resumed, Enabled
   ✅ isn't needed when Resumed, Disabled
   ✅ returns self
✅ automata › /collapseActionQueue › when Paused
   ✅ when Enabled, clears the Action Queue and returns it along with new Context
   ✅ when Disabled, returns the Action Queue and Context, but doesn't change them
✅ automata › /collapseActionQueue › when Resumed
   ✅ when Enabled, does not change anything, returns the current Context and empty Actions
   ✅ when Disabled, returns the Action Queue and Context, but doesn't change them
✅ automata › /collapseActionQueue
✅ automata

tests/eventAdapter.test.ts

46 passed, 0 failed, 0 skipped, 0 todo, done in 117.24408199999993 s

✅ eventAdapter › constructor
   ✅ returns an instance of EventAdapterTest
   ✅ returns an instance of AbstractBaseClass
   ✅ has an autogenerated alphanumeric Correlation ID
   ✅ is empty by default
✅ eventAdapter › setEventValidator
   ✅ accepts a function to overwrite default Event Validator
   ✅ resets the Event Validator to default when called with null
✅ eventAdapter › setStateValidator
   ✅ accepts a function to overwrite default State Validator
   ✅ resets the Event Validator to default when called with null
✅ eventAdapter › getObservedEvents
   ✅ returns an empty array by default
   ✅ returns observed events
   ✅ omits Events that are discarded by Event Validator
✅ eventAdapter › getObservedStates
   ✅ returns an empty array by default
   ✅ returns observed states
   ✅ omits States that are discarded by State Validator
✅ eventAdapter › event Handling › addEventListener
   ✅ actually adds an observer
   ✅ returns an unsubscribe function
   ✅ returns Null when called with invalid handler
   ✅ ignores invalid Events and returns Null
   ✅ ignores listeners for Events that are discarded by Event Validator
✅ eventAdapter › event Handling › handleEvent (single listener)
   ✅ ignores invalid Events
   ✅ ignores Events discarded by Event Validator
   ✅ correctly handles single event
   ✅ is pure function
   ✅ is correctly applied with null EventMeta
✅ eventAdapter › event Handling › handleEvent (multiple listeners)
   ✅ returns a related stack of actions on success
   ✅ applies multiple event handlers to each event in original order
✅ eventAdapter › event Handling › removeAllListeners
   ✅ removes all listeners without an argument
   ✅ removes typed listeners with a typed argument
   ✅ ignores invalid Events
   ✅ ignores Events discarded by Event Validator
✅ eventAdapter › event Handling
✅ eventAdapter › event Dispatching › addEventEmitter
   ✅ actually adds an emitter
   ✅ returns an unsubscribe function
   ✅ returns Null when called with invalid Emitter
   ✅ ignores invalid States and returns Null
   ✅ ignores Emitters for States that are discarded by State Validator
✅ eventAdapter › event Dispatching › handleTransition (single emitter)
   ✅ ignores invalid States
   ✅ ignores States discarded by State Validator
   ✅ correctly handles a single transition
   ✅ is pure function
   ✅ is correctly applied with null state context
✅ eventAdapter › event Dispatching › handleTransition (multiple emitters)
   ✅ returns a related stack of actions on success
   ✅ applies multiple event handlers to each event in original order
✅ eventAdapter › event Dispatching › removeAllEmitters
   ✅ removes all listeners without an argument
   ✅ removes emitters for a specific state when called with a typed argument
   ✅ ignores invalid States
   ✅ ignores States discarded by State Validator
✅ eventAdapter › event Dispatching
✅ eventAdapter

tests/eventDictionary.test.ts

69 passed, 0 failed, 0 skipped, 0 todo, done in 189.20328100000006 s

✅ eventDictionary › constructor
   ✅ returns an instance of EventDictionaryTest
   ✅ returns an instance of AbstractBaseClass
   ✅ has an autogenerated alphanumeric Correlation ID
   ✅ is empty by default
✅ eventDictionary › /setEventValidator
   ✅ accepts a function to overwrite default Event Validator
   ✅ resets the Event Validator to default when called with null
   ✅ returns self
✅ eventDictionary › /getDictionary
   ✅ returns the dictionary
   ✅ filters by namespace
   ✅ ignores invalid namespaces
✅ eventDictionary › /clearEvents › when used with no arguments
   ✅ returns self
   ✅ wipes the dictionary
✅ eventDictionary › /clearEvents › when used with a namespace
   ✅ returns self
   ✅ removes the particular namespace
   ✅ ignores invalid namespaces
✅ eventDictionary › /clearEvents
✅ eventDictionary › /getEventValues › returns null when namespace and/or Event does not match
   ✅ event from different namespace
   ✅ event from non-existent namespace
   ✅ event in default namespace that does not exist
   ✅ returns as many nulls as keys were requested
✅ eventDictionary › /getEventValues
   ✅ returns empty array for empty input
   ✅ returns a valid Event value without namespace
   ✅ returns a valid Event with namespace
   ✅ is idempotent
✅ eventDictionary › /addEvents › without namespace
   ✅ returns valid numeric values
   ✅ is idempotent
   ✅ throws when adding duplicate keys
✅ eventDictionary › /addEvents › with namespace
   ✅ returns valid numeric values
   ✅ is idempotent
   ✅ allows adding same keys with different namespaces
   ✅ throws when adding duplicate keys
✅ eventDictionary › /addEvents
✅ eventDictionary › /removeEvents › with namespace › without Keys and Events
   ✅ does not change the dictionary with non-existing namespace
   ✅ does not change the dictionary with existing namespace
✅ eventDictionary › /removeEvents › with namespace › with Keys
   ✅ does not change the dictionary with non-existing namespace
   ✅ ignores empty keys
   ✅ ignores keys from different namespace
   ✅ ignores non-existing keys
   ✅ removes the requested Keys
✅ eventDictionary › /removeEvents › with namespace › with Events
   ✅ does not change the dictionary with non-existing namespace
   ✅ ignores empty Events
   ✅ ignores Events from different namespace
   ✅ ignores non-existing Events
   ✅ removes the requested Events
✅ eventDictionary › /removeEvents › with namespace › with Keys and Events
   ✅ does not change the dictionary with non-existing namespace
   ✅ ignores empty Events and keys
   ✅ removes the requested Events and Keys
   ✅ restricts removed Events and Keys to the requested namespace
✅ eventDictionary › /removeEvents › with namespace
✅ eventDictionary › /removeEvents › without namespace › without Keys and Events
   ✅ does not change the dictionary
✅ eventDictionary › /removeEvents › without namespace › with Keys
   ✅ ignores empty keys
   ✅ ignores non-existing keys
   ✅ removes the requested Keys
✅ eventDictionary › /removeEvents › without namespace › with Events
   ✅ ignores empty Events
   ✅ ignores Events from namespaces
   ✅ ignores non-existent Events
   ✅ removes the requested Events
✅ eventDictionary › /removeEvents › without namespace › with Keys and Events
   ✅ ignores empty Events and keys
   ✅ removes the requested Events and Keys
   ✅ restricts removed Events and Keys to the default namespace
✅ eventDictionary › /removeEvents › without namespace
✅ eventDictionary › /removeEvents
   ✅ returns self
   ✅ does not change the dictionary without params
   ✅ on empty dictionary does not change anything
✅ eventDictionary › /getEventKeys › returns null when namespace and/or Event does not match
   ✅ invalid Event
   ✅ events from different namespace
   ✅ event from non-existent namespace
   ✅ event in default namespace that does not exist
   ✅ returns as many nulls as keys were requested
✅ eventDictionary › /getEventKeys
   ✅ returns empty array for empty input
   ✅ is idempotent
   ✅ returns a key without namespace
   ✅ returns a key with namespace
✅ eventDictionary