mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix: remove cloneChannel helper
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
import { DiscordenoChannel } from "../../../src/transformers/channel.ts";
|
||||
import { assertExists, assertEquals } from "../../deps.ts";
|
||||
import { bot, channel } from "../../mod.ts";
|
||||
import { delayUntil } from "../../utils.ts";
|
||||
|
||||
export async function cloneChannelTests(
|
||||
options: { reason?: string },
|
||||
) {
|
||||
// @ts-ignore for itoh
|
||||
const cloned = await bot.helpers.cloneChannel(channel, options.reason);
|
||||
|
||||
//Assertations
|
||||
assertExists(cloned);
|
||||
assertEquals(cloned.type, channel.type);
|
||||
|
||||
// Delay the execution to allow CHANNEL_CREATE event to be processed
|
||||
await delayUntil(10000, () => bot.channels.has(cloned.id));
|
||||
|
||||
assertExists(bot.channels.has(cloned.id));
|
||||
assertEquals(channel.topic, cloned.topic);
|
||||
assertEquals(channel.bitrate, cloned.bitrate);
|
||||
assertEquals(channel.permissionOverwrites.length, cloned.permissionOverwrites.length);
|
||||
}
|
||||
@@ -31,7 +31,6 @@ import { getGuildTests } from "./helpers/guilds/getGuild.ts";
|
||||
import { getVanityURLTests } from "./helpers/guilds/getVanityUrl.ts";
|
||||
import { categoryChildrenTest } from "./helpers/channels/categoryChannels.ts";
|
||||
import { channelOverwriteHasPermissionTest } from "./helpers/channels/channelOverwriteHasPermission.ts";
|
||||
import { cloneChannelTests } from "./helpers/channels/cloneChannel.ts";
|
||||
import { deleteChannelOverwriteTests } from "./helpers/channels/deleteChannelOverwrite.ts";
|
||||
import { editChannelTests } from "./helpers/channels/editChannel.ts";
|
||||
import { CACHED_COMMUNITY_GUILD_ID, sanitizeMode } from "./constants.ts";
|
||||
@@ -275,20 +274,6 @@ Deno.test({
|
||||
},
|
||||
...sanitizeMode,
|
||||
});
|
||||
Deno.test({
|
||||
name: "[channel] clone a channel w/o a reason",
|
||||
async fn(t) {
|
||||
await cloneChannelTests({});
|
||||
},
|
||||
...sanitizeMode,
|
||||
});
|
||||
Deno.test({
|
||||
name: "[channel] clone a channel w/ a reason",
|
||||
async fn(t) {
|
||||
await cloneChannelTests({ reason: "Blame wolf" });
|
||||
},
|
||||
...sanitizeMode,
|
||||
});
|
||||
Deno.test({
|
||||
name: "[channel] delete a channel overwrite",
|
||||
async fn(t) {
|
||||
|
||||
Reference in New Issue
Block a user