mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-22 07:51:17 +01:00
more username/uuid tests
This commit is contained in:
parent
749403e81b
commit
a03ee5d979
26
test/test.js
26
test/test.js
@ -17,13 +17,37 @@ describe('Avatar Serving', function(){
|
||||
});
|
||||
describe('UUID', function(){
|
||||
it("should be an invalid uuid", function(done){
|
||||
assert.strictEqual(helpers.uuid_valid("invaliduuidexample"), false);
|
||||
assert.strictEqual(helpers.uuid_valid("g098cb60fa8e427cb299793cbd302c9a"), false);
|
||||
done();
|
||||
});
|
||||
it("should be an invalid uuid", function(done){
|
||||
assert.strictEqual(helpers.uuid_valid(""), false);
|
||||
done();
|
||||
});
|
||||
it("should be an invalid uuid", function(done){
|
||||
assert.strictEqual(helpers.uuid_valid("0098cb60-fa8e-427c-b299-793cbd302c9a"), false);
|
||||
done();
|
||||
});
|
||||
it("should be an invalid username", function(done){
|
||||
assert.strictEqual(helpers.uuid_valid("usernäme"), false);
|
||||
done();
|
||||
});
|
||||
it("should be an invalid username", function(done){
|
||||
assert.strictEqual(helpers.uuid_valid("user-name"), false);
|
||||
done();
|
||||
});
|
||||
it("should be an invalid username", function(done){
|
||||
assert.strictEqual(helpers.uuid_valid("ThisNameIsTooLong"), false);
|
||||
done();
|
||||
});
|
||||
it("should be a valid uuid", function(done){
|
||||
assert.strictEqual(helpers.uuid_valid("0098cb60fa8e427cb299793cbd302c9a"), true);
|
||||
done();
|
||||
});
|
||||
it("should be a valid username", function(done){
|
||||
assert.strictEqual(helpers.uuid_valid("__niceUs3rname__"), true);
|
||||
done();
|
||||
});
|
||||
it("should not exist", function(done){
|
||||
networking.get_profile("00000000000000000000000000000000", function(err, profile) {
|
||||
assert.strictEqual(err, 0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user