Skip to content

Commit a97f487

Browse files
refactor(cmsui): remove redundant comments
1 parent c33b599 commit a97f487

2 files changed

Lines changed: 0 additions & 12 deletions

File tree

packages/cmsui/components/ControlPanel/ControlPanelsList.test.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ import { describe, it, expect, vi } from 'vitest';
22
import { render, screen } from '@testing-library/react';
33
import { ControlPanelsList } from './ControlPanelsList';
44

5-
// The list renders a decorative icon per control panel. Under vitest the
6-
// `?react` SVG imports resolve to a data-URI string rather than a component,
7-
// so they must be stubbed before the component is rendered (same approach as
8-
// RecurrenceWidget.test.tsx). Factories are inlined because `vi.mock` is
9-
// hoisted above the imports.
105
vi.mock('@plone/components/icons/calendar.svg?react', () => ({
116
default: () => <svg />,
127
}));

packages/cmsui/routes/controlpanelAddons.test.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,8 @@ describe('Addons control panel route', () => {
156156
vi.resetModules();
157157
});
158158

159-
// Re-import the route with react-router hooks, Pluggable and auth mocked so
160-
// the default component can render in isolation (no router/provider tree).
161159
const renderPanel = async (fetcherData?: unknown, data = loaderData) => {
162160
vi.resetModules();
163-
// resetModules defeats Testing Library's auto-cleanup, so clear any DOM
164-
// left by a previous render to keep each render isolated.
165161
document.body.innerHTML = '';
166162

167163
vi.doMock('@plone/react-router', () => ({
@@ -172,8 +168,6 @@ describe('Addons control panel route', () => {
172168
Plug: ({ children }: { children: any }) => <>{children}</>,
173169
}));
174170

175-
// The `?react` SVG imports resolve to a data-URI string under vitest
176-
// (no SVGR transform); stub them with a real component so render works.
177171
const svgStub = (props: any) => <svg {...props} />;
178172
vi.doMock('@plone/components/icons/arrow-left.svg?react', () => ({
179173
default: svgStub,
@@ -209,7 +203,6 @@ describe('Addons control panel route', () => {
209203
it('groups installed and available site add-ons', async () => {
210204
const { screen } = await renderPanel();
211205

212-
// Section headings (i18n falls back to the raw key in tests).
213206
expect(
214207
screen.getByRole('heading', { name: 'cmsui.addons.installed' }),
215208
).toBeInTheDocument();

0 commit comments

Comments
 (0)