mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 01:16:15 -04: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,44 +75,45 @@ describe("Chat messages and UI", function(){
|
||||||
//get the chat selector
|
//get the chat selector
|
||||||
var $stickychatCheckbox = chrome$("#options-stickychat");
|
var $stickychatCheckbox = chrome$("#options-stickychat");
|
||||||
|
|
||||||
//select chat always on screen and fire change event
|
//select chat always on screen
|
||||||
$stickychatCheckbox.attr('selected','selected');
|
if (!$stickychatCheckbox.is(':checked')) {
|
||||||
$stickychatCheckbox.change();
|
|
||||||
$stickychatCheckbox.click();
|
$stickychatCheckbox.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
// due to animation, we need to make some timeout...
|
||||||
|
setTimeout(function() {
|
||||||
//check if chat changed to get the stickychat Class
|
//check if chat changed to get the stickychat Class
|
||||||
var $chatbox = chrome$("#chatbox");
|
var $chatbox = chrome$("#chatbox");
|
||||||
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
||||||
expect(hasStickyChatClass).to.be(true);
|
expect(hasStickyChatClass).to.be(true);
|
||||||
|
|
||||||
// select chat always on screen and fire change event
|
// select chat always on screen and fire change event
|
||||||
$stickychatCheckbox.attr('selected','selected');
|
|
||||||
$stickychatCheckbox.change();
|
|
||||||
$stickychatCheckbox.click();
|
$stickychatCheckbox.click();
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
//check if chat changed to remove the stickychat Class
|
//check if chat changed to remove the stickychat Class
|
||||||
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
||||||
expect(hasStickyChatClass).to.be(false);
|
expect(hasStickyChatClass).to.be(false);
|
||||||
|
|
||||||
done();
|
done();
|
||||||
|
}, 10)
|
||||||
|
}, 10)
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("makes chat stick to right side of the screen then makes it one step smaller", function(done) {
|
it("makes chat stick to right side of the screen then makes it one step smaller", function(done) {
|
||||||
var inner$ = helper.padInner$;
|
var inner$ = helper.padInner$;
|
||||||
var chrome$ = helper.padChrome$;
|
var chrome$ = helper.padChrome$;
|
||||||
|
|
||||||
//click on the settings button to make settings visible
|
// open chat
|
||||||
var $settingsButton = chrome$(".buttonicon-settings");
|
chrome$('#chaticon').click();
|
||||||
$settingsButton.click();
|
|
||||||
|
|
||||||
//get the chat selector
|
// select chat always on screen from chatbox
|
||||||
var $stickychatCheckbox = chrome$("#options-stickychat");
|
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
|
//check if chat changed to get the stickychat Class
|
||||||
var $chatbox = chrome$("#chatbox");
|
var $chatbox = chrome$("#chatbox");
|
||||||
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
||||||
|
@ -121,10 +122,13 @@ describe("Chat messages and UI", function(){
|
||||||
// select chat always on screen and fire change event
|
// select chat always on screen and fire change event
|
||||||
chrome$('#titlecross').click();
|
chrome$('#titlecross').click();
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
//check if chat changed to remove the stickychat Class
|
//check if chat changed to remove the stickychat Class
|
||||||
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
var hasStickyChatClass = $chatbox.hasClass("stickyChat");
|
||||||
expect(hasStickyChatClass).to.be(false);
|
expect(hasStickyChatClass).to.be(false);
|
||||||
|
|
||||||
done();
|
done();
|
||||||
|
}, 10)
|
||||||
|
}, 10)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue