action row component

This commit is contained in:
MapleLeaf
2021-12-21 23:47:42 -06:00
parent f53c6dba22
commit 7b3ce42138
5 changed files with 100 additions and 14 deletions

View File

@@ -5,7 +5,14 @@ import React from "react"
import { omit } from "../src/helpers/omit.js"
import { raise } from "../src/helpers/raise.js"
import type { ReacordRoot } from "../src/main.js"
import { Button, createRoot, Embed, EmbedField, Text } from "../src/main.js"
import {
ActionRow,
Button,
createRoot,
Embed,
EmbedField,
Text,
} from "../src/main.js"
import { testBotToken, testChannelId } from "./test-environment.js"
const client = new Client({
@@ -121,6 +128,9 @@ test("kitchen sink", async () => {
complex <Text>button</Text> text
</Button>
<Button disabled>disabled button</Button>
<ActionRow>
<Button>new action row</Button>
</ActionRow>
</>,
)
await assertMessages([
@@ -212,6 +222,17 @@ test("kitchen sink", async () => {
},
],
},
{
type: "ACTION_ROW",
components: [
{
type: "BUTTON",
label: "new action row",
style: "SECONDARY",
disabled: false,
},
],
},
],
},
])