Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions plugins/follow-up/tests/ui/app.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { describe, expect, it } from "vitest";
import { loadPluginApp } from "@get-bb/plugin-sdk/testing/app";
// Loaded at the top, not inside a test: the first load pulls in every hugeicons icon,
// which can take longer than a test's 5s timeout on a busy machine.
import pluginApp from "../../app.tsx";
import type { PluginComposerApi } from "@get-bb/plugin-sdk/app";
import { setCollapsed, setRows } from "../../src/store.ts";
import type { FollowUp } from "../../lib/followups.ts";
Expand All @@ -18,7 +21,7 @@ const composerFor = (threadId: string) =>

describe("app.tsx", () => {
it("registers the palette commands", async () => {
const app = await loadPluginApp(() => import("../../app.tsx"));
const app = await loadPluginApp(pluginApp);
// The harness collects commands untyped; only the ids are read here.
const registered = (app as unknown as { commandPaletteActions: { id: string }[] })
.commandPaletteActions.map((command) => command.id);
Expand All @@ -32,7 +35,7 @@ describe("app.tsx", () => {
});

it("offers the + menu row whenever the thread has open rows, banner open or not", async () => {
const app = await loadPluginApp(() => import("../../app.tsx"));
const app = await loadPluginApp(pluginApp);
const item = app.composerCustomizations[0]?.plusMenu?.find((entry) => entry.id === "show-followups");
const disabled = item?.disabled;
expect(typeof disabled).toBe("function");
Expand Down
7 changes: 5 additions & 2 deletions plugins/follow-up/tests/ui/picker.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
import { fireEvent, waitFor } from "@testing-library/react";
import { useComposer, type ComposerMention, type PluginComposerApi } from "@get-bb/plugin-sdk/app";
import { loadPluginApp, renderSlot } from "@get-bb/plugin-sdk/testing/app";
// Loaded at the top, not inside a test: the first load pulls in every hugeicons icon,
// which can take longer than a test's 5s timeout on a busy machine.
import pluginApp from "../../app.tsx";
import { toast } from "sonner";
import {
FollowUpPicker,
Expand Down Expand Up @@ -180,7 +183,7 @@ describe("the picker", () => {

describe("the + menu row", () => {
async function plusRow() {
const app = await loadPluginApp(() => import("../../app.tsx"));
const app = await loadPluginApp(pluginApp);
const item = app.composerCustomizations[0]?.plusMenu?.find((entry) => entry.id === "show-followups");
expect(item).toBeDefined();
return item!;
Expand Down Expand Up @@ -212,7 +215,7 @@ describe("the + menu row", () => {
});

it("has the picker in its own thread-only customization", async () => {
const app = await loadPluginApp(() => import("../../app.tsx"));
const app = await loadPluginApp(pluginApp);
const picker = app.composerCustomizations.find((entry) => entry.id === "follow-up-picker");
expect(picker?.scopes).toEqual(["thread"]);
expect(picker?.experimental_popups?.map((popup) => popup.id)).toEqual([PICKER_POPUP_ID]);
Expand Down
7 changes: 5 additions & 2 deletions plugins/follow-up/tests/ui/record-draft.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { useComposer, useRpc, type ComposerMention, type PluginComposerApi, type PluginComposerScope } from "@get-bb/plugin-sdk/app";
import { loadPluginApp, renderSlot } from "@get-bb/plugin-sdk/testing/app";
// Loaded at the top, not inside a test: the first load pulls in every hugeicons icon,
// which can take longer than a test's 5s timeout on a busy machine.
import pluginApp from "../../app.tsx";
import { toast } from "sonner";
import {
recordCommand,
Expand Down Expand Up @@ -167,14 +170,14 @@ describe("the composer command", () => {

describe("app.tsx", () => {
it("puts the row in the send menu and has no action-row button", async () => {
const app = await loadPluginApp(() => import("../../app.tsx"));
const app = await loadPluginApp(pluginApp);
const customization = app.composerCustomizations[0];
expect(customization?.sendMenu?.map((item) => item.id)).toEqual(["record-as-follow-up"]);
expect(customization?.actions ?? []).toEqual([]);
});

it("reports a message action's refusal in a toast rather than opening the panel", async () => {
const app = await loadPluginApp(() => import("../../app.tsx"));
const app = await loadPluginApp(pluginApp);
const action = app.messageActions.find((entry) => entry.id === "record-follow-up");
rememberRpc({
call: async () => ({ outcome: "dismissed", id: null, followUps: [], done: [] }),
Expand Down
Loading