Skip to content

Commit 9b6d990

Browse files
committed
fix test cases for #1030
1 parent 4de565b commit 9b6d990

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

packages/react-bootstrap-table2-filter/test/components/select.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('Select Filter', () => {
2525
2: 'Unknown'
2626
};
2727

28-
afterEach(() => {
28+
beforeEach(() => {
2929
onFilter.reset();
3030
onFilterFirstReturn.reset();
3131

packages/react-bootstrap-table2-filter/test/context.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ describe('FilterContext', () => {
9494
expect(mockBase).toHaveBeenCalledWith({
9595
data,
9696
onFilter: wrapper.instance().onFilter,
97-
onExternalFilter: wrapper.instance().onExternalFilter
97+
onExternalFilter: wrapper.instance().onExternalFilter,
98+
currFilters: wrapper.instance().currFilters
9899
});
99100
});
100101
});
@@ -103,15 +104,15 @@ describe('FilterContext', () => {
103104
beforeEach(() => {
104105
wrapper = shallow(shallowContext(true));
105106
wrapper.render();
106-
wrapper.instance().currFilters = { price: { filterVal: 20, filterType: FILTER_TYPE.TEXT } };
107107
});
108108

109109
it('should pass original data without internal filtering', () => {
110110
expect(wrapper.length).toBe(1);
111111
expect(mockBase).toHaveBeenCalledWith({
112112
data,
113113
onFilter: wrapper.instance().onFilter,
114-
onExternalFilter: wrapper.instance().onExternalFilter
114+
onExternalFilter: wrapper.instance().onExternalFilter,
115+
currFilters: wrapper.instance().currFilters
115116
});
116117
});
117118
});

packages/react-bootstrap-table2/test/header-cell.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,9 @@ describe('HeaderCell', () => {
728728
Filter
729729
}
730730
};
731-
wrapper = shallow(<HeaderCell column={ column } index={ index } onFilter={ onFilter } />);
731+
wrapper = shallow(
732+
<HeaderCell column={ column } index={ index } onFilter={ onFilter } currFilters={ {} } />
733+
);
732734
});
733735

734736
it('should render successfully', () => {

0 commit comments

Comments
 (0)