BotBuilder-Samples icon indicating copy to clipboard operation
BotBuilder-Samples copied to clipboard

bf dialog:generate:test add Assertion for Adaptive Card issue

Open xhr0804 opened this issue 5 years ago • 1 comments

Describe the bug

The bf dialog:generate:test tool convert the activity.Attachments like AdaptiveCard by splicing the paths in the json format, but this will sometimes cause issue.

This is a sample serialized string of an adaptive card

  {
    "contentType": "application/vnd.microsoft.card.adaptive",
    "content": {
      "type": "AdaptiveCard",
      "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
      "version": "1.2",
      "body": [
        {
          "type": "TextBlock",
          "text": "I added task **update spec**.",
          "wrap": true
        }
      ]
    },
    "lgType": "attachment"
  }
],

For the "lgType" fileld, the dialog:generate:test tool convert it to "attachments[0].lgType == 'attachment'", but this will cause an error in the test.dialog. It should be "attachments[0].Properties["lgType"] == 'attachment'".

This is actually because 'lgType' is just a key in the 'Properties" field of Attachment, but the serialized string of attachment lose the ‘Properties’ info (because of the keyword "[JsonExtensionData]"?) image image

To Reproduce

Try to convert the card using bf dialog:generate:test.

Expected behavior

Convert the 'lgType' correctly or just don't convert it into Assertions.

xhr0804 avatar Aug 19 '20 08:08 xhr0804

Putting this in the backlog since the plan is to redo how generating tests works.

chrimc62 avatar Jun 16 '21 05:06 chrimc62