mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 11:00:39 +02:00
add support for slim renders, fixes #125, adjust tests
This commit is contained in:
52
test/test.js
52
test/test.js
@@ -139,7 +139,7 @@ describe("Crafatar", function() {
|
||||
networking.get_profile(rid, "ec561538f3fd461daff5086b22154bce", function(err, profile) {
|
||||
assert.ifError(err);
|
||||
assert.notStrictEqual(profile, null);
|
||||
networking.get_uuid_url(profile, 1, function(url) {
|
||||
networking.get_uuid_info(profile, "CAPE", function(url) {
|
||||
assert.strictEqual(url, null);
|
||||
done();
|
||||
});
|
||||
@@ -548,17 +548,17 @@ describe("Crafatar", function() {
|
||||
"head render with existing username": {
|
||||
url: "http://localhost:3000/renders/head/jeb_?scale=2",
|
||||
etag: '"a846b82963"',
|
||||
crc32: [353633671, 370672768]
|
||||
crc32: [3487896679, 3001090792]
|
||||
},
|
||||
"head render with non-existent username": {
|
||||
url: "http://localhost:3000/renders/head/0?scale=2",
|
||||
etag: '"steve"',
|
||||
crc32: [883439147, 433083528]
|
||||
crc32: [3257141069, 214248305]
|
||||
},
|
||||
"head render with non-existent username defaulting to alex": {
|
||||
url: "http://localhost:3000/renders/head/0?scale=2&default=alex",
|
||||
etag: '"alex"',
|
||||
crc32: [1240086237, 1108800327]
|
||||
crc32: [263450586, 3116770561]
|
||||
},
|
||||
"head render with non-existent username defaulting to username": {
|
||||
url: "http://localhost:3000/avatars/0?scale=2&default=jeb_",
|
||||
@@ -578,17 +578,17 @@ describe("Crafatar", function() {
|
||||
"helm head render with existing username": {
|
||||
url: "http://localhost:3000/renders/head/jeb_?scale=2&helm",
|
||||
etag: '"a846b82963"',
|
||||
crc32: [3456497067, 3490318764]
|
||||
crc32: [762377383, 1726474987]
|
||||
},
|
||||
"helm head render with non-existent username": {
|
||||
url: "http://localhost:3000/renders/head/0?scale=2&helm",
|
||||
etag: '"steve"',
|
||||
crc32: [1858563554, 2647471936]
|
||||
crc32: [3257141069, 214248305]
|
||||
},
|
||||
"helm head render with non-existent username defaulting to alex": {
|
||||
url: "http://localhost:3000/renders/head/0?scale=2&helm&default=alex",
|
||||
etag: '"alex"',
|
||||
crc32: [2963161105, 1769904825]
|
||||
crc32: [263450586, 3116770561]
|
||||
},
|
||||
"helm head render with non-existent username defaulting to username": {
|
||||
url: "http://localhost:3000/renders/head/0?scale=2&helm&default=jeb_",
|
||||
@@ -608,17 +608,17 @@ describe("Crafatar", function() {
|
||||
"head render with existing uuid": {
|
||||
url: "http://localhost:3000/renders/head/853c80ef3c3749fdaa49938b674adae6?scale=2",
|
||||
etag: '"a846b82963"',
|
||||
crc32: [353633671, 370672768]
|
||||
crc32: [3487896679]
|
||||
},
|
||||
"head render with non-existent uuid": {
|
||||
url: "http://localhost:3000/renders/head/00000000000000000000000000000000?scale=2",
|
||||
etag: '"steve"',
|
||||
crc32: [883439147, 433083528]
|
||||
crc32: [3257141069, 214248305]
|
||||
},
|
||||
"head render with non-existent uuid defaulting to alex": {
|
||||
url: "http://localhost:3000/renders/head/00000000000000000000000000000000?scale=2&default=alex",
|
||||
etag: '"alex"',
|
||||
crc32: [1240086237, 1108800327]
|
||||
crc32: [263450586, 3116770561]
|
||||
},
|
||||
"head render with non-existent uuid defaulting to username": {
|
||||
url: "http://localhost:3000/renders/head/00000000000000000000000000000000?scale=2&default=jeb_",
|
||||
@@ -638,17 +638,17 @@ describe("Crafatar", function() {
|
||||
"helm head render with existing uuid": {
|
||||
url: "http://localhost:3000/renders/head/853c80ef3c3749fdaa49938b674adae6?scale=2&helm",
|
||||
etag: '"a846b82963"',
|
||||
crc32: [3456497067, 3490318764]
|
||||
crc32: [762377383]
|
||||
},
|
||||
"helm head render with non-existent uuid": {
|
||||
url: "http://localhost:3000/renders/head/00000000000000000000000000000000?scale=2&helm",
|
||||
etag: '"steve"',
|
||||
crc32: [1858563554, 2647471936]
|
||||
crc32: [3257141069, 214248305]
|
||||
},
|
||||
"helm head render with non-existent uuid defaulting to alex": {
|
||||
url: "http://localhost:3000/renders/head/00000000000000000000000000000000?scale=2&helm&default=alex",
|
||||
etag: '"alex"',
|
||||
crc32: [2963161105, 1769904825]
|
||||
crc32: [263450586, 3116770561]
|
||||
},
|
||||
"helm head with non-existent uuid defaulting to username": {
|
||||
url: "http://localhost:3000/renders/head/00000000000000000000000000000000?scale=2&helm&default=jeb_",
|
||||
@@ -668,17 +668,17 @@ describe("Crafatar", function() {
|
||||
"body render with existing username": {
|
||||
url: "http://localhost:3000/renders/body/jeb_?scale=2",
|
||||
etag: '"a846b82963"',
|
||||
crc32: [1291941229, 2628108474]
|
||||
crc32: [3127075871, 2595192206]
|
||||
},
|
||||
"body render with non-existent username": {
|
||||
url: "http://localhost:3000/renders/body/0?scale=2",
|
||||
etag: '"steve"',
|
||||
crc32: [2652947188, 2115706574]
|
||||
crc32: [1046655221, 1620063267]
|
||||
},
|
||||
"body render with non-existent username defaulting to alex": {
|
||||
url: "http://localhost:3000/renders/body/0?scale=2&default=alex",
|
||||
etag: '"alex"',
|
||||
crc32: [407932087, 2516216042]
|
||||
crc32: [549240598, 3952648540]
|
||||
},
|
||||
"body render with non-existent username defaulting to username": {
|
||||
url: "http://localhost:3000/renders/body/0?scale=2&default=jeb_",
|
||||
@@ -698,17 +698,17 @@ describe("Crafatar", function() {
|
||||
"helm body render with existing username": {
|
||||
url: "http://localhost:3000/renders/body/jeb_?scale=2&helm",
|
||||
etag: '"a846b82963"',
|
||||
crc32: [3556188297, 4269754007]
|
||||
crc32: [699892097, 2732138694]
|
||||
},
|
||||
"helm body render with non-existent username": {
|
||||
url: "http://localhost:3000/renders/body/0?scale=2&helm",
|
||||
etag: '"steve"',
|
||||
crc32: [272191039, 542896675]
|
||||
crc32: [1046655221, 1620063267]
|
||||
},
|
||||
"helm body render with non-existent username defaulting to alex": {
|
||||
url: "http://localhost:3000/renders/body/0?scale=2&helm&default=alex",
|
||||
etag: '"alex"',
|
||||
crc32: [737759773, 66512449]
|
||||
crc32: [549240598, 3952648540]
|
||||
},
|
||||
"helm body render with non-existent username defaulting to username": {
|
||||
url: "http://localhost:3000/renders/body/0?scale=2&helm&default=jeb_",
|
||||
@@ -728,17 +728,17 @@ describe("Crafatar", function() {
|
||||
"body render with existing uuid": {
|
||||
url: "http://localhost:3000/renders/body/853c80ef3c3749fdaa49938b674adae6?scale=2",
|
||||
etag: '"a846b82963"',
|
||||
crc32: [1291941229, 2628108474]
|
||||
crc32: [3127075871]
|
||||
},
|
||||
"body render with non-existent uuid": {
|
||||
url: "http://localhost:3000/renders/body/00000000000000000000000000000000?scale=2",
|
||||
etag: '"steve"',
|
||||
crc32: [2652947188, 2115706574]
|
||||
crc32: [1046655221, 1620063267]
|
||||
},
|
||||
"body render with non-existent uuid defaulting to alex": {
|
||||
url: "http://localhost:3000/renders/body/00000000000000000000000000000000?scale=2&default=alex",
|
||||
etag: '"alex"',
|
||||
crc32: [407932087, 2516216042]
|
||||
crc32: [549240598, 3952648540]
|
||||
},
|
||||
"body render with non-existent uuid defaulting to username": {
|
||||
url: "http://localhost:3000/renders/body/0?scale=2&default=jeb_",
|
||||
@@ -758,17 +758,17 @@ describe("Crafatar", function() {
|
||||
"helm body render with existing uuid": {
|
||||
url: "http://localhost:3000/renders/body/853c80ef3c3749fdaa49938b674adae6?scale=2&helm",
|
||||
etag: '"a846b82963"',
|
||||
crc32: [3556188297, 4269754007]
|
||||
crc32: [699892097]
|
||||
},
|
||||
"helm body render with non-existent uuid": {
|
||||
url: "http://localhost:3000/renders/body/00000000000000000000000000000000?scale=2&helm",
|
||||
etag: '"steve"',
|
||||
crc32: [272191039, 542896675]
|
||||
crc32: [1046655221, 1620063267]
|
||||
},
|
||||
"helm body render with non-existent uuid defaulting to alex": {
|
||||
url: "http://localhost:3000/renders/body/00000000000000000000000000000000?scale=2&helm&default=alex",
|
||||
etag: '"alex"',
|
||||
crc32: [737759773, 66512449]
|
||||
crc32: [549240598, 3952648540]
|
||||
},
|
||||
"helm body render with non-existent uuid defaulting to url": {
|
||||
url: "http://localhost:3000/renders/body/00000000000000000000000000000000?scale=2&helm&default=http%3A%2F%2Fexample.com",
|
||||
@@ -795,7 +795,7 @@ describe("Crafatar", function() {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
matches = (location.crc32 === crc(body));
|
||||
matches = location.crc32 === crc(body);
|
||||
}
|
||||
try {
|
||||
assert.ok(matches);
|
||||
|
||||
Reference in New Issue
Block a user