@@ -287,37 +287,33 @@ describe("plugin detail route", () => {
287287 expect ( screen . queryByRole ( "dialog" ) ) . toBeNull ( ) ;
288288 } ) ;
289289
290- it . each ( [ 390 , 768 , 900 , 901 , 1366 , 1440 ] ) (
291- "keeps the same header, inline README and metadata rail at %ipx" ,
292- async ( width ) => {
293- setViewportWidth ( width ) ;
294- loaderDataMock . detail . package ! . latestVersion = "1.0.0" ;
295- loaderDataMock . readme = "Getting started with Demo" ;
296- const route = await loadRoute ( ) ;
297- const Component = route . __config . component as ComponentType ;
298- render ( < Component /> ) ;
290+ it ( "renders one install action, inline README and package details in the metadata rail" , async ( ) => {
291+ loaderDataMock . detail . package ! . latestVersion = "1.0.0" ;
292+ loaderDataMock . readme = "Getting started with Demo" ;
293+ const route = await loadRoute ( ) ;
294+ const Component = route . __config . component as ComponentType ;
295+ render ( < Component /> ) ;
299296
300- const heading = screen . getByRole ( "heading" , { level : 1 , name : "Demo Plugin" } ) ;
301- const hero = heading . closest < HTMLElement > ( ".catalog-detail__hero" ) ;
302- expect ( hero ?. closest ( ".catalog-detail" ) ) . toBeTruthy ( ) ;
303- expect ( within ( hero ! ) . getAllByRole ( "button" ) ) . toEqual ( [
304- within ( hero ! ) . getByRole ( "button" , { name : "Install" } ) ,
305- ] ) ;
306- expect ( within ( hero ! ) . queryByRole ( "link" , { name : "Download" } ) ) . toBeNull ( ) ;
307- const detailsTrigger = within ( screen . getByRole ( "complementary" ) ) . getByRole ( "button" , {
308- name : "Package details" ,
309- } ) ;
310- expect ( detailsTrigger . textContent ) . toBe ( "Package details" ) ;
311- expect ( screen . queryByRole ( "tablist" ) ) . toBeNull ( ) ;
312- expect ( screen . getByText ( "Getting started with Demo" ) ) . toBeTruthy ( ) ;
313- expect (
314- within ( screen . getByRole ( "complementary" ) ) . getByRole ( "group" , { name : "Plugin metadata" } ) ,
315- ) . toBeTruthy ( ) ;
316- expect (
317- within ( openPackageDetails ( ) ) . getByRole ( "link" , { name : "Download" } ) . getAttribute ( "href" ) ,
318- ) . toBe ( "/api/v1/packages/demo-plugin/download?version=1.0.0" ) ;
319- } ,
320- ) ;
297+ const heading = screen . getByRole ( "heading" , { level : 1 , name : "Demo Plugin" } ) ;
298+ const hero = heading . closest < HTMLElement > ( ".catalog-detail__hero" ) ;
299+ expect ( hero ?. closest ( ".catalog-detail" ) ) . toBeTruthy ( ) ;
300+ expect ( within ( hero ! ) . getAllByRole ( "button" ) ) . toEqual ( [
301+ within ( hero ! ) . getByRole ( "button" , { name : "Install" } ) ,
302+ ] ) ;
303+ expect ( within ( hero ! ) . queryByRole ( "link" , { name : "Download" } ) ) . toBeNull ( ) ;
304+ const detailsTrigger = within ( screen . getByRole ( "complementary" ) ) . getByRole ( "button" , {
305+ name : "Package details" ,
306+ } ) ;
307+ expect ( detailsTrigger . textContent ) . toBe ( "Package details" ) ;
308+ expect ( screen . queryByRole ( "tablist" ) ) . toBeNull ( ) ;
309+ expect ( screen . getByText ( "Getting started with Demo" ) ) . toBeTruthy ( ) ;
310+ expect (
311+ within ( screen . getByRole ( "complementary" ) ) . getByRole ( "group" , { name : "Plugin metadata" } ) ,
312+ ) . toBeTruthy ( ) ;
313+ expect (
314+ within ( openPackageDetails ( ) ) . getByRole ( "link" , { name : "Download" } ) . getAttribute ( "href" ) ,
315+ ) . toBe ( "/api/v1/packages/demo-plugin/download?version=1.0.0" ) ;
316+ } ) ;
321317
322318 it . each ( [
323319 { family : "bundle-plugin" , name : "discord" , href : "openclaw://plugins/install?name=discord" } ,
0 commit comments