unittests/tests/widgets/tweetsWidget.js
branchpopcorn-port
changeset 298 eccdc619ede3
parent 283 39e6707ca72b
child 378 110311d59b2f
equal deleted inserted replaced
297:ed4a459c9290 298:eccdc619ede3
    34     // tweak the display period so that our tests don't timeout
    34     // tweak the display period so that our tests don't timeout
    35     IriSP.widgetsDefaults.TweetsWidget.tweet_display_period = 10;
    35     IriSP.widgetsDefaults.TweetsWidget.tweet_display_period = 10;
    36     
    36     
    37     var widget = new IriSP.TweetsWidget(this.Popcorn, this.config, this.ser);    
    37     var widget = new IriSP.TweetsWidget(this.Popcorn, this.config, this.ser);    
    38     widget.draw();
    38     widget.draw();
    39     var annotation = {content: {"title": "title", "description": "description", "keywords": "keywords", "img": {"src" : "http://yop.com"}}};
    39     var annotation = {content: 
       
    40                         {"title": "title", "description": "description", "keywords": "keywords", "img": {"src" : "http://yop.com"}},
       
    41                       meta: {"dc:source" : {}}
       
    42                      };
    40     widget.displayTweet(annotation);
    43     widget.displayTweet(annotation);
    41     
    44     
    42     equal(widget.selector.find(".Ldt-tweetContents").text(), "title", "title set correctly");    
    45     equal(widget.selector.find(".Ldt-tweetContents").text(), "title", "title set correctly");    
    43     equal(widget.selector.find(".Ldt-tweetAvatar").children().attr("src"), "http://yop.com", "user avatar set correctly");
    46     equal(widget.selector.find(".Ldt-tweetAvatar").children().attr("src"), "http://yop.com", "user avatar set correctly");
    44     
    47     
    45     var annotation2 = {content: {"title": "title", "description": "description", "keywords": "keywords", "img" : {}}};
    48     var annotation2 = {content: {"title": "title", "description": "description", "keywords": "keywords", "img" : {}}, meta: {"dc:source" : {}}};
    46     widget.displayTweet(annotation2);
    49     widget.displayTweet(annotation2);
    47     equal(widget.selector.find(".Ldt-tweetAvatar").children().attr("src"), 
    50     equal(widget.selector.find(".Ldt-tweetAvatar").children().attr("src"), 
    48                                IriSP.widgetsDefaults.TweetsWidget.default_profile_picture, "default avatar set correctly");
    51                                IriSP.widgetsDefaults.TweetsWidget.default_profile_picture, "default avatar set correctly");
    49     
    52     
    50     widget.selector.find(".Ldt-tweetWidgetMinimize").click();
    53     widget.selector.find(".Ldt-tweetWidgetMinimize").click();