2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

Upgrade QUnit to latest version

This commit is contained in:
Robin Ward 2017-06-14 13:57:58 -04:00
parent 8ae445766f
commit cc525b1a8d
145 changed files with 7569 additions and 6763 deletions

View file

@ -7,7 +7,7 @@ acceptance("Invite Accept", {
}
});
test("Invite Acceptance Page", () => {
QUnit.test("Invite Acceptance Page", assert => {
PreloadStore.store('invite_info', {
invited_by: {"id":123,"username":"neil","avatar_template":"/user_avatar/localhost/neil/{size}/25_1.png","name":"Neil Lalonde","title":"team"},
email: "invited@asdf.com",
@ -16,35 +16,35 @@ test("Invite Acceptance Page", () => {
visit("/invites/myvalidinvitetoken");
andThen(() => {
ok(exists("#new-account-username"), "shows the username input");
equal(find("#new-account-username").val(), "invited", "username is prefilled");
ok(exists("#new-account-name"), "shows the name input");
ok(exists("#new-account-password"), "shows the password input");
ok(exists('.invites-show .btn-primary:disabled'), 'submit is disabled because name is not filled');
assert.ok(exists("#new-account-username"), "shows the username input");
assert.equal(find("#new-account-username").val(), "invited", "username is prefilled");
assert.ok(exists("#new-account-name"), "shows the name input");
assert.ok(exists("#new-account-password"), "shows the password input");
assert.ok(exists('.invites-show .btn-primary:disabled'), 'submit is disabled because name is not filled');
});
fillIn("#new-account-name", 'John Doe');
andThen(() => {
not(exists('.invites-show .btn-primary:disabled'), 'submit is enabled');
assert.not(exists('.invites-show .btn-primary:disabled'), 'submit is enabled');
});
fillIn("#new-account-username", 'a');
andThen(() => {
ok(exists(".username-input .bad"), "username is not valid");
ok(exists('.invites-show .btn-primary:disabled'), 'submit is disabled');
assert.ok(exists(".username-input .bad"), "username is not valid");
assert.ok(exists('.invites-show .btn-primary:disabled'), 'submit is disabled');
});
fillIn("#new-account-password", 'aaa');
andThen(() => {
ok(exists(".password-input .bad"), "password is not valid");
ok(exists('.invites-show .btn-primary:disabled'), 'submit is disabled');
assert.ok(exists(".password-input .bad"), "password is not valid");
assert.ok(exists('.invites-show .btn-primary:disabled'), 'submit is disabled');
});
fillIn("#new-account-username", 'validname');
fillIn("#new-account-password", 'secur3ty4Y0uAndMe');
andThen(() => {
ok(exists(".username-input .good"), "username is valid");
ok(exists(".password-input .good"), "password is valid");
not(exists('.invites-show .btn-primary:disabled'), 'submit is enabled');
assert.ok(exists(".username-input .good"), "username is valid");
assert.ok(exists(".password-input .good"), "password is valid");
assert.not(exists('.invites-show .btn-primary:disabled'), 'submit is enabled');
});
});