vylbot-app/tests/buttonEvents/304276391837302787/moons.test.ts
Ethan Lane 056783bc44
All checks were successful
Test / build (push) Successful in 18s
WIP: Create add moon command tests
2024-11-07 19:38:16 +00:00

21 lines
No EOL
691 B
TypeScript

import { ButtonInteraction } from "discord.js";
import Moons from "../../../src/buttonEvents/304276391837302787/moons";
import * as List from "../../../src/buttonEvents/304276391837302787/moons/list";
describe("GIVEN interaction action is list", () => {
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);
});
});