@@ -22,6 +22,10 @@ jest.mock(
2222 ) )
2323) ;
2424
25+ jest . mock ( '../../domain-page-failover-modal/domain-page-failover-modal' , ( ) =>
26+ jest . fn ( ( ) => < div data-testid = "mock-failover-modal" > Modal</ div > )
27+ ) ;
28+
2529describe ( DomainPageFailoverActiveActive . name , ( ) => {
2630 beforeEach ( ( ) => {
2731 jest . clearAllMocks ( ) ;
@@ -61,6 +65,7 @@ describe(DomainPageFailoverActiveActive.name, () => {
6165 ) . toBeInTheDocument ( ) ;
6266 expect ( screen . getByText ( 'cluster-1 -> cluster-2' ) ) . toBeInTheDocument ( ) ;
6367 expect ( screen . getByText ( 'See more' ) ) . toBeInTheDocument ( ) ;
68+ expect ( screen . getByTestId ( 'mock-failover-modal' ) ) . toBeInTheDocument ( ) ;
6469 } ) ;
6570
6671 it ( 'renders cluster failover when matching non-primary cluster failover is found' , ( ) => {
@@ -101,6 +106,7 @@ describe(DomainPageFailoverActiveActive.name, () => {
101106 ) . toBeInTheDocument ( ) ;
102107 expect ( screen . getByText ( 'cluster-1 -> cluster-2' ) ) . toBeInTheDocument ( ) ;
103108 expect ( screen . getByText ( 'See more' ) ) . toBeInTheDocument ( ) ;
109+ expect ( screen . getByTestId ( 'mock-failover-modal' ) ) . toBeInTheDocument ( ) ;
104110 } ) ;
105111
106112 it ( 'does not render cluster failover section when clusterAttributeScope is set but clusterAttributeValue is undefined for non-primary scope' , ( ) => {
@@ -138,6 +144,7 @@ describe(DomainPageFailoverActiveActive.name, () => {
138144 screen . queryByTestId ( 'mock-single-cluster-failover' )
139145 ) . not . toBeInTheDocument ( ) ;
140146 expect ( screen . getByText ( 'See more' ) ) . toBeInTheDocument ( ) ;
147+ expect ( screen . getByTestId ( 'mock-failover-modal' ) ) . toBeInTheDocument ( ) ;
141148 } ) ;
142149
143150 it ( 'does not render cluster failover section when no matching cluster failover is found' , ( ) => {
@@ -177,6 +184,7 @@ describe(DomainPageFailoverActiveActive.name, () => {
177184 screen . queryByTestId ( 'mock-single-cluster-failover' )
178185 ) . not . toBeInTheDocument ( ) ;
179186 expect ( screen . getByText ( 'See more' ) ) . toBeInTheDocument ( ) ;
187+ expect ( screen . getByTestId ( 'mock-failover-modal' ) ) . toBeInTheDocument ( ) ;
180188 } ) ;
181189
182190 it ( 'does not render cluster failover section when clusterAttributeScope is undefined' , ( ) => {
@@ -211,6 +219,7 @@ describe(DomainPageFailoverActiveActive.name, () => {
211219 screen . queryByTestId ( 'mock-single-cluster-failover' )
212220 ) . not . toBeInTheDocument ( ) ;
213221 expect ( screen . getByText ( 'See more' ) ) . toBeInTheDocument ( ) ;
222+ expect ( screen . getByTestId ( 'mock-failover-modal' ) ) . toBeInTheDocument ( ) ;
214223 } ) ;
215224
216225 it ( 'renders "See more" button even when no matching cluster failover is found' , ( ) => {
@@ -233,6 +242,7 @@ describe(DomainPageFailoverActiveActive.name, () => {
233242 screen . queryByTestId ( 'mock-single-cluster-failover' )
234243 ) . not . toBeInTheDocument ( ) ;
235244 expect ( screen . getByText ( 'See more' ) ) . toBeInTheDocument ( ) ;
245+ expect ( screen . getByTestId ( 'mock-failover-modal' ) ) . toBeInTheDocument ( ) ;
236246 } ) ;
237247
238248 it ( 'selects the correct cluster failover when multiple cluster failovers exist' , ( ) => {
@@ -286,6 +296,7 @@ describe(DomainPageFailoverActiveActive.name, () => {
286296 screen . getByTestId ( 'mock-single-cluster-failover' )
287297 ) . toBeInTheDocument ( ) ;
288298 expect ( screen . getByText ( 'cluster-3 -> cluster-4' ) ) . toBeInTheDocument ( ) ;
299+ expect ( screen . getByTestId ( 'mock-failover-modal' ) ) . toBeInTheDocument ( ) ;
289300 } ) ;
290301} ) ;
291302
0 commit comments