Test Report

Started: 2023-04-07 23:53:50
Suites (8)
8 passed
0 failed
0 pending
Tests (83)
83 passed
0 failed
0 pending
/home/me/shared_MAIN/sdkzer/__test__/sdkzer_spec.ts
8.076s
Sdkzer > .constructor > without providing initial attributes
should not initialize with a defined id or other attributes
passed
0.005s
Sdkzer > .constructor > providing initial attributes
should set the attributes (attr) and previous attributes (pAttrs) using the initial attributes
passed
0.001s
Sdkzer > .constructor > when default attributes are setted > without providing initial attributes
should set the default attributes
passed
0.002s
Sdkzer > .constructor > when default attributes are setted > providing initial attributes
should override the initial attributes with the default attributes
passed
0.001s
Sdkzer > .configure
should configure the default http headers
passed
0s
Sdkzer > .setDefaults
should update the attributes with the default attributes
passed
0s
Sdkzer > .defaults
should have a defaults() function defined that returns an empty object (no default attributes)
passed
0s
Sdkzer > .validate()
it should clean all invalid messages from previous validations
passed
0.001s
Sdkzer > .validate() > without any ValidationRule
should not generate invalid errors
passed
0.001s
Sdkzer > .validate() > with ValidationRules > when one ValidationRule doesn't pass
should generate invalid error messages for the invalid attribute
passed
0.001s
Sdkzer > .validate() > with ValidationRules > when one ValidationRule doesn't pass
should not add the same arror message multiple times when calling .valida() multiple times
passed
0s
Sdkzer > .validate() > with ValidationRules > when all ValidationRules pass > when the record was previously invalid
should not contain invalid error messages even when the entity was previously invalid
passed
0s
Sdkzer > .isValid
it should be valid when there are no validation error messages
passed
0.001s
Sdkzer > .isValid
it should be invalid when there are no validation error messages
passed
0s
Sdkzer > .attr > when a value is not specified
should read the attribute value based on its key
passed
0s
Sdkzer > .attr > when a value is not specified > when the attribute key value uses dots notation
should read the attribute by accessing to the json keys nested between each dot
passed
0.001s
Sdkzer > .attr > when a value as second parameter is specified
should set the value for the attribute name specified in the first parameter
passed
0s
Sdkzer > .attr > when a value as second parameter is specified > when the attribute key value uses dots notation
should set the right attribute by accessing to the json keys between each dot
passed
0.001s
Sdkzer > .attr > when calling it without parameters
should return all attributes of the instance
passed
0s
Sdkzer > .baseEndpoint
shouldnt have an empty default base endpoint defined (function should exist)
passed
0.001s
Sdkzer > .resourceEndpoint
should have a default resourceEndpoint defined (function should exist)
passed
0s
Sdkzer > .isNew
should return true when there is no id in the record
passed
0.001s
Sdkzer > .isNew
should return false when there is an id in the record
passed
0s
Sdkzer > .hasChanged
should return false when no attributes have changed since last sync
passed
0.001s
Sdkzer > .hasChanged
should return true when attributes have changed since last sync
passed
0.004s
Sdkzer > .hasAttrChanged
should return true when the attribute has changed since last sync
passed
0s
Sdkzer > .hasAttrChanged
should return false when the attribute has not been changed since last sync
passed
0.001s
Sdkzer > .changedAttrs
should retrieve a list of attributes different from the origin
passed
0s
Sdkzer > .prevAttrs
should retrieve a list of the previous values for the attributes changed from the origin
passed
0s
Sdkzer > .prevValue
should retrieve the previous attribute value before last sync from origin
passed
0s
Sdkzer > .fetch > when the record has an id setted > in a successful request
should fetch data from the origin and resolve it in a Promise
passed
0.005s
Sdkzer > .fetch > when the record has an id setted > in a successful request
should set a property called 'syncing' during syncing with the right state
passed
0.001s
Sdkzer > .fetch > when the record has an id setted > in a successful request
should update the attributes parsed from the origin
passed
0s
Sdkzer > .fetch > when the record has an id setted > in a successful request
should take the parsed attributes from the origin and store them as previous attributes
passed
0s
Sdkzer > .fetch > when the record has an id setted > in a successful request > when not using custom HttpQuery
should make an http request to the right endpoint
passed
0.001s
Sdkzer > .fetch > when the record has an id setted > in a successful request > when passing a custom HttpQuery
should merge the HttpQuery with the default HttpQuery
passed
0.001s
Sdkzer > .fetch > when the record has an id setted > in a failed request
should set a property called 'syncing' during syncing with the right state
passed
0.001s
Sdkzer > .fetch > when the record has an id setted > in a failed request
it should resolve into an error
passed
0.001s
Sdkzer > .fetch > when the record hasn't an id setted
shouldn't make any request
passed
0s
Sdkzer > .parseRecord
should parse the data as it comes
passed
0s
Sdkzer > .parseRecord
should parse the data that is on a specific key when a prefix attribute is specified
passed
0s
Sdkzer > .toOriginJSON > with the default parser
should return the record attributes as they are for the origin
passed
0.001s
Sdkzer > .toOriginJSON > with a custom parser
should parse the record attributes correctly for the origin
passed
0s
Sdkzer > .toOrigin
should retrieve the attributes in JSON format by default
passed
0.001s
Sdkzer > .toOrigin
should retrieve the attributes in JSON format when 'json' format is specified
passed
0.001s
Sdkzer > .toOrigin
should retrieve the attributes in xml format when 'xml' format is specified
passed
0.001s
Sdkzer > .save > in a successful request > when the record has an id setted (considered an existing record in the origin)
should update the attributes in the origin using the local attributes and using PUT method
passed
0.001s
Sdkzer > .save > in a successful request > when the record does't have an id setted (considered a new record in the origin)
should create the record in the origin using the local attributes and using POST method
passed
0.001s
Sdkzer > .save > in a successful request > when the record does't have an id setted (considered a new record in the origin)
should set the id attribute retrieved from the origin
passed
0s
Sdkzer > .save > in a failed request
it should resolve into an error
passed
0s
Sdkzer > .destroy
should try to destroy the record in the origin
passed
0.001s
Sdkzer > .destroy > in a failed request
it should resolve into an error
passed
0.001s
Sdkzer > #fetchIndex > in a successful request > when not using custom HttpQuery
should make an http request to the right endpoint
passed
0.001s
Sdkzer > #fetchIndex > in a successful request > when passing a custom HttpQuery
should merge the HttpQuery with the default HttpQuery
passed
0s
Sdkzer > #fetchIndex > in a successful request
should fetch a collection of records from the origin and return a Promise resolves into an array of instances of Item
passed
0.001s
Sdkzer > #fetchIndex > in a failed request
it should resolve into an error
passed
0.001s
Sdkzer > #fetchOne > in a successful request > when not using custom HttpQuery
should make an http request to the right endpoint
passed
0.001s
Sdkzer > #fetchOne > in a successful request > when passing a custom HttpQuery
should merge the HttpQuery with the default HttpQuery
passed
0.001s
Sdkzer > #fetchOne > in a successful request
should fetch a record from the origin and return a Promise resolves an instance of Item
passed
0.001s
Sdkzer > #fetchOne > in a failed request
it should resolve into an error
passed
0s
/home/me/shared_MAIN/sdkzer/__test__/validation_rules/length_validator_spec.ts
0.516s
LengthValidator
it should be INVALID with a smaller array items than the minimum required
passed
0.003s
LengthValidator
it should be INVALID with a higher array items than the maximum required
passed
0.001s
LengthValidator
it should be VALID with the right amount of items required
passed
0s
/home/me/shared_MAIN/sdkzer/__test__/validation_rule_spec.ts
0.643s
ValidationRule > .constructor()
should assign the value and validator params within the instance
passed
0.004s
ValidationRule > .constructor()
should initialize the _invalidMessage as empty
passed
0s
ValidationRule > .isValid()
should assign the original and final values within the instance
passed
0.001s
ValidationRule > .isValid()
should return true when all the ValidationRule conditions return true
passed
0.001s
ValidationRule > .isValid()
should return false when at least one of the ValidationRule conditions return false
passed
0.001s
ValidationRule > .addInvalidMessage()
should add a message to the invalid messages
passed
0.001s
/home/me/shared_MAIN/sdkzer/__test__/validation_rules/required_validator_spec.ts
0.571s
RequiredValidator
it should be INVALID when the value is undefined
passed
0.004s
RequiredValidator
it should be VALID when a value is defined
passed
0s
/home/me/shared_MAIN/sdkzer/__test__/validation_rules/allowed_value_switch_validator_spec.ts
0.543s
AllowedValueSwitchValidator
it should be INVALID when transitioning to invalid values
passed
0.003s
AllowedValueSwitchValidator
it should be VALID when transitioning to an allowed value
passed
0s
/home/me/shared_MAIN/sdkzer/__test__/validation_rules/email_validator_spec.ts
0.546s
EmailValidator
it should be INVALID with 'undefined'
passed
0.003s
EmailValidator
it should be INVALID with ''
passed
0.001s
EmailValidator
it should be INVALID with 'invalidemail'
passed
0.001s
EmailValidator
it should be INVALID with 'in@valid'
passed
0.001s
EmailValidator
it should be INVALID with 'in@valid..email'
passed
0.001s
EmailValidator
it should be VALID with 'valid@email.com'
passed
0.001s
/home/me/shared_MAIN/sdkzer/__test__/validation_rules/reg_exp_validator_spec.ts
0.546s
RegExpValidator
it should be INVALID when not matching the regexp
passed
0.003s
RegExpValidator
it should be VALID when matching the regexp
passed
0.001s
/home/me/shared_MAIN/sdkzer/__test__/validation_rules/number_validator_spec.ts
0.555s
NumberValidator
it should be INVALID with a smaller number than the minimum required
passed
0.003s
NumberValidator
it should be INVALID with a higher number than the maximum required
passed
0s