@@ -18,7 +18,8 @@ const MOCK_APP_CONFIG: AppConfig = {
1818 title : "Application Name" ,
1919 type : "text" ,
2020 value : "My App" ,
21- default : "Default App"
21+ default : "Default App" ,
22+ help_text : "Enter the name of your application"
2223 } ,
2324 {
2425 name : "description" ,
@@ -266,8 +267,12 @@ describe.each([
266267 expect ( screen . queryByTestId ( "configuration-step-loading" ) ) . not . toBeInTheDocument ( ) ;
267268 } ) ;
268269
270+ // Wait for the content to be rendered
271+ await waitFor ( ( ) => {
272+ expect ( screen . getByTestId ( "config-item-app_name" ) ) . toBeInTheDocument ( ) ;
273+ } ) ;
274+
269275 // Initially, Settings tab should be active
270- expect ( screen . getByTestId ( "config-item-app_name" ) ) . toBeInTheDocument ( ) ;
271276 expect ( screen . getByTestId ( "config-item-description" ) ) . toBeInTheDocument ( ) ;
272277 expect ( screen . getByTestId ( "config-item-enable_feature" ) ) . toBeInTheDocument ( ) ;
273278 expect ( screen . getByTestId ( "config-item-auth_type" ) ) . toBeInTheDocument ( ) ;
@@ -303,6 +308,11 @@ describe.each([
303308 expect ( screen . queryByTestId ( "configuration-step-loading" ) ) . not . toBeInTheDocument ( ) ;
304309 } ) ;
305310
311+ // Wait for the content to be rendered
312+ await waitFor ( ( ) => {
313+ expect ( screen . getByTestId ( "text-input-app_name" ) ) . toBeInTheDocument ( ) ;
314+ } ) ;
315+
306316 // Find and update text input
307317 const appNameInput = screen . getByTestId ( "text-input-app_name" ) ;
308318 fireEvent . change ( appNameInput , { target : { value : "New App Name" } } ) ;
@@ -370,6 +380,11 @@ describe.each([
370380 expect ( screen . queryByTestId ( "configuration-step-loading" ) ) . not . toBeInTheDocument ( ) ;
371381 } ) ;
372382
383+ // Wait for the content to be rendered
384+ await waitFor ( ( ) => {
385+ expect ( screen . getByTestId ( "bool-input-enable_feature" ) ) . toBeInTheDocument ( ) ;
386+ } ) ;
387+
373388 // Find and toggle checkbox
374389 const enableFeatureCheckbox = screen . getByTestId ( "bool-input-enable_feature" ) ;
375390 expect ( enableFeatureCheckbox ) . not . toBeChecked ( ) ;
@@ -440,6 +455,11 @@ describe.each([
440455 expect ( screen . queryByTestId ( "configuration-step-loading" ) ) . not . toBeInTheDocument ( ) ;
441456 } ) ;
442457
458+ // Wait for the content to be rendered
459+ await waitFor ( ( ) => {
460+ expect ( screen . getByTestId ( "text-input-app_name" ) ) . toBeInTheDocument ( ) ;
461+ } ) ;
462+
443463 // Make changes to form fields
444464 const appNameInput = screen . getByTestId ( "text-input-app_name" ) ;
445465 fireEvent . change ( appNameInput , { target : { value : "Updated App Name" } } ) ;
@@ -491,6 +511,28 @@ describe.each([
491511 } ) ;
492512 } ) ;
493513
514+ it ( "displays help text for text inputs" , async ( ) => {
515+ renderWithProviders ( < ConfigurationStep onNext = { mockOnNext } /> , {
516+ wrapperProps : {
517+ authenticated : true ,
518+ target : target ,
519+ } ,
520+ } ) ;
521+
522+ // Wait for loading to complete
523+ await waitFor ( ( ) => {
524+ expect ( screen . queryByTestId ( "configuration-step-loading" ) ) . not . toBeInTheDocument ( ) ;
525+ } ) ;
526+
527+ // Wait for the content to be rendered
528+ await waitFor ( ( ) => {
529+ expect ( screen . getByTestId ( "text-input-app_name" ) ) . toBeInTheDocument ( ) ;
530+ } ) ;
531+
532+ // Verify help text is displayed for the app_name field
533+ expect ( screen . getByText ( "Enter the name of your application" ) ) . toBeInTheDocument ( ) ;
534+ } ) ;
535+
494536 it ( "handles unauthorized error correctly" , async ( ) => {
495537 server . use (
496538 http . get ( `*/api/${ target } /install/app/config` , ( ) => {
@@ -537,6 +579,11 @@ describe.each([
537579 expect ( screen . queryByTestId ( "configuration-step-loading" ) ) . not . toBeInTheDocument ( ) ;
538580 } ) ;
539581
582+ // Wait for the content to be rendered
583+ await waitFor ( ( ) => {
584+ expect ( screen . getByTestId ( "text-input-app_name" ) ) . toBeInTheDocument ( ) ;
585+ } ) ;
586+
540587 // Change the app name
541588 const appNameInput = screen . getByTestId ( "text-input-app_name" ) ;
542589 fireEvent . change ( appNameInput , { target : { value : "Only Changed Field" } } ) ;
@@ -735,8 +782,13 @@ describe.each([
735782 expect ( screen . queryByTestId ( "configuration-step-loading" ) ) . not . toBeInTheDocument ( ) ;
736783 } ) ;
737784
785+ // Wait for the content to be rendered
786+ await waitFor ( ( ) => {
787+ // Check that all radio groups are rendered
788+ expect ( screen . getByTestId ( "config-item-authentication_method" ) ) . toBeInTheDocument ( ) ;
789+ } ) ;
790+
738791 // Check that all radio groups are rendered
739- expect ( screen . getByTestId ( "config-item-authentication_method" ) ) . toBeInTheDocument ( ) ;
740792 expect ( screen . getByTestId ( "config-item-database_type" ) ) . toBeInTheDocument ( ) ;
741793 expect ( screen . getByTestId ( "config-item-logging_level" ) ) . toBeInTheDocument ( ) ;
742794 expect ( screen . getByTestId ( "config-item-ssl_mode" ) ) . toBeInTheDocument ( ) ;
0 commit comments