more sensible test

This commit is contained in:
itsMapleLeaf
2022-07-27 18:30:34 -05:00
parent 42d1541697
commit 528e600f1a

View File

@@ -55,49 +55,29 @@ await createTest(
"buttons", "buttons",
"should show button text, emojis, and make automatic action rows", "should show button text, emojis, and make automatic action rows",
async (channel) => { async (channel) => {
const propCombinations = generatePropCombinations<ButtonProps>({ reacord.send(
style: ["primary", "secondary", "success", "danger"], channel.id,
emoji: ["🍓", undefined], <>
disabled: [true, false, undefined], <Button label="strawberry" onClick={() => {}} />
label: ["label prop", undefined], <Button emoji="🍓" onClick={() => {}} />
children: ["children prop", undefined], <Button label="strawberry" emoji="🍓" onClick={() => {}} />
onClick: [() => {}], </>,
}).filter((combination) => combination.label || combination.emoji) )
reacord.send(
for (const combinations of chunk(propCombinations, 8)) { channel.id,
reacord.send( <>
channel.id, <Button label="primary" style="primary" onClick={() => {}} />
combinations.map((combination, index) => ( <Button label="secondary" style="secondary" onClick={() => {}} />
<Button <Button label="success" style="success" onClick={() => {}} />
key={index} <Button label="danger" style="danger" onClick={() => {}} />
{...combination} </>,
label={ )
combination.label && reacord.send(
[ channel.id,
combination.label, <>
combination.style || "secondary (default)", <Button label="disabled" disabled onClick={() => {}} />
combination.emoji && "emoji", </>,
combination.disabled && "disabled", )
]
.filter(Boolean)
.join(" + ")
}
// eslint-disable-next-line react/no-children-prop
children={
combination.children &&
[
combination.children,
combination.style || "secondary (default)",
combination.emoji && "emoji",
combination.disabled && "disabled",
]
.filter(Boolean)
.join(" + ")
}
/>
)),
)
}
}, },
) )