@@ -571,8 +571,8 @@ describe( 'ReportError', () => {
571571 expect ( invalidateResolutionSpy ) . toHaveBeenCalledTimes ( 4 ) ;
572572 } ) ;
573573
574- it ( 'it should not list error descriptions with the same `reconnectURL`s' , async ( ) => {
575- const { container } = render (
574+ it ( 'should not list error descriptions with the same `reconnectURL`s' , async ( ) => {
575+ const { container, waitForRegistry } = render (
576576 < ReportError
577577 moduleSlug = { moduleName }
578578 error = { [
@@ -610,9 +610,18 @@ describe( 'ReportError', () => {
610610 }
611611 ) ;
612612
613- expect ( container . querySelectorAll ( 'p' ) . length ) . toBe ( 2 ) ;
613+ await waitForRegistry ( ) ;
614614
615- await act ( waitForDefaultTimeouts ) ;
615+ const errorDescriptionElement = container . querySelectorAll (
616+ '.googlesitekit-cta__description'
617+ ) ;
618+
619+ // Verify the child element count for the error description element is two.
620+ // However, the passed error array has three repetitive error objects.
621+ // The second error is not listed because it has the same `message` and `reconnectURL`
622+ // as the first one. Note that the `code` query parameter in the `reconnectURL` is
623+ // ignored for comparison, as it is expected to be different for each URL.
624+ expect ( errorDescriptionElement [ 0 ] . childElementCount ) . toBe ( 2 ) ;
616625 } ) ;
617626
618627 it ( 'should render `Get help` link without prefix text on non-retryable error' , async ( ) => {
0 commit comments