add action row component

This commit is contained in:
MapleLeaf
2021-12-27 02:37:15 -06:00
parent 5717d12e1f
commit c56abcaa34
4 changed files with 68 additions and 1 deletions

40
test/action-row.test.tsx Normal file
View File

@@ -0,0 +1,40 @@
import React from "react"
import { ActionRow, Button, Select } from "../library/main"
import { setupReacordTesting } from "./setup-testing"
const { assertRender } = setupReacordTesting()
test("action row", async () => {
await assertRender(
<>
<Button label="outside button" onClick={() => {}} />
<ActionRow>
<Button label="button inside action row" onClick={() => {}} />
</ActionRow>
<Select />
<Button label="last row 1" onClick={() => {}} />
<Button label="last row 2" onClick={() => {}} />
</>,
[
{
content: "",
embeds: [],
actionRows: [
[{ type: "button", style: "secondary", label: "outside button" }],
[
{
type: "button",
style: "secondary",
label: "button inside action row",
},
],
[{ type: "select", options: [], values: [] }],
[
{ type: "button", style: "secondary", label: "last row 1" },
{ type: "button", style: "secondary", label: "last row 2" },
],
],
},
],
)
})