Create use effect command (#419)
# Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. #380 ## Type of change Please delete options that are not relevant. - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update # How Has This Been Tested? Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration. # Checklist - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that provde my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules Reviewed-on: #419 Reviewed-by: VylpesTester <tester@vylpes.com> Co-authored-by: Ethan Lane <ethan@vylpes.com> Co-committed-by: Ethan Lane <ethan@vylpes.com>
This commit is contained in:
parent
3e81f8ce1d
commit
a3248e978a
42 changed files with 1241 additions and 1133 deletions
68
tests/helpers/DropHelpers/GetCardsHelper.test.ts
Normal file
68
tests/helpers/DropHelpers/GetCardsHelper.test.ts
Normal file
|
@ -0,0 +1,68 @@
|
|||
import GetCardsHelper from "../../../src/helpers/DropHelpers/GetCardsHelper";
|
||||
import EffectHelper from "../../../src/helpers/EffectHelper";
|
||||
import GetUnclaimedCardsHelper from "../../../src/helpers/DropHelpers/GetUnclaimedCardsHelper";
|
||||
import CardConstants from "../../../src/constants/CardConstants";
|
||||
|
||||
jest.mock("../../../src/helpers/EffectHelper");
|
||||
jest.mock("../../../src/helpers/DropHelpers/GetUnclaimedCardsHelper");
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
describe("FetchCard", () => {
|
||||
test("GIVEN user has the unclaimed effect AND unused chance is within constraint, EXPECT unclaimed card returned", async () => {
|
||||
// Arrange
|
||||
(EffectHelper.HasEffect as jest.Mock).mockResolvedValue(true);
|
||||
GetCardsHelper.GetRandomCard = jest.fn();
|
||||
Math.random = jest.fn().mockReturnValue(CardConstants.UnusedChanceUpChance - 0.1);
|
||||
|
||||
// Act
|
||||
await GetCardsHelper.FetchCard("userId");
|
||||
|
||||
// Assert
|
||||
expect(EffectHelper.HasEffect).toHaveBeenCalledTimes(1);
|
||||
expect(EffectHelper.HasEffect).toHaveBeenCalledWith("userId", "unclaimed");
|
||||
|
||||
expect(GetUnclaimedCardsHelper.GetRandomCardUnclaimed).toHaveBeenCalledTimes(1);
|
||||
expect(GetUnclaimedCardsHelper.GetRandomCardUnclaimed).toHaveBeenCalledWith("userId");
|
||||
|
||||
expect(GetCardsHelper.GetRandomCard).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test("GIVEN user has unclaimed effect AND unused chance is NOT within constraint, EXPECT random card returned", async () => {
|
||||
// Arrange
|
||||
(EffectHelper.HasEffect as jest.Mock).mockResolvedValue(true);
|
||||
GetCardsHelper.GetRandomCard = jest.fn();
|
||||
Math.random = jest.fn().mockReturnValue(CardConstants.UnusedChanceUpChance + 0.1);
|
||||
|
||||
// Act
|
||||
await GetCardsHelper.FetchCard("userId");
|
||||
|
||||
// Assert
|
||||
expect(EffectHelper.HasEffect).toHaveBeenCalledTimes(1);
|
||||
expect(EffectHelper.HasEffect).toHaveBeenCalledWith("userId", "unclaimed");
|
||||
|
||||
expect(GetCardsHelper.GetRandomCard).toHaveBeenCalledTimes(1);
|
||||
|
||||
expect(GetUnclaimedCardsHelper.GetRandomCardUnclaimed).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test("GIVEN user does NOT have unclaimed effect, EXPECT random card returned", async () => {
|
||||
// Arrange
|
||||
(EffectHelper.HasEffect as jest.Mock).mockResolvedValue(false);
|
||||
GetCardsHelper.GetRandomCard = jest.fn();
|
||||
Math.random = jest.fn().mockReturnValue(CardConstants.UnusedChanceUpChance + 0.1);
|
||||
|
||||
// Act
|
||||
await GetCardsHelper.FetchCard("userId");
|
||||
|
||||
// Assert
|
||||
expect(EffectHelper.HasEffect).toHaveBeenCalledTimes(1);
|
||||
expect(EffectHelper.HasEffect).toHaveBeenCalledWith("userId", "unclaimed");
|
||||
|
||||
expect(GetCardsHelper.GetRandomCard).toHaveBeenCalledTimes(1);
|
||||
|
||||
expect(GetUnclaimedCardsHelper.GetRandomCardUnclaimed).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
19
tests/helpers/DropHelpers/GetUnclaimedCardsHelper.test.ts
Normal file
19
tests/helpers/DropHelpers/GetUnclaimedCardsHelper.test.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
describe("GetRandomCardUnclaimed", () => {
|
||||
test.todo("GIVEN chance is within bronze chance, EXPECT bronze card returned");
|
||||
|
||||
test.todo("GIVEN chance is within silver chance, EXPECT silver card");
|
||||
|
||||
test.todo("GIVEN chance is within gold chance, EXPECT gold card returned");
|
||||
|
||||
test.todo("GIVEN chance is within manga chance, EXPECT manga card returned");
|
||||
});
|
||||
|
||||
describe("GetRandomCardByRarityUnclaimed", () => {
|
||||
test.todo("GIVEN user has no claimed cards, EXPECT random card returned");
|
||||
|
||||
test.todo("GIVEN no cards are found in memory, EXPECT undefined returned");
|
||||
|
||||
test.todo("GIVEN no series metadata is found for random card, EXPECT undefined returned");
|
||||
|
||||
test.todo("GIVEN user has claimed cards, EXPECT random card to NOT be this card");
|
||||
});
|
|
@ -1,380 +0,0 @@
|
|||
import {ActionRowBuilder, ButtonBuilder, EmbedBuilder} from "discord.js";
|
||||
import UserEffect from "../../src/database/entities/app/UserEffect";
|
||||
import EffectHelper from "../../src/helpers/EffectHelper";
|
||||
|
||||
describe("AddEffectToUserInventory", () => {
|
||||
describe("GIVEN effect is in database", () => {
|
||||
const effectMock = {
|
||||
AddUnused: jest.fn(),
|
||||
Save: jest.fn(),
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
UserEffect.FetchOneByUserIdAndName = jest.fn().mockResolvedValue(effectMock);
|
||||
|
||||
await EffectHelper.AddEffectToUserInventory("userId", "name", 1);
|
||||
});
|
||||
|
||||
test("EXPECT database to be fetched", () => {
|
||||
expect(UserEffect.FetchOneByUserIdAndName).toHaveBeenCalledTimes(1);
|
||||
expect(UserEffect.FetchOneByUserIdAndName).toHaveBeenCalledWith("userId", "name");
|
||||
});
|
||||
|
||||
test("EXPECT effect to be updated", () => {
|
||||
expect(effectMock.AddUnused).toHaveBeenCalledTimes(1);
|
||||
expect(effectMock.AddUnused).toHaveBeenCalledWith(1);
|
||||
});
|
||||
|
||||
test("EXPECT effect to be saved", () => {
|
||||
expect(effectMock.Save).toHaveBeenCalledTimes(1);
|
||||
expect(effectMock.Save).toHaveBeenCalledWith(UserEffect, effectMock);
|
||||
});
|
||||
});
|
||||
|
||||
describe("GIVEN effect is not in database", () => {
|
||||
beforeAll(async () => {
|
||||
UserEffect.FetchOneByUserIdAndName = jest.fn().mockResolvedValue(null);
|
||||
UserEffect.prototype.Save = jest.fn();
|
||||
|
||||
await EffectHelper.AddEffectToUserInventory("userId", "name", 1);
|
||||
});
|
||||
|
||||
test("EXPECT effect to be saved", () => {
|
||||
expect(UserEffect.prototype.Save).toHaveBeenCalledTimes(1);
|
||||
expect(UserEffect.prototype.Save).toHaveBeenCalledWith(UserEffect, expect.any(UserEffect));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("UseEffect", () => {
|
||||
describe("GIVEN effect is in database", () => {
|
||||
describe("GIVEN now is before effect.WhenExpires", () => {
|
||||
let result: boolean | undefined;
|
||||
|
||||
// nowMock < whenExpires
|
||||
const nowMock = new Date(2024, 11, 3, 13, 30);
|
||||
const whenExpires = new Date(2024, 11, 3, 14, 0);
|
||||
|
||||
const userEffect = {
|
||||
Unused: 1,
|
||||
WhenExpires: whenExpires,
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
jest.setSystemTime(nowMock);
|
||||
|
||||
UserEffect.FetchOneByUserIdAndName = jest.fn().mockResolvedValue(userEffect);
|
||||
|
||||
result = await EffectHelper.UseEffect("userId", "name", new Date());
|
||||
});
|
||||
|
||||
test("EXPECT false returned", () => {
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("GIVEN currently used effect is inactive", () => {
|
||||
let result: boolean | undefined;
|
||||
|
||||
// nowMock > whenExpires
|
||||
const nowMock = new Date(2024, 11, 3, 13, 30);
|
||||
const whenExpires = new Date(2024, 11, 3, 13, 0);
|
||||
const whenExpiresNew = new Date(2024, 11, 3, 15, 0);
|
||||
|
||||
const userEffect = {
|
||||
Unused: 1,
|
||||
WhenExpires: whenExpires,
|
||||
UseEffect: jest.fn(),
|
||||
Save: jest.fn(),
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
jest.setSystemTime(nowMock);
|
||||
|
||||
UserEffect.FetchOneByUserIdAndName = jest.fn().mockResolvedValue(userEffect);
|
||||
|
||||
result = await EffectHelper.UseEffect("userId", "name", whenExpiresNew);
|
||||
});
|
||||
|
||||
test("EXPECT UseEffect to be called", () => {
|
||||
expect(userEffect.UseEffect).toHaveReturnedTimes(1);
|
||||
expect(userEffect.UseEffect).toHaveBeenCalledWith(whenExpiresNew);
|
||||
});
|
||||
|
||||
test("EXPECT effect to be saved", () => {
|
||||
expect(userEffect.Save).toHaveBeenCalledTimes(1);
|
||||
expect(userEffect.Save).toHaveBeenCalledWith(UserEffect, userEffect);
|
||||
});
|
||||
|
||||
test("EXPECT true returned", () => {
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("GIVEN effect.WhenExpires is null", () => {
|
||||
let result: boolean | undefined;
|
||||
|
||||
// nowMock > whenExpires
|
||||
const nowMock = new Date(2024, 11, 3, 13, 30);
|
||||
const whenExpiresNew = new Date(2024, 11, 3, 15, 0);
|
||||
|
||||
const userEffect = {
|
||||
Unused: 1,
|
||||
WhenExpires: null,
|
||||
UseEffect: jest.fn(),
|
||||
Save: jest.fn(),
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
jest.setSystemTime(nowMock);
|
||||
|
||||
UserEffect.FetchOneByUserIdAndName = jest.fn().mockResolvedValue(userEffect);
|
||||
|
||||
result = await EffectHelper.UseEffect("userId", "name", whenExpiresNew);
|
||||
});
|
||||
|
||||
test("EXPECT UseEffect to be called", () => {
|
||||
expect(userEffect.UseEffect).toHaveBeenCalledTimes(1);
|
||||
expect(userEffect.UseEffect).toHaveBeenCalledWith(whenExpiresNew);
|
||||
});
|
||||
|
||||
test("EXPECT effect to be saved", () => {
|
||||
expect(userEffect.Save).toHaveBeenCalledTimes(1);
|
||||
expect(userEffect.Save).toHaveBeenCalledWith(UserEffect, userEffect);
|
||||
});
|
||||
|
||||
test("EXPECT true returned", () => {
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("GIVEN effect is not in database", () => {
|
||||
let result: boolean | undefined;
|
||||
|
||||
// nowMock > whenExpires
|
||||
const nowMock = new Date(2024, 11, 3, 13, 30);
|
||||
const whenExpiresNew = new Date(2024, 11, 3, 15, 0);
|
||||
|
||||
beforeAll(async () => {
|
||||
jest.setSystemTime(nowMock);
|
||||
|
||||
UserEffect.FetchOneByUserIdAndName = jest.fn().mockResolvedValue(null);
|
||||
|
||||
result = await EffectHelper.UseEffect("userId", "name", whenExpiresNew);
|
||||
});
|
||||
|
||||
test("EXPECT false returned", () => {
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("GIVEN effect.Unused is 0", () => {
|
||||
let result: boolean | undefined;
|
||||
|
||||
// nowMock > whenExpires
|
||||
const nowMock = new Date(2024, 11, 3, 13, 30);
|
||||
const whenExpiresNew = new Date(2024, 11, 3, 15, 0);
|
||||
|
||||
const userEffect = {
|
||||
Unused: 0,
|
||||
WhenExpires: null,
|
||||
UseEffect: jest.fn(),
|
||||
Save: jest.fn(),
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
jest.setSystemTime(nowMock);
|
||||
|
||||
UserEffect.FetchOneByUserIdAndName = jest.fn().mockResolvedValue(userEffect);
|
||||
|
||||
result = await EffectHelper.UseEffect("userId", "name", whenExpiresNew);
|
||||
});
|
||||
|
||||
test("EXPECT false returned", () => {
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("HasEffect", () => {
|
||||
describe("GIVEN effect is in database", () => {
|
||||
describe("GIVEN effect.WhenExpires is defined", () => {
|
||||
describe("GIVEN now is before effect.WhenExpires", () => {
|
||||
let result: boolean | undefined;
|
||||
|
||||
const nowMock = new Date(2024, 11, 3, 13, 30);
|
||||
const whenExpires = new Date(2024, 11, 3, 15, 0);
|
||||
|
||||
const userEffect = {
|
||||
WhenExpires: whenExpires,
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
jest.setSystemTime(nowMock);
|
||||
|
||||
UserEffect.FetchOneByUserIdAndName = jest.fn().mockResolvedValue(userEffect);
|
||||
|
||||
result = await EffectHelper.HasEffect("userId", "name");
|
||||
});
|
||||
|
||||
test("EXPECT true returned", () => {
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("GIVEN now is after effect.WhenExpires", () => {
|
||||
let result: boolean | undefined;
|
||||
|
||||
const nowMock = new Date(2024, 11, 3, 16, 30);
|
||||
const whenExpires = new Date(2024, 11, 3, 15, 0);
|
||||
|
||||
const userEffect = {
|
||||
WhenExpires: whenExpires,
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
jest.setSystemTime(nowMock);
|
||||
|
||||
UserEffect.FetchOneByUserIdAndName = jest.fn().mockResolvedValue(userEffect);
|
||||
|
||||
result = await EffectHelper.HasEffect("userId", "name");
|
||||
});
|
||||
|
||||
test("EXPECT false returned", () => {
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("GIVEN effect.WhenExpires is undefined", () => {
|
||||
let result: boolean | undefined;
|
||||
|
||||
const userEffect = {
|
||||
WhenExpires: undefined,
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
UserEffect.FetchOneByUserIdAndName = jest.fn().mockResolvedValue(userEffect);
|
||||
|
||||
result = await EffectHelper.HasEffect("userId", "name");
|
||||
});
|
||||
|
||||
test("EXPECT false returned", () => {
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("GIVEN effect is not in database", () => {
|
||||
let result: boolean | undefined;
|
||||
|
||||
beforeAll(async () => {
|
||||
UserEffect.FetchOneByUserIdAndName = jest.fn().mockResolvedValue(null);
|
||||
|
||||
result = await EffectHelper.HasEffect("userId", "name");
|
||||
});
|
||||
|
||||
test("EXPECT false returned", () => {
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("GenerateEffectEmbed", () => {
|
||||
beforeEach(async () => {
|
||||
UserEffect.FetchAllByUserIdPaginated = jest.fn()
|
||||
.mockResolvedValue([
|
||||
[],
|
||||
0,
|
||||
]);
|
||||
|
||||
await EffectHelper.GenerateEffectEmbed("userId", 1);
|
||||
});
|
||||
|
||||
test("EXPECT UserEffect.FetchAllByUserIdPaginated to be called", () => {
|
||||
expect(UserEffect.FetchAllByUserIdPaginated).toHaveBeenCalledTimes(1);
|
||||
expect(UserEffect.FetchAllByUserIdPaginated).toHaveBeenCalledWith("userId", 0, 10);
|
||||
});
|
||||
|
||||
describe("GIVEN there are no effects returned", () => {
|
||||
let result: {
|
||||
embed: EmbedBuilder,
|
||||
row: ActionRowBuilder<ButtonBuilder>,
|
||||
};
|
||||
|
||||
beforeEach(async () => {
|
||||
UserEffect.FetchAllByUserIdPaginated = jest.fn()
|
||||
.mockResolvedValue([
|
||||
[],
|
||||
0,
|
||||
]);
|
||||
|
||||
result = await EffectHelper.GenerateEffectEmbed("userId", 1);
|
||||
});
|
||||
|
||||
test("EXPECT result returned", () => {
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe("GIVEN there are effects returned", () => {
|
||||
let result: {
|
||||
embed: EmbedBuilder,
|
||||
row: ActionRowBuilder<ButtonBuilder>,
|
||||
};
|
||||
|
||||
beforeEach(async () => {
|
||||
UserEffect.FetchAllByUserIdPaginated = jest.fn()
|
||||
.mockResolvedValue([
|
||||
[
|
||||
{
|
||||
Name: "name",
|
||||
Unused: 1,
|
||||
},
|
||||
],
|
||||
1,
|
||||
]);
|
||||
|
||||
result = await EffectHelper.GenerateEffectEmbed("userId", 1);
|
||||
});
|
||||
|
||||
test("EXPECT result returned", () => {
|
||||
expect(result).toMatchSnapshot();
|
||||
});
|
||||
|
||||
describe("AND it is the first page", () => {
|
||||
beforeEach(async () => {
|
||||
result = await EffectHelper.GenerateEffectEmbed("userId", 1)
|
||||
});
|
||||
|
||||
test("EXPECT Previous button to be disabled", () => {
|
||||
const button = result.row.components[0].data as unknown as {
|
||||
label: string,
|
||||
disabled: boolean
|
||||
};
|
||||
|
||||
expect(button).toBeDefined();
|
||||
expect(button.label).toBe("Previous");
|
||||
expect(button.disabled).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("AND it is the last page", () => {
|
||||
beforeEach(async () => {
|
||||
result = await EffectHelper.GenerateEffectEmbed("userId", 1)
|
||||
});
|
||||
|
||||
test("EXPECT Next button to be disabled", () => {
|
||||
const button = result.row.components[1].data as unknown as {
|
||||
label: string,
|
||||
disabled: boolean
|
||||
};
|
||||
|
||||
expect(button).toBeDefined();
|
||||
expect(button.label).toBe("Next");
|
||||
expect(button.disabled).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
38
tests/helpers/TimeLengthInput.test.ts
Normal file
38
tests/helpers/TimeLengthInput.test.ts
Normal file
|
@ -0,0 +1,38 @@
|
|||
import TimeLengthInput from "../../src/helpers/TimeLengthInput";
|
||||
|
||||
describe("ConvertFromMilliseconds", () => {
|
||||
test("EXPECT 1000ms to be outputted as a second", () => {
|
||||
const timeLength = TimeLengthInput.ConvertFromMilliseconds(1000);
|
||||
expect(timeLength.GetLengthShort()).toBe("1s");
|
||||
});
|
||||
|
||||
test("EXPECT 60000ms to be outputted as a minute", () => {
|
||||
const timeLength = TimeLengthInput.ConvertFromMilliseconds(60000);
|
||||
expect(timeLength.GetLengthShort()).toBe("1m");
|
||||
});
|
||||
|
||||
test("EXPECT 3600000ms to be outputted as an hour", () => {
|
||||
const timeLength = TimeLengthInput.ConvertFromMilliseconds(3600000);
|
||||
expect(timeLength.GetLengthShort()).toBe("1h");
|
||||
});
|
||||
|
||||
test("EXPECT 86400000ms to be outputted as a day", () => {
|
||||
const timeLength = TimeLengthInput.ConvertFromMilliseconds(86400000);
|
||||
expect(timeLength.GetLengthShort()).toBe("1d");
|
||||
});
|
||||
|
||||
test("EXPECT a combination to be outputted correctly", () => {
|
||||
const timeLength = TimeLengthInput.ConvertFromMilliseconds(90061000);
|
||||
expect(timeLength.GetLengthShort()).toBe("1d 1h 1m 1s");
|
||||
});
|
||||
|
||||
test("EXPECT 0ms to be outputted as empty", () => {
|
||||
const timeLength = TimeLengthInput.ConvertFromMilliseconds(0);
|
||||
expect(timeLength.GetLengthShort()).toBe("");
|
||||
});
|
||||
|
||||
test("EXPECT 123456789ms to be outputted correctly", () => {
|
||||
const timeLength = TimeLengthInput.ConvertFromMilliseconds(123456789);
|
||||
expect(timeLength.GetLengthShort()).toBe("1d 10h 17m 36s");
|
||||
});
|
||||
});
|
|
@ -1,71 +0,0 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`GenerateEffectEmbed GIVEN there are effects returned EXPECT result returned 1`] = `
|
||||
{
|
||||
"embed": {
|
||||
"color": 3166394,
|
||||
"description": "name x1",
|
||||
"footer": {
|
||||
"icon_url": undefined,
|
||||
"text": "Page 1 of 1",
|
||||
},
|
||||
"title": "Effects",
|
||||
},
|
||||
"row": {
|
||||
"components": [
|
||||
{
|
||||
"custom_id": "effects list 0",
|
||||
"disabled": true,
|
||||
"emoji": undefined,
|
||||
"label": "Previous",
|
||||
"style": 1,
|
||||
"type": 2,
|
||||
},
|
||||
{
|
||||
"custom_id": "effects list 2",
|
||||
"disabled": true,
|
||||
"emoji": undefined,
|
||||
"label": "Next",
|
||||
"style": 1,
|
||||
"type": 2,
|
||||
},
|
||||
],
|
||||
"type": 1,
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateEffectEmbed GIVEN there are no effects returned EXPECT result returned 1`] = `
|
||||
{
|
||||
"embed": {
|
||||
"color": 3166394,
|
||||
"description": "*none*",
|
||||
"footer": {
|
||||
"icon_url": undefined,
|
||||
"text": "Page 1 of 1",
|
||||
},
|
||||
"title": "Effects",
|
||||
},
|
||||
"row": {
|
||||
"components": [
|
||||
{
|
||||
"custom_id": "effects list 0",
|
||||
"disabled": true,
|
||||
"emoji": undefined,
|
||||
"label": "Previous",
|
||||
"style": 1,
|
||||
"type": 2,
|
||||
},
|
||||
{
|
||||
"custom_id": "effects list 2",
|
||||
"disabled": true,
|
||||
"emoji": undefined,
|
||||
"label": "Next",
|
||||
"style": 1,
|
||||
"type": 2,
|
||||
},
|
||||
],
|
||||
"type": 1,
|
||||
},
|
||||
}
|
||||
`;
|
Loading…
Add table
Add a link
Reference in a new issue