@@ -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