This repository was archived by the owner on Dec 30, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +60
-5
lines changed Expand file tree Collapse file tree 4 files changed +60
-5
lines changed Original file line number Diff line number Diff line change 4848 "release" : " shipjs prepare"
4949 },
5050 "dependencies" : {
51- "instantsearch.js" : " ^4.35 .0" ,
51+ "instantsearch.js" : " ^4.36 .0" ,
5252 "mitt" : " ^2.1.0"
5353 },
5454 "peerDependencies" : {
Original file line number Diff line number Diff line change @@ -50,6 +50,14 @@ export default {
5050 type : Function ,
5151 default : undefined ,
5252 } ,
53+ facets : {
54+ type : Array ,
55+ default : undefined ,
56+ } ,
57+ maxValuesPerFacet : {
58+ type : Number ,
59+ default : undefined ,
60+ } ,
5361 } ,
5462 render : renderCompat ( function ( h ) {
5563 const components = new Map ( ) ;
@@ -91,6 +99,8 @@ export default {
9199 widgetParams ( ) {
92100 return {
93101 transformItems : this . transformItems ,
102+ facets : this . facets ,
103+ maxValuesPerFacet : this . maxValuesPerFacet ,
94104 // we do not pass "widgets" to the connector, since Vue is in charge of rendering
95105 widgets : [ ] ,
96106 } ;
Original file line number Diff line number Diff line change @@ -46,6 +46,51 @@ const MockHierarchicalMenu = {
4646 ` ,
4747} ;
4848
49+ it ( 'passes arguments to connector' , ( ) => {
50+ __setState ( null ) ;
51+
52+ const transformItems = items => items ;
53+ const facets = [ 'test' ] ;
54+ const maxValuesPerFacet = 100 ;
55+ const wrapper = mount ( {
56+ data ( ) {
57+ return { props : { transformItems, facets, maxValuesPerFacet } } ;
58+ } ,
59+ template : `
60+ <DynamicWidgets v-bind="props">
61+ <MockRefinementList attribute="test1"/>
62+ <MockMenu attribute="test2"/>
63+ <AisPanel>
64+ <MockHierarchicalMenu :attributes="['test3', 'test4']" />
65+ </AisPanel>
66+ </DynamicWidgets>
67+ ` ,
68+ components : {
69+ DynamicWidgets,
70+ MockRefinementList,
71+ MockMenu,
72+ MockHierarchicalMenu,
73+ AisPanel,
74+ } ,
75+ } ) ;
76+
77+ const dynamicWidgets = wrapper . findComponent ( DynamicWidgets ) ;
78+
79+ expect ( dynamicWidgets . props ( ) ) . toEqual ( {
80+ classNames : undefined ,
81+ transformItems,
82+ facets : [ 'test' ] ,
83+ maxValuesPerFacet : 100 ,
84+ } ) ;
85+
86+ expect ( dynamicWidgets . vm . widgetParams ) . toEqual ( {
87+ transformItems,
88+ facets : [ 'test' ] ,
89+ maxValuesPerFacet : 100 ,
90+ widgets : [ ] ,
91+ } ) ;
92+ } ) ;
93+
4994it ( 'renders all children without state' , ( ) => {
5095 __setState ( null ) ;
5196
Original file line number Diff line number Diff line change 81228122 resolved "https://registry.yarnpkg.com/instantsearch.css/-/instantsearch.css-7.3.1.tgz#7ab74a8f355091ae040947a9cf5438f379026622"
81238123 integrity sha512-/kaMDna5D+Q9mImNBHEhb9HgHATDOFKYii7N1Iwvrj+lmD9gBJLqVhUw67gftq2O0QI330pFza+CRscIwB1wQQ==
81248124
8125- instantsearch.js@^4.35 .0:
8126- version "4.35 .0"
8127- resolved "https://registry.yarnpkg.com/instantsearch.js/-/instantsearch.js-4.35 .0.tgz#188a5b9f91c36e84ab912dc869794b51c9eea638 "
8128- integrity sha512-2s1GlSYqy6c+I8MrE43iYnpmP5PbL8q3VSYPvLfuJaPF4MX0I8R/8bYVVG7cm6btg+BXT1ZbryG8aHPZTkaVKQ ==
8125+ instantsearch.js@^4.36 .0:
8126+ version "4.36 .0"
8127+ resolved "https://registry.yarnpkg.com/instantsearch.js/-/instantsearch.js-4.36 .0.tgz#70baaa7ea745992b2220f1c553e310cef552f7b8 "
8128+ integrity sha512-o0PRCir8AvMHo9idMEh6ERPXlSMn6auUbq2niW5t//03Kn+EPYDP8uXyKQtSRHLxd9T0gTU6PNJ3vM0VV76VgA ==
81298129 dependencies:
81308130 "@algolia/events" "^4.0.1"
81318131 "@types/google.maps" "^3.45.3"
You can’t perform that action at this time.
0 commit comments