@@ -82,6 +82,7 @@ vi.mock('@tanstack/react-router', async (importOriginal) => {
8282 useNavigate : ( ) => mockNavigate ,
8383 useRouter : ( ) => ( { history : { back : mockBack , canGoBack : ( ) => true } } ) ,
8484 useSearch : ( ) => mockSearch ( ) ,
85+ useBlocker : ( ) => ( { status : 'idle' , proceed : undefined , reset : undefined } ) ,
8586 } ;
8687} ) ;
8788
@@ -265,6 +266,16 @@ function createTransport(overrides?: {
265266 } ) ;
266267}
267268
269+ // The pipeline name now lives in the settings dialog (opened via "Edit settings")
270+ // rather than an inline field in the header.
271+ const setPipelineNameViaDialog = async ( user : ReturnType < typeof userEvent . setup > , name : string ) => {
272+ await user . click ( screen . getByRole ( 'button' , { name : / e d i t s e t t i n g s / i } ) ) ;
273+ const nameInput = await screen . findByPlaceholderText ( 'Enter pipeline name' ) ;
274+ await user . clear ( nameInput ) ;
275+ await user . type ( nameInput , name ) ;
276+ await user . click ( screen . getByRole ( 'button' , { name : / s a v e s e t t i n g s / i } ) ) ;
277+ } ;
278+
268279describe ( 'PipelinePage' , ( ) => {
269280 beforeEach ( ( ) => {
270281 mockNavigate . mockClear ( ) ;
@@ -370,12 +381,7 @@ describe('PipelinePage', () => {
370381
371382 render ( < PipelinePage /> , { transport : createTransport ( { createPipelineMock } ) } ) ;
372383
373- // EditableText with defaultEditing starts in edit mode — use placeholder to find the input
374- const nameInput = screen . getByPlaceholderText ( 'Pipeline name' ) ;
375- await user . clear ( nameInput ) ;
376- await user . type ( nameInput , 'my-pipeline' ) ;
377- // Tab to commit the EditableText value (fires onChange -> handleNameChange -> form.setValue)
378- await user . tab ( ) ;
384+ await setPipelineNameViaDialog ( user , 'my-pipeline' ) ;
379385
380386 // Set YAML via the textarea mock
381387 const yamlEditor = screen . getByTestId ( 'yaml-editor' ) ;
@@ -406,11 +412,7 @@ describe('PipelinePage', () => {
406412
407413 render ( < PipelinePage /> , { transport : createTransport ( { createPipelineMock } ) } ) ;
408414
409- // Fill in name (min 3 chars for validation)
410- const nameInput = screen . getByPlaceholderText ( 'Pipeline name' ) ;
411- await user . clear ( nameInput ) ;
412- await user . type ( nameInput , 'my-pipeline' ) ;
413- await user . tab ( ) ;
415+ await setPipelineNameViaDialog ( user , 'my-pipeline' ) ;
414416
415417 // Set YAML and click Save
416418 const yamlEditor = screen . getByTestId ( 'yaml-editor' ) ;
@@ -441,11 +443,7 @@ describe('PipelinePage', () => {
441443
442444 render ( < PipelinePage /> , { transport : createTransport ( { createPipelineMock, lintMock } ) } ) ;
443445
444- // Fill in name
445- const nameInput = screen . getByPlaceholderText ( 'Pipeline name' ) ;
446- await user . clear ( nameInput ) ;
447- await user . type ( nameInput , 'my-pipeline' ) ;
448- await user . tab ( ) ;
446+ await setPipelineNameViaDialog ( user , 'my-pipeline' ) ;
449447
450448 // Set YAML (triggers lint query which returns response warning)
451449 const yamlEditor = screen . getByTestId ( 'yaml-editor' ) ;
@@ -483,11 +481,7 @@ describe('PipelinePage', () => {
483481
484482 render ( < PipelinePage /> , { transport : createTransport ( { createPipelineMock, lintMock } ) } ) ;
485483
486- // Fill in name
487- const nameInput = screen . getByPlaceholderText ( 'Pipeline name' ) ;
488- await user . clear ( nameInput ) ;
489- await user . type ( nameInput , 'my-pipeline' ) ;
490- await user . tab ( ) ;
484+ await setPipelineNameViaDialog ( user , 'my-pipeline' ) ;
491485
492486 // Set YAML
493487 const yamlEditor = screen . getByTestId ( 'yaml-editor' ) ;
@@ -532,15 +526,15 @@ describe('PipelinePage', () => {
532526 } ) ;
533527 } ) ;
534528
535- it ( 'displays the pipeline display name (not the ID) in view mode' , async ( ) => {
529+ it ( 'displays the pipeline display name in the summary in view mode' , async ( ) => {
536530 mockUsePipelineMode . mockReturnValue ( { mode : 'view' , pipelineId : 'test-pipeline' } ) ;
537531
538532 render ( < PipelinePage /> , { transport : createTransport ( ) } ) ;
539533
540- // The toolbar title (level-1 heading) should show the displayName from the pipeline
541- // response, not the pipeline ID. The ID is shown separately in the Configuration section .
542- expect ( await screen . findByRole ( 'heading' , { level : 1 , name : 'Test Pipeline' } ) ) . toBeInTheDocument ( ) ;
543- expect ( screen . queryByRole ( 'heading' , { level : 1 , name : 'test-pipeline ' } ) ) . not . toBeInTheDocument ( ) ;
534+ // The page title (level-1 heading) is static; the displayName is shown
535+ // prominently as the summary card heading, with the ID as a labeled field below .
536+ expect ( await screen . findByRole ( 'heading' , { level : 1 , name : 'Pipeline view ' } ) ) . toBeInTheDocument ( ) ;
537+ expect ( await screen . findByRole ( 'heading' , { level : 2 , name : 'Test Pipeline ' } ) ) . toBeInTheDocument ( ) ;
544538 } ) ;
545539
546540 it ( 'hydrates the flow diagram with pipeline configYaml in view mode' , async ( ) => {
@@ -667,9 +661,9 @@ describe('PipelinePage', () => {
667661
668662 render ( < PipelinePage /> , { transport : createTransport ( ) } ) ;
669663
670- // In edit mode, defaultEditing is false so EditableText renders as a button showing the name
664+ // In edit mode the name is pre-filled from the server and shown in the settings summary heading.
671665 await waitFor ( ( ) => {
672- expect ( screen . getByRole ( 'button ' , { name : 'Test Pipeline' } ) ) . toBeInTheDocument ( ) ;
666+ expect ( screen . getByRole ( 'heading ' , { level : 2 , name : 'Test Pipeline' } ) ) . toBeInTheDocument ( ) ;
673667 } ) ;
674668
675669 // The yaml editor textarea should be populated with the pipeline's configYaml
0 commit comments