ask-sdk-test icon indicating copy to clipboard operation
ask-sdk-test copied to clipboard

Bug with storesAttributes using Strict/Reference Equality instead of Lenient/Normal Equality

Open bluu1993 opened this issue 6 years ago • 0 comments

Description

The validation for validating the stored/persistence attributes with storesAttributes uses reference equality when it should use normal equality (similar to how SessionAttributeValidator works).

Steps to Reproduce

  1. Write a Skill Lambda that persists attributes where one of the root attributes stores another object.

e.g.

{  
   "field1": "value1",
   "field2": {
      "field3": "value3",
      "field4": "value4"
   }
}
  1. Write a test case with the SDK to validate that it stores the given attributes.

e.g.

alexaTest.test([
    {
        request: ...,
        says: ...,
        reprompts: ...,
        storesAttributes: {  
           "field1": "value1",
           "field2": {
              "field3": "value3",
              "field4": "value4"
           }
        }
    }
]);
  1. Run test and it will fail.

Expected behavior:

Test case to pass and lenient/normal equality to be used.

Actual behavior:

Test case will fail because it uses strict/reference equality.

Environment

NodeJS-Version:

v8.12.0

TypeScript-Version:

N/A

OS:

MAC OS X

bluu1993 avatar Jul 16 '19 23:07 bluu1993