vylbot-app/tests/buttonEvents/304276391837302787/moons.test.ts

21 lines
691 B
TypeScript
Raw Permalink Normal View History

2024-11-07 19:38:16 +00:00
import { ButtonInteraction } from "discord.js";
import Moons from "../../../src/buttonEvents/304276391837302787/moons";
import * as List from "../../../src/buttonEvents/304276391837302787/moons/list";
2024-11-01 14:52:38 +00:00
describe("GIVEN interaction action is list", () => {
2024-11-07 19:38:16 +00:00
const interaction = {
customId: "moons list",
} as unknown as ButtonInteraction;
const listSpy = jest.spyOn(List, "default");
beforeAll(async () => {
const moons = new Moons();
await moons.execute(interaction);
});
test("EXPECT List function to be called", () => {
expect(listSpy).toHaveBeenCalledTimes(1);
expect(listSpy).toHaveBeenCalledWith(interaction);
});
2024-11-01 14:52:38 +00:00
});