Fix existing tests
This commit is contained in:
parent
673f0d0810
commit
f9ab6c126e
1 changed files with 1 additions and 19 deletions
|
@ -85,25 +85,7 @@ test("GIVEN interaction.message was created more than 5 minutes ago, EXPECT erro
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(interaction.channel!.send).toHaveBeenCalledTimes(1);
|
expect(interaction.channel!.send).toHaveBeenCalledTimes(1);
|
||||||
expect(interaction.channel!.send).toHaveBeenCalledWith("[object Object], Cards can only be claimed within 5 minutes of it being dropped!");
|
expect(interaction.channel!.send).toHaveBeenCalledWith("[object Object], Cards can only be claimed within 2 minutes of it being dropped!");
|
||||||
|
|
||||||
expect(interaction.editReply).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
test("GIVEN user.RemoveCurrency fails, EXPECT error", async () => {
|
|
||||||
// Arrange
|
|
||||||
User.FetchOneById = jest.fn().mockResolvedValue({
|
|
||||||
RemoveCurrency: jest.fn().mockReturnValue(false),
|
|
||||||
Currency: 5,
|
|
||||||
});
|
|
||||||
|
|
||||||
// Act
|
|
||||||
const claim = new Claim();
|
|
||||||
await claim.execute(interaction as unknown as ButtonInteraction);
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
expect(interaction.channel!.send).toHaveBeenCalledTimes(1);
|
|
||||||
expect(interaction.channel!.send).toHaveBeenCalledWith("[object Object], Not enough currency! You need 10 currency, you have 5!");
|
|
||||||
|
|
||||||
expect(interaction.editReply).not.toHaveBeenCalled();
|
expect(interaction.editReply).not.toHaveBeenCalled();
|
||||||
});
|
});
|
Loading…
Add table
Reference in a new issue