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
4 changes: 2 additions & 2 deletions packages/cms-admin/src/components/editor/rich-text-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
IconUnderline, IconSuperscript, IconSubscript, IconHighlight,
IconZoomIn, IconZoomOut, IconProofread,
} from "./editor-icons";
import { Image as LucideImage, Zap, MessageSquareWarning, Code2, ChevronDown, Braces, Shapes } from "lucide-react";
import { Image as LucideImage, Zap, MessageSquareWarning, Code2, ChevronDown, Braces, Shapes, RemoveFormatting } from "lucide-react";
import { toast } from "sonner";
import { AIMetadataPopover } from "@/components/media/ai-metadata-popover";
import { ProofreadPlugin, proofreadKey, textOffsetToPos } from "./proofread-plugin";
Expand Down Expand Up @@ -3163,7 +3163,7 @@ function RichTextEditorInner({ value, onChange, disabled, stickyOffset = 132, fe
{(has("bold") || has("italic") || has("strike") || has("code")) && <Btn
tooltip="Clear formatting" testId="clear-formatting-button"
onClick={() => editor.chain().focus().unsetAllMarks().clearNodes().run()}>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M4 7V4h16v3"/><path d="M5 20h6"/><path d="M13 4 8 20"/><path d="m15 15 5 5"/><path d="m20 15-5 5"/></svg>
<RemoveFormatting size={16} />
</Btn>}

{(has("bold") || has("italic") || has("strike") || has("code")) && <Sep />}
Expand Down
10 changes: 5 additions & 5 deletions packages/cms-admin/src/lib/__tests__/webhook-dispatch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe("Webhook Dispatch", () => {
});

it("returns empty array for empty webhooks list", async () => {
const results = await dispatchWebhooks([], baseEvent, mockFetch);
const results = await dispatchWebhooks([], baseEvent, mockFetch as unknown as typeof fetch);
expect(results).toEqual([]);
expect(mockFetch).not.toHaveBeenCalled();
});
Expand All @@ -194,7 +194,7 @@ describe("Webhook Dispatch", () => {
{ id: "2", url: "https://hooks.slack.com/services/T/B/x" },
{ id: "3", url: "https://example.com/hook" },
];
const results = await dispatchWebhooks(webhooks, baseEvent, mockFetch);
const results = await dispatchWebhooks(webhooks, baseEvent, mockFetch as unknown as typeof fetch);
expect(mockFetch).toHaveBeenCalledTimes(3);
expect(results).toHaveLength(3);
expect(results.every((r) => r.success)).toBe(true);
Expand All @@ -211,7 +211,7 @@ describe("Webhook Dispatch", () => {
{ id: "2", url: "https://example.com/b" },
{ id: "3", url: "https://example.com/c" },
];
const results = await dispatchWebhooks(webhooks, baseEvent, mockFetch);
const results = await dispatchWebhooks(webhooks, baseEvent, mockFetch as unknown as typeof fetch);
expect(results[0].success).toBe(true);
expect(results[1].success).toBe(false);
expect(results[1].error).toContain("Connection refused");
Expand All @@ -221,7 +221,7 @@ describe("Webhook Dispatch", () => {
it("reports HTTP error status codes", async () => {
mockFetch.mockResolvedValue({ ok: false, status: 404 });
const webhooks: WebhookEntry[] = [{ id: "1", url: "https://example.com/hook" }];
const results = await dispatchWebhooks(webhooks, baseEvent, mockFetch);
const results = await dispatchWebhooks(webhooks, baseEvent, mockFetch as unknown as typeof fetch);
expect(results[0].success).toBe(false);
expect(results[0].statusCode).toBe(404);
});
Expand All @@ -232,7 +232,7 @@ describe("Webhook Dispatch", () => {
{ id: "2", url: "https://hooks.slack.com/services/T/B/x" },
{ id: "3", url: "https://example.com/hook" },
];
await dispatchWebhooks(webhooks, baseEvent, mockFetch);
await dispatchWebhooks(webhooks, baseEvent, mockFetch as unknown as typeof fetch);

// Discord
const discordBody = JSON.parse(mockFetch.mock.calls[0][1].body);
Expand Down
Loading