Compare commits
No commits in common. "6e6b2a0af61cf0c9ce3f274d90ecb3e47a544537" and "7944b3aeac223ae8c0468fc151c5b11cfd51e336" have entirely different histories.
6e6b2a0af6
...
7944b3aeac
4 changed files with 4 additions and 85 deletions
|
@ -60,7 +60,7 @@ export default class EffectHelper {
|
|||
const effects = query[0];
|
||||
const count = query[1];
|
||||
|
||||
const totalPages = count > 0 ? Math.ceil(count / itemsPerPage) : 1;
|
||||
const isLastPage = Math.ceil(count / itemsPerPage) - 1 == page;
|
||||
|
||||
let description = "*none*";
|
||||
|
||||
|
@ -71,8 +71,7 @@ export default class EffectHelper {
|
|||
const embed = new EmbedBuilder()
|
||||
.setTitle("Effects")
|
||||
.setDescription(description)
|
||||
.setColor(EmbedColours.Ok)
|
||||
.setFooter({ text: `Page ${page} of ${totalPages}` });
|
||||
.setColor(EmbedColours.Ok);
|
||||
|
||||
const row = new ActionRowBuilder<ButtonBuilder>()
|
||||
.addComponents(
|
||||
|
@ -80,12 +79,12 @@ export default class EffectHelper {
|
|||
.setCustomId(`effects list ${page - 1}`)
|
||||
.setLabel("Previous")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setDisabled(page - 1 == 0),
|
||||
.setDisabled(page == 0),
|
||||
new ButtonBuilder()
|
||||
.setCustomId(`effects list ${page + 1}`)
|
||||
.setLabel("Next")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setDisabled(page == totalPages),
|
||||
.setDisabled(isLastPage),
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
describe("execute", () => {
|
||||
describe("GIVEN action in custom id is list", () => {
|
||||
test.todo("EXPECT list function to be called");
|
||||
});
|
||||
});
|
||||
|
||||
describe("List", () => {
|
||||
describe("GIVEN page is a valid number", () => {
|
||||
test.todo("EXPECT EffectHelper.GenerateEffectEmbed to be called");
|
||||
|
||||
test.todo("EXPECT interaction to be updated");
|
||||
});
|
||||
|
||||
describe("GIVEN page in custom id is not supplied", () => {
|
||||
test.todo("EXPECT interaction to be replied with error");
|
||||
|
||||
test.todo("EXPECT interaction to not be updated");
|
||||
});
|
||||
|
||||
describe("GIVEN page in custom id is not a number", () => {
|
||||
test.todo("EXPECT interaction to be replied with error");
|
||||
|
||||
test.todo("EXPECT interaction to not be updated");
|
||||
});
|
||||
});
|
|
@ -1,31 +0,0 @@
|
|||
describe("constructor", () => {
|
||||
test.todo("EXPECT CommandBuilder to be defined");
|
||||
});
|
||||
|
||||
describe("execute", () => {
|
||||
describe("GIVEN interaction is not a chat input command", () => {
|
||||
test.todo("EXPECT nothing to happen");
|
||||
});
|
||||
|
||||
describe("GIVEN subcommand is list", () => {
|
||||
test.todo("EXPECT list function to be called");
|
||||
});
|
||||
});
|
||||
|
||||
describe("List", () => {
|
||||
describe("GIVEN page option is supplied", () => {
|
||||
describe("AND page is a valid number", () => {
|
||||
test.todo("EXPECT EffectHelper.GenerateEffectEmbed to have been called with page");
|
||||
|
||||
test.todo("EXPECT interaction to have been replied");
|
||||
});
|
||||
|
||||
describe("AND page is not a valid number", () => {
|
||||
test.todo("EXPECT EffectHelper.GenerateEffectEmbed to have been called with page of 1");
|
||||
});
|
||||
});
|
||||
|
||||
describe("GIVEN page option is not supplied", () => {
|
||||
test.todo("EXPECT EffectHelper.GenerateEffectEmbed to have been called with a page of 1");
|
||||
});
|
||||
});
|
|
@ -279,27 +279,3 @@ describe("HasEffect", () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("GenerateEffectEmbed", () => {
|
||||
test.todo("EXPECT UserEffect.FetchAllByUserIdPaginated to be called");
|
||||
|
||||
describe("GIVEN there are no effects returned", () => {
|
||||
test.todo("EXPECT embed generated");
|
||||
|
||||
test.todo("EXPECT row generated");
|
||||
});
|
||||
|
||||
describe("GIVEN there are effects returned", () => {
|
||||
test.todo("EXPECT embed generated");
|
||||
|
||||
test.todo("EXPECT row generated");
|
||||
|
||||
describe("AND it is the first page", () => {
|
||||
test.todo("EXPECT Previous button to be disabled");
|
||||
});
|
||||
|
||||
describe("AND it is the last page", () => {
|
||||
test.todo("EXPECT Next button to be disabled");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue