1 |
import type BaseClient from "@framework/client/BaseClient"; |
2 |
import { emoji } from "@framework/utils/emoji"; |
3 |
import { Collection, GuildEmoji } from "discord.js"; |
4 |
import { beforeEach, describe, expect, it } from "vitest"; |
5 |
import { createClient } from "../mocks/client.mock"; |
6 |
import { createGuild } from "../mocks/guild.mock"; |
7 |
|
8 |
describe("emoji", () => { |
9 |
let client: BaseClient; |
10 |
|
11 |
beforeEach(() => { |
12 |
client = { |
13 |
...createClient(), |
14 |
emojis: { |
15 |
cache: new Collection() |
16 |
} |
17 |
} as unknown as BaseClient; |
18 |
}); |
19 |
|
20 |
it("should return the emoji", () => { |
21 |
const testEmoji = { |
22 |
id: "emoji", |
23 |
name: "emoji", |
24 |
animated: false, |
25 |
available: true, |
26 |
createdAt: new Date(), |
27 |
createdTimestamp: 0, |
28 |
guild: createGuild(), |
29 |
identifier: "emoji", |
30 |
url: "emoji", |
31 |
toString() { |
32 |
return "emoji"; |
33 |
} |
34 |
} as GuildEmoji; |
35 |
client.emojis.cache.set("emoji", testEmoji); |
36 |
expect(emoji(client, "emoji")).toBe(testEmoji); |
37 |
}); |
38 |
}); |