@@ -25,6 +25,7 @@ import {
25
25
stats ,
26
26
ratingMenu ,
27
27
numericMenu ,
28
+ relatedProducts ,
28
29
frequentlyBoughtTogether ,
29
30
} from '../widgets' ;
30
31
@@ -480,6 +481,22 @@ const testSetups: TestSetupsMap<TestSuites> = {
480
481
} )
481
482
. start ( ) ;
482
483
} ,
484
+ createRelatedProductsWidgetTests ( { instantSearchOptions, widgetParams } ) {
485
+ instantsearch ( instantSearchOptions )
486
+ . addWidgets ( [
487
+ relatedProducts ( {
488
+ container : document . body . appendChild ( document . createElement ( 'div' ) ) ,
489
+ ...widgetParams ,
490
+ } ) ,
491
+ ] )
492
+ . on ( 'error' , ( ) => {
493
+ /*
494
+ * prevent rethrowing InstantSearch errors, so tests can be asserted.
495
+ * IRL this isn't needed, as the error doesn't stop execution.
496
+ */
497
+ } )
498
+ . start ( ) ;
499
+ } ,
483
500
createFrequentlyBoughtTogetherTests ( { instantSearchOptions, widgetParams } ) {
484
501
instantsearch ( instantSearchOptions )
485
502
. addWidgets ( [
@@ -489,7 +506,7 @@ const testSetups: TestSetupsMap<TestSuites> = {
489
506
} ) ,
490
507
] )
491
508
. on ( 'error' , ( ) => {
492
- /**
509
+ /*
493
510
* prevent rethrowing InstantSearch errors, so tests can be asserted.
494
511
* IRL this isn't needed, as the error doesn't stop execution.
495
512
*/
@@ -521,6 +538,7 @@ const testOptions: TestOptionsMap<TestSuites> = {
521
538
createSortByWidgetTests : undefined ,
522
539
createStatsWidgetTests : undefined ,
523
540
createNumericMenuWidgetTests : undefined ,
541
+ createRelatedProductsWidgetTests : undefined ,
524
542
createFrequentlyBoughtTogetherTests : undefined ,
525
543
} ;
526
544
0 commit comments