Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

fix(toggle-refinement): display label #649

Merged
merged 2 commits into from
Mar 21, 2019
Merged

Conversation

francoischalifour
Copy link
Member

The required label of the ais-toggle-refinement widget was not used in the template, thus ignored. The deployed story should display "Free shipping" but displays the attribute name "free_shipping".

This issue was reported by a user.

@francoischalifour francoischalifour requested a review from a team March 21, 2019 10:04
@francoischalifour
Copy link
Member Author

@Haroenv There are still issues with conflicting Vue dependencies.

Locally, I still have errors with:

import 'vue-slider-component/theme/default.css';

@Haroenv
Copy link
Contributor

Haroenv commented Mar 21, 2019

Weird, I solved that issue I thought

@Haroenv
Copy link
Contributor

Haroenv commented Mar 21, 2019

I'm surprised that this didn't break any tests 🤔

@francoischalifour
Copy link
Member Author

francoischalifour commented Mar 21, 2019

So am I. The Vue testing environment seems to be different:

it('renders correctly', () => {
__setState({ ...defaultState });
const wrapper = mount(Toggle, {
propsData: defaultProps,
});
expect(wrapper.html()).toMatchSnapshot();
});

exports[`default render renders correctly 1`] = `
<div class="ais-ToggleRefinement">
<label class="ais-ToggleRefinement-label">
<input type="checkbox"
name="Free Shipping"
class="ais-ToggleRefinement-checkbox"
value="true"
>
<span class="ais-ToggleRefinement-labelText">
Free Shipping
</span>
<span class="ais-ToggleRefinement-count">
100
</span>
</label>
</div>
`;

@Haroenv
Copy link
Contributor

Haroenv commented Mar 21, 2019

Can you change the test so that the name isn't the same as the label?

@francoischalifour
Copy link
Member Author

All right – the test covers more cases now.

@Haroenv
Copy link
Contributor

Haroenv commented Mar 21, 2019

Netlify failures are the fault of their cache, it works consistently on my machine

@Haroenv Haroenv merged commit 84c909d into master Mar 21, 2019
@Haroenv Haroenv deleted the fix/toggle-refinement-label branch March 21, 2019 15:33
@Haroenv
Copy link
Contributor

Haroenv commented Mar 21, 2019

This is technically a breaking change, but small enough to ignore IMO

Haroenv pushed a commit to algolia/instantsearch that referenced this pull request Dec 28, 2022
* fix(toggle-refinement): display label

* test(toggle-refinements): change name to free_shipping
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants