add etag tests

- add shadowban self test
- add init and -it to docker runs
This commit is contained in:
Michael C
2023-02-20 15:56:08 -05:00
parent 81b0c27180
commit c586c9a7e7
3 changed files with 64 additions and 2 deletions

View File

@@ -410,6 +410,27 @@ describe("shadowBanUser", () => {
.catch(err => done(err));
});
it("Should be possible to ban self", (done) => {
const userID = VIPuserID;
const hashUserID = getHash(userID);
client({
method: "POST",
url: endpoint,
params: {
enabled: true,
userID: hashUserID,
categories: `["sponsor"]`,
unHideOldSubmissions: true,
adminUserID: userID,
}
})
.then(res => {
assert.strictEqual(res.status, 200);
done();
})
.catch(err => done(err));
});
it("Should be able to ban user by userID and other users who used that IP and hide specific category", (done) => {
const hashedIP = "shadowBannedIP8";
const userID = "shadowBanned8";