2012-10-09 03:59:45 +02:00
|
|
|
describe("chat always ons creen select", function(){
|
|
|
|
//create a new pad before each test run
|
|
|
|
beforeEach(function(cb){
|
|
|
|
helper.newPad(cb);
|
2012-11-02 00:19:59 +01:00
|
|
|
this.timeout(60000);
|
2012-10-09 03:59:45 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
it("makes chat stick to right side of the screen", function(done) {
|
|
|
|
var inner$ = helper.padInner$;
|
|
|
|
var chrome$ = helper.padChrome$;
|
|
|
|
|
|
|
|
//click on the settings button to make settings visible
|
|
|
|
var $settingsButton = chrome$(".buttonicon-settings");
|
|
|
|
$settingsButton.click();
|
|
|
|
|
|
|
|
//get the chat selector
|
|
|
|
var $stickychatCheckbox = chrome$("#options-stickychat");
|
|
|
|
|
2012-10-28 19:25:29 +01:00
|
|
|
//select chat always on screen and fire change event
|
2012-10-09 03:59:45 +02:00
|
|
|
$stickychatCheckbox.attr('selected','selected');
|
|
|
|
$stickychatCheckbox.change();
|
2012-10-28 19:25:29 +01:00
|
|
|
$stickychatCheckbox.click();
|
2012-10-09 03:59:45 +02:00
|
|
|
|
|
|
|
//check if chat changed to get the stickychat Class
|
2012-10-28 19:25:29 +01:00
|
|
|
var $chatbox = chrome$("#chatbox");
|
|
|
|
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
2012-10-09 03:59:45 +02:00
|
|
|
expect(hasStickyChatClass).to.be(true);
|
|
|
|
|
2012-10-28 19:25:29 +01:00
|
|
|
//select chat always on screen and fire change event
|
|
|
|
$stickychatCheckbox.attr('selected','selected');
|
|
|
|
$stickychatCheckbox.change();
|
|
|
|
$stickychatCheckbox.click();
|
|
|
|
|
|
|
|
//check if chat changed to remove the stickychat Class
|
|
|
|
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
|
|
|
expect(hasStickyChatClass).to.be(false);
|
|
|
|
|
2012-10-09 03:59:45 +02:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|