This repository was archived by the owner on Dec 30, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +2
-45
lines changed
packages/react-instantsearch-hooks-dom/src/widgets Expand file tree Collapse file tree 2 files changed +2
-45
lines changed Original file line number Diff line number Diff line change @@ -3,21 +3,19 @@ import { useClearRefinements } from 'react-instantsearch-hooks';
33
44import { ClearRefinements as ClearRefinementsUiComponent } from '../ui/ClearRefinements' ;
55
6- import type { Translatable } from '../types' ;
76import type { ClearRefinementsProps as ClearRefinementsUiComponentProps } from '../ui/ClearRefinements' ;
87import type { UseClearRefinementsProps } from 'react-instantsearch-hooks' ;
98
109export type ClearRefinementsProps = Omit <
11- Translatable < ClearRefinementsUiComponentProps > ,
12- 'disabled' | 'onClick'
10+ ClearRefinementsUiComponentProps ,
11+ 'disabled' | 'onClick' | 'translations'
1312> &
1413 UseClearRefinementsProps ;
1514
1615export function ClearRefinements ( {
1716 includedAttributes,
1817 excludedAttributes,
1918 transformItems,
20- translations,
2119 ...props
2220} : ClearRefinementsProps ) {
2321 const { canRefine, refine } = useClearRefinements (
@@ -36,7 +34,6 @@ export function ClearRefinements({
3634 { ...props }
3735 translations = { {
3836 resetLabel : 'Clear refinements' ,
39- ...translations ,
4037 } }
4138 onClick = { refine }
4239 disabled = { ! canRefine }
Original file line number Diff line number Diff line change @@ -77,46 +77,6 @@ describe('ClearRefinements', () => {
7777 ` ) ;
7878 } ) ;
7979
80- test ( 'renders with a custom label' , async ( ) => {
81- const { container } = render (
82- < InstantSearchHooksTestWrapper
83- initialUiState = { {
84- indexName : {
85- refinementList : {
86- brand : [ 'Apple' ] ,
87- } ,
88- } ,
89- } }
90- >
91- < RefinementList attribute = "brand" />
92- < ClearRefinements
93- translations = { {
94- resetLabel : 'Clear' ,
95- } }
96- />
97- </ InstantSearchHooksTestWrapper >
98- ) ;
99-
100- await wait ( 0 ) ;
101-
102- expect (
103- document . querySelector ( '.ais-ClearRefinements-button' )
104- ) . toHaveTextContent ( 'Clear' ) ;
105- expect ( container ) . toMatchInlineSnapshot ( `
106- <div>
107- <div
108- class="ais-ClearRefinements"
109- >
110- <button
111- class="ais-ClearRefinements-button"
112- >
113- Clear
114- </button>
115- </div>
116- </div>
117- ` ) ;
118- } ) ;
119-
12080 test ( 'clears all refinements' , async ( ) => {
12181 const { container, queryAllByRole } = render (
12282 < InstantSearchHooksTestWrapper
You can’t perform that action at this time.
0 commit comments