All files / botbuilder-unit/spec/scripts/attachments validateAttachmentWithFunction_1.js

100% Statements 5/5
50% Branches 4/8
100% Functions 4/4
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 271x           1x             1x     1x     1x              
module.exports = [
  {user : 'hi'},
  {bot : 'Hello'},
  {
    "bot" : "World!",
    "attachmentLayout": function ( value ) {
      return "carousel" == value ? Promise.resolve() : Promise.reject();
    },
    "attachments": [
      {
        "contentType": "application/vnd.microsoft.card.hero",
        "content": {
          "title": function ( value ) {
            return "My Title" == value ? Promise.resolve() : Promise.reject('Wrong title');
          },
          "subtitle": function (value ) {
            return "My Subtitle" == value ? Promise.resolve() : Promise.reject('Wrong subtitle');
          },
          "images": function ( value ) {
            return 2 == value.length ? Promise.resolve() : Promise.reject('Wrong images count');
          }
        }
      }
    ]
  },
  {endConversation: true}
]