unittests/tests/widgets/tooltipWidget.js
branchpopcorn-port
changeset 492 97c920842123
parent 427 440ffc18f827
equal deleted inserted replaced
491:095f4c76664d 492:97c920842123
    25     var widget = new IriSP.TooltipWidget(this.Popcorn, this.config, this.ser);    
    25     var widget = new IriSP.TooltipWidget(this.Popcorn, this.config, this.ser);    
    26     widget.draw();
    26     widget.draw();
    27 
    27 
    28     equal(widget.selector.children(".tip").length, 1, "test if the div has been added correctly");
    28     equal(widget.selector.children(".tip").length, 1, "test if the div has been added correctly");
    29     equal(widget.selector.children(".tip").css("position"), "fixed", "test if the widget has the correct position attr");    
    29     equal(widget.selector.children(".tip").css("position"), "fixed", "test if the widget has the correct position attr");    
    30     equal(widget.selector.children(".tip").css("left"), "-10000px", "test if div has been positionned correctly");
    30     equal(widget.selector.children(".tip").css("display"), "none", "test if tooltip is hidden");    
    31     equal(widget.selector.children(".tip").css("top"), "-100000px", "test if div has been positionned correctly");
       
    32   });
    31   });
    33   
    32   
    34   test("test widget display function", function() {
    33   test("test widget display function", function() {
    35     var widget = new IriSP.TooltipWidget(this.Popcorn, this.config, this.ser);    
    34     var widget = new IriSP.TooltipWidget(this.Popcorn, this.config, this.ser);    
    36     widget.draw();
    35     widget.draw();
    37     
    36     
    38     widget.show("ceci est un texte", "#fefefe", 105, 240);
    37     widget.show("ceci est un texte", "#fefefe", 105, 240);
    39     equal(widget.selector.children(".tip").css("left"), "105px", "test if div has been positionned correctly");
    38     equal(widget.selector.children(".tip").css("left"), "105px", "test if div has been positionned correctly");
    40     equal(widget.selector.children(".tip").css("top"), "240px", "test if div has been positionned correctly");    
    39     equal(widget.selector.children(".tip").css("top"), "240px", "test if div has been positionned correctly");    
    41     equal(widget.selector.find(".tiptext").text(), "ceci est un texte", "test if text has been set correctly");
    40     equal(widget.selector.find(".tiptext").text(), "ceci est un texte", "test if text has been set correctly");
       
    41     notEqual(widget.selector.children(".tip").css("display"), "none", "test if tooltip is hidden"); 
    42     
    42     
    43     widget.hide();
    43     widget.hide();
    44     equal(widget.selector.children(".tip").css("left"), "-10000px", "test if div has been positionned correctly");
    44     equal(widget.selector.children(".tip").css("display"), "none", "test if tooltip is hidden"); 
    45     equal(widget.selector.children(".tip").css("top"), "-100000px", "test if div has been positionned correctly");
       
    46   });
    45   });
    47 }; 
    46 };