Skip to content

Commit 441293d

Browse files
author
Alexandre Stanislawski
committed
feat(connector): test connectToggle
1 parent c992288 commit 441293d

File tree

6 files changed

+420
-9
lines changed

6 files changed

+420
-9
lines changed

dev/app.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ search.addWidget(
317317
instantsearch.widgets.toggle({
318318
container: '#free-shipping',
319319
attributeName: 'free_shipping',
320-
label: 'Free Shipping',
320+
label: 'Free Shipping (toggle single value)',
321321
cssClasses: {
322322
header: 'facet-title',
323323
item: 'facet-value checkbox',
@@ -330,6 +330,27 @@ search.addWidget(
330330
})
331331
);
332332

333+
search.addWidget(
334+
instantsearch.widgets.toggle({
335+
container: '#google-amazon',
336+
attributeName: 'brand',
337+
label: 'Canon (not checked) or sony (checked)',
338+
cssClasses: {
339+
header: 'facet-title',
340+
item: 'facet-value checkbox',
341+
count: 'facet-count pull-right',
342+
active: 'facet-active',
343+
},
344+
values: {
345+
on: 'Sony',
346+
off: 'Canon',
347+
},
348+
templates: {
349+
header: 'Google or amazon (toggle two values)',
350+
},
351+
})
352+
);
353+
333354
search.addWidget(
334355
instantsearch.widgets.menu({
335356
container: '#categories',

dev/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ <h1><a href="./">Instant search demo</a> <small>using instantsearch.js</small></
2727
<div class="facet" id="brands-2"></div>
2828
<div class="facet" id="price-range"></div>
2929
<div class="facet" id="free-shipping"></div>
30+
<div class="facet" id="google-amazon"></div>
3031
<div class="facet" id="price"></div>
3132
<div class="facet" id="categories"></div>
3233
<div class="facet" id="price-ranges"></div>

src/connectors/stats/__tests__/connectStats-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import connectStats from '../connectStats.js';
1111
const fakeClient = {addAlgoliaAgent: () => {}};
1212

1313
describe('connectStats', () => {
14-
it.only('Renders during init and render', () => {
14+
it('Renders during init and render', () => {
1515
const container = document.createElement('div');
1616
// test that the dummyRendering is called with the isFirstRendering
1717
// flag set accordingly

0 commit comments

Comments
 (0)