Skip to content

Commit

Permalink
feat(connector): test connectToggle
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Stanislawski committed Mar 3, 2017
1 parent c992288 commit 441293d
Show file tree
Hide file tree
Showing 6 changed files with 420 additions and 9 deletions.
23 changes: 22 additions & 1 deletion dev/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ search.addWidget(
instantsearch.widgets.toggle({
container: '#free-shipping',
attributeName: 'free_shipping',
label: 'Free Shipping',
label: 'Free Shipping (toggle single value)',
cssClasses: {
header: 'facet-title',
item: 'facet-value checkbox',
Expand All @@ -330,6 +330,27 @@ search.addWidget(
})
);

search.addWidget(
instantsearch.widgets.toggle({
container: '#google-amazon',
attributeName: 'brand',
label: 'Canon (not checked) or sony (checked)',
cssClasses: {
header: 'facet-title',
item: 'facet-value checkbox',
count: 'facet-count pull-right',
active: 'facet-active',
},
values: {
on: 'Sony',
off: 'Canon',
},
templates: {
header: 'Google or amazon (toggle two values)',
},
})
);

search.addWidget(
instantsearch.widgets.menu({
container: '#categories',
Expand Down
1 change: 1 addition & 0 deletions dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ <h1><a href="./">Instant search demo</a> <small>using instantsearch.js</small></
<div class="facet" id="brands-2"></div>
<div class="facet" id="price-range"></div>
<div class="facet" id="free-shipping"></div>
<div class="facet" id="google-amazon"></div>
<div class="facet" id="price"></div>
<div class="facet" id="categories"></div>
<div class="facet" id="price-ranges"></div>
Expand Down
2 changes: 1 addition & 1 deletion src/connectors/stats/__tests__/connectStats-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import connectStats from '../connectStats.js';
const fakeClient = {addAlgoliaAgent: () => {}};

describe('connectStats', () => {
it.only('Renders during init and render', () => {
it('Renders during init and render', () => {
const container = document.createElement('div');
// test that the dummyRendering is called with the isFirstRendering
// flag set accordingly
Expand Down
Loading

0 comments on commit 441293d

Please sign in to comment.