@@ -36,6 +36,45 @@ describe('Output', function() {
3636 } ) ;
3737
3838
39+ describe ( 'error banner' , function ( ) {
40+
41+ it ( 'should render action link when onConfigureConnection is provided' , async function ( ) {
42+
43+ // when
44+ const { queryByText } = renderWithProps ( {
45+ isConnectionConfigured : false ,
46+ configureConnectionBannerTitle : 'Foo' ,
47+ configureConnectionBannerDescription : 'Bar' ,
48+ configureConnectionLabel : 'Baz' ,
49+ onConfigureConnection : ( ) => { }
50+ } ) ;
51+
52+ // then
53+ expect ( queryByText ( / F o o / i) ) . to . exist ;
54+ expect ( queryByText ( / B a r / i) ) . to . exist ;
55+ expect ( queryByText ( / B a z / i) ) . to . exist ;
56+ } ) ;
57+
58+
59+ it ( 'should not render action link when onConfigureConnection is not provided' , async function ( ) {
60+
61+ // when
62+ const { queryByText } = renderWithProps ( {
63+ isConnectionConfigured : false ,
64+ configureConnectionBannerTitle : 'Foo' ,
65+ configureConnectionBannerDescription : 'Bar' ,
66+ configureConnectionLabel : 'Baz'
67+ } ) ;
68+
69+ // then
70+ expect ( queryByText ( / F o o / i) ) . to . exist ;
71+ expect ( queryByText ( / B a r / i) ) . to . exist ;
72+ expect ( queryByText ( / B a z / i) ) . to . not . exist ;
73+ } ) ;
74+
75+ } ) ;
76+
77+
3978 describe ( 'pickVariables' , function ( ) {
4079
4180 it ( 'should pick variables by scope' , function ( ) {
@@ -162,7 +201,7 @@ function renderWithProps(props) {
162201 configureConnectionBannerTitle = 'Configure Connection' ,
163202 configureConnectionBannerDescription = 'Please configure your connection settings.' ,
164203 configureConnectionLabel = 'Configure Connection' ,
165- onConfigureConnection = ( ) => { } ,
204+ onConfigureConnection,
166205 isTaskExecuting = false ,
167206 output = { } ,
168207 onResetOutput = ( ) => { } ,
0 commit comments