mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 22:23:33 +01:00
make sure change user name forgets old user names
This commit is contained in:
parent
e33678e625
commit
2bd63cbfed
1 changed files with 15 additions and 1 deletions
|
@ -16,11 +16,17 @@ describe("change username value", function(){
|
||||||
var $usernameInput = chrome$("#myusernameedit");
|
var $usernameInput = chrome$("#myusernameedit");
|
||||||
$usernameInput.click();
|
$usernameInput.click();
|
||||||
|
|
||||||
|
$usernameInput.sendkeys('{selectall}');
|
||||||
|
$usernameInput.sendkeys('{del}');
|
||||||
|
$usernameInput.sendkeys('Hairy Robot');
|
||||||
|
$usernameInput.sendkeys('{enter}');
|
||||||
|
|
||||||
$usernameInput.sendkeys('{selectall}');
|
$usernameInput.sendkeys('{selectall}');
|
||||||
$usernameInput.sendkeys('{del}');
|
$usernameInput.sendkeys('{del}');
|
||||||
$usernameInput.sendkeys('John McLear');
|
$usernameInput.sendkeys('John McLear');
|
||||||
$usernameInput.sendkeys('{enter}');
|
$usernameInput.sendkeys('{enter}');
|
||||||
|
|
||||||
|
|
||||||
var correctUsernameValue = $usernameInput.val() === "John McLear";
|
var correctUsernameValue = $usernameInput.val() === "John McLear";
|
||||||
|
|
||||||
//check if the username has been changed to John McLear
|
//check if the username has been changed to John McLear
|
||||||
|
@ -42,8 +48,16 @@ describe("change username value", function(){
|
||||||
var $firstChatMessage = chrome$("#chattext").children("p");
|
var $firstChatMessage = chrome$("#chattext").children("p");
|
||||||
var containsJohnMcLear = $firstChatMessage.text().indexOf("John McLear") !== -1; // does the string contain Jo$
|
var containsJohnMcLear = $firstChatMessage.text().indexOf("John McLear") !== -1; // does the string contain Jo$
|
||||||
expect(containsJohnMcLear).to.be(true); // expect the first chat message to contain JohnMcLear
|
expect(containsJohnMcLear).to.be(true); // expect the first chat message to contain JohnMcLear
|
||||||
});
|
|
||||||
|
|
||||||
|
beforeEach(function(cb){ // create another pad..
|
||||||
|
helper.newPad(cb);
|
||||||
|
this.timeout(5000);
|
||||||
|
});
|
||||||
|
var rememberedName = $usernameInput.val() === "John McLear";
|
||||||
|
var rememberedWrongName = $usernameInput.val() === "Hairy Robot";
|
||||||
|
expect(rememberedName).to.be(true); // expect it to remember the name of the user
|
||||||
|
expect(rememberedWrongName).to.be(false); // expect it to forget any old names..
|
||||||
|
});
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue