Skip to content

Commit

Permalink
feat: mark keys as unstable + add vrchat home to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ariesclark committed Sep 27, 2024
1 parent 46daeaf commit c8c7f4c
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 24 deletions.
7 changes: 6 additions & 1 deletion tests/_users.ts
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
export const unstableUserKeys = ["last_login", "last_activity", "updated_at"];
export const unstableUserKeys = [
"last_login",
"last_activity",
"updated_at",
"currentAvatarTags"
];
25 changes: 19 additions & 6 deletions tests/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,25 @@ test.serial(testOperation, "createGroupInvite", () => ({
statusCode: 200
}));

test.serial(testOperation, "getGroupInvites", () => ({
parameters: {
groupId: state.get("groupId")
},
statusCode: 200
}));
test.serial(
testOperation,
"getGroupInvites",
() => ({
parameters: {
groupId: state.get("groupId")
},
statusCode: 200
}),
(t) => {
const { body } = t.context;
t.true(Array.isArray(body));

(body as Array<any>).map((member) => {
unstableValues.add(member.id);
unstableValues.add(member.createdAt);
});
}
);

test.serial(testOperation, "deleteGroupInvite", () => ({
parameters: {
Expand Down
15 changes: 1 addition & 14 deletions tests/instances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,6 @@ import { failUnauthenticated, test, testOperation } from "./_utilities.js";

test.before(failUnauthenticated);

const unstableInstanceKeys = [
"id",
"location",
"instanceId",
"name",
"type",
"ownerId",
"secureName",
"world",
"n_users",
"platforms"
];

const blackCatWorld = state.get("blackcat-world");

const blackCatWorldId = blackCatWorld.id;
Expand All @@ -28,7 +15,7 @@ test(testOperation, "getInstance", {
worldId: blackCatWorldId
},
statusCode: 200,
unstable: unstableInstanceKeys
unstable: true
});

test(testOperation, "getShortName", {
Expand Down
3 changes: 2 additions & 1 deletion tests/system.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { test, testOperation } from "./_utilities.js";

test(testOperation, "getConfig", {
statusCode: 200
statusCode: 200,
unstable: true
});

test("with zero parameters", testOperation, "getInfoPush", {
Expand Down
25 changes: 23 additions & 2 deletions tests/worlds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ import { state } from "./_cache.js";
import { failUnauthenticated, test, testOperation } from "./_utilities.js";

export const blackCatWorldId = "wrld_4cf554b4-430c-4f8f-b53e-1f294eed230b";
export const vrchatHomeWorldId = "wrld_4432ea9b-729c-46e3-8eaf-846aa0a37fdd";

const unstableWorldKeys = [
"imageUrl",
"thumbnailImageUrl",
"version",
"favorites",
"unityPackages",
"updated_at",
"visits",
"popularity",
"heat",
"publicOccupants",
"privateOccupants",
"udonProducts",
"occupants",
"instances"
];
Expand Down Expand Up @@ -57,7 +58,7 @@ test(
worldId: blackCatWorldId
},
statusCode: 200,
unstable: unstableWorldKeys
unstable: [...unstableWorldKeys, "unityPackages"]
},
(t) => {
t.is(
Expand All @@ -69,6 +70,26 @@ test(
}
);

test(
"(VRChat Home)",
testOperation,
"getWorld",
{
parameters: {
worldId: vrchatHomeWorldId
},
statusCode: 200,
unstable: unstableWorldKeys
},
(t) => {
t.is(
t.context.body.id,
vrchatHomeWorldId,
"Should have the correct world id"
);
}
);

test("by id", testOperation, "getWorldMetadata", {
parameters: {
worldId: blackCatWorldId
Expand Down

0 comments on commit c8c7f4c

Please sign in to comment.