add channel renderer + try to simplify adapter generics
This commit is contained in:
2
test/channel-message-renderer.tsx
Normal file
2
test/channel-message-renderer.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
test.todo("channel message renderer")
|
||||
export {}
|
||||
@@ -6,7 +6,7 @@ import { setupReacordTesting } from "./setup-testing"
|
||||
test("rendering behavior", async () => {
|
||||
const { reacord, adapter, assertMessages } = setupReacordTesting()
|
||||
|
||||
const reply = reacord.createCommandReply(new TestCommandInteraction(adapter))
|
||||
const reply = reacord.reply(new TestCommandInteraction(adapter))
|
||||
reply.render(<KitchenSinkCounter onDeactivate={() => reply.deactivate()} />)
|
||||
|
||||
await assertMessages([
|
||||
@@ -244,7 +244,7 @@ test("rendering behavior", async () => {
|
||||
test("delete", async () => {
|
||||
const { reacord, adapter, assertMessages } = setupReacordTesting()
|
||||
|
||||
const reply = reacord.createCommandReply(new TestCommandInteraction(adapter))
|
||||
const reply = reacord.reply(new TestCommandInteraction(adapter))
|
||||
reply.render(
|
||||
<>
|
||||
some text
|
||||
|
||||
@@ -9,9 +9,9 @@ import { TestAdapter, TestCommandInteraction } from "../library/testing"
|
||||
const nextTickPromise = promisify(nextTick)
|
||||
|
||||
export function setupReacordTesting() {
|
||||
const adapter = new TestAdapter()
|
||||
const adapter = TestAdapter.create()
|
||||
const reacord = new Reacord({ adapter })
|
||||
const reply = reacord.createCommandReply(new TestCommandInteraction(adapter))
|
||||
const reply = reacord.reply(new TestCommandInteraction(adapter))
|
||||
|
||||
async function assertMessages(expected: ReturnType<typeof sampleMessages>) {
|
||||
await nextTickPromise() // wait for the render to complete
|
||||
|
||||
Reference in New Issue
Block a user