@@ -18,7 +18,8 @@ const MOCK_APP_CONFIG: AppConfig = {
18
18
title : "Application Name" ,
19
19
type : "text" ,
20
20
value : "My App" ,
21
- default : "Default App"
21
+ default : "Default App" ,
22
+ help_text : "Enter the name of your application"
22
23
} ,
23
24
{
24
25
name : "description" ,
@@ -266,8 +267,12 @@ describe.each([
266
267
expect ( screen . queryByTestId ( "configuration-step-loading" ) ) . not . toBeInTheDocument ( ) ;
267
268
} ) ;
268
269
270
+ // Wait for the content to be rendered
271
+ await waitFor ( ( ) => {
272
+ expect ( screen . getByTestId ( "config-item-app_name" ) ) . toBeInTheDocument ( ) ;
273
+ } ) ;
274
+
269
275
// Initially, Settings tab should be active
270
- expect ( screen . getByTestId ( "config-item-app_name" ) ) . toBeInTheDocument ( ) ;
271
276
expect ( screen . getByTestId ( "config-item-description" ) ) . toBeInTheDocument ( ) ;
272
277
expect ( screen . getByTestId ( "config-item-enable_feature" ) ) . toBeInTheDocument ( ) ;
273
278
expect ( screen . getByTestId ( "config-item-auth_type" ) ) . toBeInTheDocument ( ) ;
@@ -303,6 +308,11 @@ describe.each([
303
308
expect ( screen . queryByTestId ( "configuration-step-loading" ) ) . not . toBeInTheDocument ( ) ;
304
309
} ) ;
305
310
311
+ // Wait for the content to be rendered
312
+ await waitFor ( ( ) => {
313
+ expect ( screen . getByTestId ( "text-input-app_name" ) ) . toBeInTheDocument ( ) ;
314
+ } ) ;
315
+
306
316
// Find and update text input
307
317
const appNameInput = screen . getByTestId ( "text-input-app_name" ) ;
308
318
fireEvent . change ( appNameInput , { target : { value : "New App Name" } } ) ;
@@ -370,6 +380,11 @@ describe.each([
370
380
expect ( screen . queryByTestId ( "configuration-step-loading" ) ) . not . toBeInTheDocument ( ) ;
371
381
} ) ;
372
382
383
+ // Wait for the content to be rendered
384
+ await waitFor ( ( ) => {
385
+ expect ( screen . getByTestId ( "bool-input-enable_feature" ) ) . toBeInTheDocument ( ) ;
386
+ } ) ;
387
+
373
388
// Find and toggle checkbox
374
389
const enableFeatureCheckbox = screen . getByTestId ( "bool-input-enable_feature" ) ;
375
390
expect ( enableFeatureCheckbox ) . not . toBeChecked ( ) ;
@@ -440,6 +455,11 @@ describe.each([
440
455
expect ( screen . queryByTestId ( "configuration-step-loading" ) ) . not . toBeInTheDocument ( ) ;
441
456
} ) ;
442
457
458
+ // Wait for the content to be rendered
459
+ await waitFor ( ( ) => {
460
+ expect ( screen . getByTestId ( "text-input-app_name" ) ) . toBeInTheDocument ( ) ;
461
+ } ) ;
462
+
443
463
// Make changes to form fields
444
464
const appNameInput = screen . getByTestId ( "text-input-app_name" ) ;
445
465
fireEvent . change ( appNameInput , { target : { value : "Updated App Name" } } ) ;
@@ -491,6 +511,28 @@ describe.each([
491
511
} ) ;
492
512
} ) ;
493
513
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
+
494
536
it ( "handles unauthorized error correctly" , async ( ) => {
495
537
server . use (
496
538
http . get ( `*/api/${ target } /install/app/config` , ( ) => {
@@ -537,6 +579,11 @@ describe.each([
537
579
expect ( screen . queryByTestId ( "configuration-step-loading" ) ) . not . toBeInTheDocument ( ) ;
538
580
} ) ;
539
581
582
+ // Wait for the content to be rendered
583
+ await waitFor ( ( ) => {
584
+ expect ( screen . getByTestId ( "text-input-app_name" ) ) . toBeInTheDocument ( ) ;
585
+ } ) ;
586
+
540
587
// Change the app name
541
588
const appNameInput = screen . getByTestId ( "text-input-app_name" ) ;
542
589
fireEvent . change ( appNameInput , { target : { value : "Only Changed Field" } } ) ;
@@ -735,8 +782,13 @@ describe.each([
735
782
expect ( screen . queryByTestId ( "configuration-step-loading" ) ) . not . toBeInTheDocument ( ) ;
736
783
} ) ;
737
784
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
+
738
791
// Check that all radio groups are rendered
739
- expect ( screen . getByTestId ( "config-item-authentication_method" ) ) . toBeInTheDocument ( ) ;
740
792
expect ( screen . getByTestId ( "config-item-database_type" ) ) . toBeInTheDocument ( ) ;
741
793
expect ( screen . getByTestId ( "config-item-logging_level" ) ) . toBeInTheDocument ( ) ;
742
794
expect ( screen . getByTestId ( "config-item-ssl_mode" ) ) . toBeInTheDocument ( ) ;
0 commit comments