Skip to content

Commit

Permalink
test(searchBox): test component and widget
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Feb 7, 2019
1 parent 79111b8 commit 6ae0ff5
Show file tree
Hide file tree
Showing 7 changed files with 901 additions and 679 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ describe('RefinementList', () => {
templates: {
item: item => item,
searchableNoResults: x => x,
reset: x => x,
submit: x => x,
loadingIndicator: x => x,
},
},
toggleRefinement: () => {},
Expand Down Expand Up @@ -397,6 +400,9 @@ describe('RefinementList', () => {
templateProps: {
templates: {
item: item => item,
reset: x => x,
submit: x => x,
loadingIndicator: x => x,
},
},
toggleRefinement: () => {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ exports[`RefinementList rendering with facets from search 1`] = `
<form
action=""
className="ais-SearchBox-form"
noValidate="novalidate"
noValidate={true}
onReset={[Function]}
onSubmit={[Function]}
role="search"
Expand All @@ -273,91 +273,83 @@ exports[`RefinementList rendering with facets from search 1`] = `
autoCapitalize="off"
autoComplete="off"
autoCorrect="off"
autoFocus={false}
className="ais-SearchBox-input"
disabled={false}
maxLength="512"
onChange={[Function]}
placeholder="Search"
spellCheck="false"
type="search"
value=""
/>
<button
className="ais-SearchBox-submit"
dangerouslySetInnerHTML={
Object {
"__html": Object {
"cssClasses": Object {
"form": "ais-SearchBox-form",
"input": "ais-SearchBox-input",
"loadingIcon": "ais-SearchBox-loadingIcon",
"loadingIndicator": "ais-SearchBox-loadingIndicator",
"reset": "ais-SearchBox-reset",
"resetIcon": "ais-SearchBox-resetIcon",
"root": "ais-SearchBox",
"submit": "ais-SearchBox-submit",
"submitIcon": "ais-SearchBox-submitIcon",
},
},
}
}
hidden={false}
title="Submit the search query."
type="submit"
>
<svg
className="ais-SearchBox-submitIcon"
height="10"
viewBox="0 0 40 40"
width="10"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"
/>
</svg>
</button>
/>
<button
className="ais-SearchBox-reset"
dangerouslySetInnerHTML={
Object {
"__html": Object {
"cssClasses": Object {
"form": "ais-SearchBox-form",
"input": "ais-SearchBox-input",
"loadingIcon": "ais-SearchBox-loadingIcon",
"loadingIndicator": "ais-SearchBox-loadingIndicator",
"reset": "ais-SearchBox-reset",
"resetIcon": "ais-SearchBox-resetIcon",
"root": "ais-SearchBox",
"submit": "ais-SearchBox-submit",
"submitIcon": "ais-SearchBox-submitIcon",
},
},
}
}
hidden={true}
title="Clear the search query."
type="reset"
>
<svg
className="ais-SearchBox-resetIcon"
height="10"
viewBox="0 0 20 20"
width="10"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"
/>
</svg>
</button>
/>
<span
className="ais-SearchBox-loadingIndicator"
dangerouslySetInnerHTML={
Object {
"__html": Object {
"cssClasses": Object {
"form": "ais-SearchBox-form",
"input": "ais-SearchBox-input",
"loadingIcon": "ais-SearchBox-loadingIcon",
"loadingIndicator": "ais-SearchBox-loadingIndicator",
"reset": "ais-SearchBox-reset",
"resetIcon": "ais-SearchBox-resetIcon",
"root": "ais-SearchBox",
"submit": "ais-SearchBox-submit",
"submitIcon": "ais-SearchBox-submitIcon",
},
},
}
}
hidden={true}
>
<svg
className="ais-SearchBox-loadingIcon"
height="16"
stroke="#444"
viewBox="0 0 38 38"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<g
fill="none"
fillRule="evenodd"
>
<g
strokeWidth="2"
transform="translate(1 1)"
>
<circle
cx="18"
cy="18"
r="18"
strokeOpacity=".5"
/>
<path
d="M36 18c0-9.94-8.06-18-18-18"
>
<animateTransform
attributeName="transform"
dur="1s"
from="0 18 18"
repeatCount="indefinite"
to="360 18 18"
type="rotate"
/>
</path>
</g>
</g>
</svg>
</span>
/>
</form>
</div>
</div>
Expand Down Expand Up @@ -453,7 +445,7 @@ exports[`RefinementList rendering without facets from search 1`] = `
<form
action=""
className="ais-SearchBox-form"
noValidate="novalidate"
noValidate={true}
onReset={[Function]}
onSubmit={[Function]}
role="search"
Expand All @@ -462,91 +454,83 @@ exports[`RefinementList rendering without facets from search 1`] = `
autoCapitalize="off"
autoComplete="off"
autoCorrect="off"
autoFocus={false}
className="ais-SearchBox-input"
disabled={false}
maxLength="512"
onChange={[Function]}
placeholder="Search"
spellCheck="false"
type="search"
value=""
/>
<button
className="ais-SearchBox-submit"
dangerouslySetInnerHTML={
Object {
"__html": Object {
"cssClasses": Object {
"form": "ais-SearchBox-form",
"input": "ais-SearchBox-input",
"loadingIcon": "ais-SearchBox-loadingIcon",
"loadingIndicator": "ais-SearchBox-loadingIndicator",
"reset": "ais-SearchBox-reset",
"resetIcon": "ais-SearchBox-resetIcon",
"root": "ais-SearchBox",
"submit": "ais-SearchBox-submit",
"submitIcon": "ais-SearchBox-submitIcon",
},
},
}
}
hidden={false}
title="Submit the search query."
type="submit"
>
<svg
className="ais-SearchBox-submitIcon"
height="10"
viewBox="0 0 40 40"
width="10"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"
/>
</svg>
</button>
/>
<button
className="ais-SearchBox-reset"
dangerouslySetInnerHTML={
Object {
"__html": Object {
"cssClasses": Object {
"form": "ais-SearchBox-form",
"input": "ais-SearchBox-input",
"loadingIcon": "ais-SearchBox-loadingIcon",
"loadingIndicator": "ais-SearchBox-loadingIndicator",
"reset": "ais-SearchBox-reset",
"resetIcon": "ais-SearchBox-resetIcon",
"root": "ais-SearchBox",
"submit": "ais-SearchBox-submit",
"submitIcon": "ais-SearchBox-submitIcon",
},
},
}
}
hidden={true}
title="Clear the search query."
type="reset"
>
<svg
className="ais-SearchBox-resetIcon"
height="10"
viewBox="0 0 20 20"
width="10"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"
/>
</svg>
</button>
/>
<span
className="ais-SearchBox-loadingIndicator"
dangerouslySetInnerHTML={
Object {
"__html": Object {
"cssClasses": Object {
"form": "ais-SearchBox-form",
"input": "ais-SearchBox-input",
"loadingIcon": "ais-SearchBox-loadingIcon",
"loadingIndicator": "ais-SearchBox-loadingIndicator",
"reset": "ais-SearchBox-reset",
"resetIcon": "ais-SearchBox-resetIcon",
"root": "ais-SearchBox",
"submit": "ais-SearchBox-submit",
"submitIcon": "ais-SearchBox-submitIcon",
},
},
}
}
hidden={true}
>
<svg
className="ais-SearchBox-loadingIcon"
height="16"
stroke="#444"
viewBox="0 0 38 38"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<g
fill="none"
fillRule="evenodd"
>
<g
strokeWidth="2"
transform="translate(1 1)"
>
<circle
cx="18"
cy="18"
r="18"
strokeOpacity=".5"
/>
<path
d="M36 18c0-9.94-8.06-18-18-18"
>
<animateTransform
attributeName="transform"
dur="1s"
from="0 18 18"
repeatCount="indefinite"
to="360 18 18"
type="rotate"
/>
</path>
</g>
</g>
</svg>
</span>
/>
</form>
</div>
</div>
Expand Down
Loading

0 comments on commit 6ae0ff5

Please sign in to comment.