@@ -59,7 +59,7 @@ async function mockHardwareEndpoints(page: Page) {
5959}
6060
6161test . describe ( "CertSign tool - certificate source model" , ( ) => {
62- test ( "renders, accepts a PDF, and defaults to upload when no other sources exist " , async ( {
62+ test ( "skips the redundant source step and goes straight to certificate format when Upload is the only source " , async ( {
6363 page,
6464 } ) => {
6565 await page . route ( "**/api/v1/security/cert-sign" , ( route ) =>
@@ -76,12 +76,19 @@ test.describe("CertSign tool - certificate source model", () => {
7676 await uploadFiles ( page , SAMPLE_PDF ) ;
7777
7878 await expect ( page ) . toHaveURL ( / \/ c e r t - s i g n / ) ;
79- // With no server/ hardware sources, the picker collapses to a hint and the
80- // flow proceeds in the default MANUAL (upload) mode — no lone Upload CTA .
79+ // With no server cert or hardware token there is nothing to choose, so the
80+ // whole "Certificate source" step is hidden and the format picker shows directly .
8181 await expect (
82- page . getByText ( / n o o t h e r c e r t i f i c a t e s o u r c e s a r e a v a i l a b l e / i ) . first ( ) ,
82+ page . getByRole ( "button" , { name : / p k c s 1 2 / i } ) . first ( ) ,
8383 ) . toBeVisible ( { timeout : 10_000 } ) ;
84- await expect ( page . getByRole ( "button" , { name : / ^ u p l o a d $ / i } ) ) . toHaveCount (
84+ await expect ( page . getByText ( / c e r t i f i c a t e s o u r c e / i) ) . toHaveCount ( 0 ) ;
85+ await expect (
86+ page . getByText ( / n o o t h e r c e r t i f i c a t e s o u r c e s a r e a v a i l a b l e / i) ,
87+ ) . toHaveCount ( 0 ) ;
88+ await expect (
89+ page . getByRole ( "button" , { name : / t h i s d e v i c e / i } ) ,
90+ ) . toHaveCount ( 0 ) ;
91+ await expect ( page . getByRole ( "button" , { name : / ^ s e r v e r $ / i } ) ) . toHaveCount (
8592 0 ,
8693 ) ;
8794 } ) ;
@@ -93,9 +100,9 @@ test.describe("CertSign tool - certificate source model", () => {
93100 await page . waitForLoadState ( "domcontentloaded" ) ;
94101 await uploadFiles ( page , SAMPLE_PDF ) ;
95102
96- // No alternative sources: the picker is a hint , and hardware is never offered.
103+ // No alternative sources: the source step is hidden , and hardware is never offered.
97104 await expect (
98- page . getByText ( / n o o t h e r c e r t i f i c a t e s o u r c e s a r e a v a i l a b l e / i ) . first ( ) ,
105+ page . getByRole ( "button" , { name : / p k c s 1 2 / i } ) . first ( ) ,
99106 ) . toBeVisible ( { timeout : 10_000 } ) ;
100107 await expect (
101108 page . getByRole ( "button" , { name : / t h i s d e v i c e / i } ) ,
0 commit comments