@@ -31,8 +31,8 @@ describe('alert_form', () => {
3131 id : 'my-alert-type' ,
3232 iconClass : 'test' ,
3333 name : 'test-alert' ,
34- description : 'test ' ,
35- documentationUrl : null ,
34+ description : 'Alert when testing ' ,
35+ documentationUrl : 'https://localhost.local/docs' ,
3636 validate : ( ) : ValidationResult => {
3737 return { errors : { } } ;
3838 } ,
@@ -184,6 +184,22 @@ describe('alert_form', () => {
184184 ) ;
185185 expect ( alertTypeSelectOptions . exists ( ) ) . toBeFalsy ( ) ;
186186 } ) ;
187+
188+ it ( 'renders alert type description' , async ( ) => {
189+ await setup ( ) ;
190+ wrapper . find ( '[data-test-subj="my-alert-type-SelectOption"]' ) . first ( ) . simulate ( 'click' ) ;
191+ const alertDescription = wrapper . find ( '[data-test-subj="alertDescription"]' ) ;
192+ expect ( alertDescription . exists ( ) ) . toBeTruthy ( ) ;
193+ expect ( alertDescription . first ( ) . text ( ) ) . toBe ( 'Alert when testing' ) ;
194+ } ) ;
195+
196+ it ( 'renders alert type documentation link' , async ( ) => {
197+ await setup ( ) ;
198+ wrapper . find ( '[data-test-subj="my-alert-type-SelectOption"]' ) . first ( ) . simulate ( 'click' ) ;
199+ const alertDocumentationLink = wrapper . find ( '[data-test-subj="alertDocumentationLink"]' ) ;
200+ expect ( alertDocumentationLink . exists ( ) ) . toBeTruthy ( ) ;
201+ expect ( alertDocumentationLink . first ( ) . prop ( 'href' ) ) . toBe ( 'https://localhost.local/docs' ) ;
202+ } ) ;
187203 } ) ;
188204
189205 describe ( 'alert_form create alert non alerting consumer and producer' , ( ) => {
@@ -427,5 +443,19 @@ describe('alert_form', () => {
427443 const throttleFieldAfterUpdate = wrapper . find ( '[data-test-subj="throttleInput"]' ) ;
428444 expect ( throttleFieldAfterUpdate . at ( 1 ) . prop ( 'value' ) ) . toEqual ( newThrottle ) ;
429445 } ) ;
446+
447+ it ( 'renders alert type description' , async ( ) => {
448+ await setup ( ) ;
449+ const alertDescription = wrapper . find ( '[data-test-subj="alertDescription"]' ) ;
450+ expect ( alertDescription . exists ( ) ) . toBeTruthy ( ) ;
451+ expect ( alertDescription . first ( ) . text ( ) ) . toBe ( 'Alert when testing' ) ;
452+ } ) ;
453+
454+ it ( 'renders alert type documentation link' , async ( ) => {
455+ await setup ( ) ;
456+ const alertDocumentationLink = wrapper . find ( '[data-test-subj="alertDocumentationLink"]' ) ;
457+ expect ( alertDocumentationLink . exists ( ) ) . toBeTruthy ( ) ;
458+ expect ( alertDocumentationLink . first ( ) . prop ( 'href' ) ) . toBe ( 'https://localhost.local/docs' ) ;
459+ } ) ;
430460 } ) ;
431461} ) ;
0 commit comments