mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
test: fix chat
Change way of clicking the settings button, and use stick-to-screen button is second test
This commit is contained in:
parent
87fb23149d
commit
7a6d212e17
1 changed files with 40 additions and 36 deletions
|
@ -75,56 +75,60 @@ describe("Chat messages and UI", function(){
|
|||
//get the chat selector
|
||||
var $stickychatCheckbox = chrome$("#options-stickychat");
|
||||
|
||||
//select chat always on screen and fire change event
|
||||
$stickychatCheckbox.attr('selected','selected');
|
||||
$stickychatCheckbox.change();
|
||||
$stickychatCheckbox.click();
|
||||
//select chat always on screen
|
||||
if (!$stickychatCheckbox.is(':checked')) {
|
||||
$stickychatCheckbox.click();
|
||||
}
|
||||
|
||||
//check if chat changed to get the stickychat Class
|
||||
var $chatbox = chrome$("#chatbox");
|
||||
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
||||
expect(hasStickyChatClass).to.be(true);
|
||||
// due to animation, we need to make some timeout...
|
||||
setTimeout(function() {
|
||||
//check if chat changed to get the stickychat Class
|
||||
var $chatbox = chrome$("#chatbox");
|
||||
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
||||
expect(hasStickyChatClass).to.be(true);
|
||||
|
||||
//select chat always on screen and fire change event
|
||||
$stickychatCheckbox.attr('selected','selected');
|
||||
$stickychatCheckbox.change();
|
||||
$stickychatCheckbox.click();
|
||||
// select chat always on screen and fire change event
|
||||
$stickychatCheckbox.click();
|
||||
|
||||
setTimeout(function() {
|
||||
//check if chat changed to remove the stickychat Class
|
||||
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
||||
expect(hasStickyChatClass).to.be(false);
|
||||
|
||||
done();
|
||||
}, 10)
|
||||
}, 10)
|
||||
|
||||
//check if chat changed to remove the stickychat Class
|
||||
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
||||
expect(hasStickyChatClass).to.be(false);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it("makes chat stick to right side of the screen then makes it one step smaller", 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();
|
||||
// open chat
|
||||
chrome$('#chaticon').click();
|
||||
|
||||
//get the chat selector
|
||||
var $stickychatCheckbox = chrome$("#options-stickychat");
|
||||
// select chat always on screen from chatbox
|
||||
chrome$('.stick-to-screen-btn').click();
|
||||
|
||||
//select chat always on screen and fire change event
|
||||
$stickychatCheckbox.attr('selected','selected');
|
||||
$stickychatCheckbox.change();
|
||||
$stickychatCheckbox.click();
|
||||
// due to animation, we need to make some timeout...
|
||||
setTimeout(function() {
|
||||
//check if chat changed to get the stickychat Class
|
||||
var $chatbox = chrome$("#chatbox");
|
||||
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
||||
expect(hasStickyChatClass).to.be(true);
|
||||
|
||||
//check if chat changed to get the stickychat Class
|
||||
var $chatbox = chrome$("#chatbox");
|
||||
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
||||
expect(hasStickyChatClass).to.be(true);
|
||||
// select chat always on screen and fire change event
|
||||
chrome$('#titlecross').click();
|
||||
|
||||
//select chat always on screen and fire change event
|
||||
chrome$('#titlecross').click();
|
||||
setTimeout(function() {
|
||||
//check if chat changed to remove the stickychat Class
|
||||
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
||||
expect(hasStickyChatClass).to.be(false);
|
||||
|
||||
//check if chat changed to remove the stickychat Class
|
||||
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
||||
expect(hasStickyChatClass).to.be(false);
|
||||
|
||||
done();
|
||||
done();
|
||||
}, 10)
|
||||
}, 10)
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue