fix(tests): remove unused old tests files

This commit is contained in:
Skillz4Killz
2022-05-30 22:19:19 +00:00
committed by GitHub
parent 6c464ce5c0
commit d51cf52a8c
6 changed files with 0 additions and 133 deletions

View File

@@ -1,14 +0,0 @@
import { assertEquals } from "../deps.ts";
import { bot } from "../mod.ts";
Deno.test({
name: "[member] format a members avatar url",
fn: async (t) => {
assertEquals(
bot.helpers.avatarURL(130136895395987456n, "8840", {
avatar: 4055337350987360625717955448021200177333n,
}),
"https://cdn.discordapp.com/avatars/130136895395987456/eae5905ad2d18d7c8deca20478b088b5.jpg?size=128",
);
},
});

View File

@@ -1,89 +0,0 @@
import { banCounters } from "../constants.ts";
import { assertEquals, assertExists } from "../deps.ts";
import { bot, guild } from "../mod.ts";
import { delayUntil } from "../utils.ts";
// THIS IS WOLF, IF ANYTHING BREAKS BLAME HIM!
const wolfID = 270273690074087427n;
// THIS IS IAN, HE PLAY'S GOLDEN SUN. BAN BEFORE HE MAKES US ADDICTED TO IT!!!
const ianID = 90339695967350784n;
// THESE BAN TESTS SHOULD BE DONE ONE BY ONE
Deno.test({
name: "[member] ban member test group",
fn: async (t) => {
await t.step({
name: "[member] ban user from guild without reason",
fn: async () => {
bot.events.guildBanAdd = function (_, user) {
banCounters.set(user.id, true);
};
await bot.helpers.banMember(guild.id, wolfID);
await delayUntil(10000, () => banCounters.get(wolfID));
assertEquals(banCounters.get(wolfID), true);
},
});
await t.step({
name: "[member] get a single user's ban",
fn: async () => {
assertExists(await bot.helpers.getBan(guild.id, 270273690074087427n));
},
});
await t.step({
name: "[member] ban member from guild with reason",
fn: async () => {
bot.events.guildBanAdd = function (_, user) {
banCounters.set(user.id, true);
};
await bot.helpers.banMember(guild.id, ianID, { reason: "Blame Wolf" });
await delayUntil(10000, () => banCounters.get(ianID));
assertEquals(banCounters.get(wolfID), true);
},
});
await t.step({
name: "[member] get bans on a server",
fn: async () => {
const bans = await bot.helpers.getBans(guild.id);
assertEquals(bans.size > 1, true);
},
});
await t.step({
name: "[member] fetch a single member by id",
fn: async () => {
await bot.helpers.fetchMembers(guild.id, 0, {
userIds: [bot.id],
limit: 1,
});
// Assertions
assertExists(bot.members.get(BigInt(`${bot.id}${guild.id}`)));
},
});
await t.step({
name: "[member] unban member from guild",
fn: async () => {
bot.events.guildBanRemove = function (bot, user, guildId) {
banCounters.set(user.id, false);
};
await Promise.all([bot.helpers.unbanMember(guild.id, wolfID), bot.helpers.unbanMember(guild.id, ianID)]);
await delayUntil(10000, () => !banCounters.get(wolfID) && !banCounters.get(ianID));
assertEquals(banCounters.get(wolfID), false);
assertEquals(banCounters.get(ianID), false);
},
});
},
});

View File

@@ -1,8 +0,0 @@
import { assertEquals } from "../deps.ts";
import { bot, guild } from "../mod.ts";
Deno.test("[misc] edit a bot's nickname", async function () {
const nick = "lts20050703";
const nickname = await bot.helpers.editBotNickname(guild.id, { nick });
assertEquals(nickname, nick);
});

View File

@@ -1,7 +0,0 @@
import { bot } from "../mod.ts";
Deno.test("[member] get dm channel and send a message", async () => {
// Itoh Alt ID
const channel = await bot.helpers.getDmChannel(750661528360845322n);
await bot.helpers.sendMessage(channel.id, { content: "https://i.imgur.com/doG55NR.png" });
});

View File

@@ -1,7 +0,0 @@
import { bot, guild } from "../mod.ts";
import { assertEquals } from "../deps.ts";
Deno.test("[member] fetches the bot and compares the bot's id with the fetched member's id", async () => {
const member = await bot.helpers.getMember(guild.id, bot.id);
assertEquals(member.id, bot.id);
});

View File

@@ -1,8 +0,0 @@
import { bot } from "../mod.ts";
import { CACHED_COMMUNITY_GUILD_ID } from "../constants.ts";
import { assertEquals } from "../deps.ts";
Deno.test("[member] Gets a member list and checks if the bot is in the member list", async () => {
const members = await bot.helpers.getMembers(CACHED_COMMUNITY_GUILD_ID, { memberCount: 10 });
assertEquals(members.has(bot.id), true);
});