add lockCategories tests, getUserInfo

This commit is contained in:
Michael C
2022-09-21 02:27:48 -04:00
parent f683ed4f29
commit dd7656d143
2 changed files with 73 additions and 0 deletions

View File

@@ -263,6 +263,15 @@ describe("getUserInfo", () => {
.catch(err => done(err));
});
it("Should throw 400 with invalid array", (done) => {
client.get(endpoint, { params: { userID: "x", values: 123 } })
.then(res => {
assert.strictEqual(res.status, 400);
done(); // pass
})
.catch(err => done(err));
});
it("Should return 200 on userID not found", (done) => {
client.get(endpoint, { params: { userID: "notused-userid" } })
.then(res => {
@@ -307,4 +316,29 @@ describe("getUserInfo", () => {
})
.catch(err => done(err));
});
it("Should be able to get permissions", (done) => {
client.get(endpoint, { params: { userID: "getuserinfo_user_01", value: "permissions" } })
.then(res => {
assert.strictEqual(res.status, 200);
const expected = {
permissions: {
sponsor: true,
selfpromo: true,
exclusive_access: true,
interaction: true,
intro: true,
outro: true,
preview: true,
music_offtopic: true,
filler: true,
poi_highlight: true,
chapter: false,
},
};
assert.ok(partialDeepEquals(res.data, expected));
done(); // pass
})
.catch(err => done(err));
});
});