Skip to content

Commit

Permalink
fix(filters): Slider default operator should be greater or equal (>=) (
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Nov 5, 2022
1 parent 2ad02d2 commit b895864
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('SingleSliderFilter', () => {

jest.runAllTimers(); // fast-forward timer

expect(callbackSpy).toHaveBeenLastCalledWith(new CustomEvent('change'), { columnDef: mockColumn, operator: 'EQ', searchTerms: [2], shouldTriggerQuery: true });
expect(callbackSpy).toHaveBeenLastCalledWith(new CustomEvent('change'), { columnDef: mockColumn, operator: 'GE', searchTerms: [2], shouldTriggerQuery: true });
expect(rowMouseEnterSpy).toHaveBeenCalledWith({ column: mockColumn, grid: gridStub }, expect.anything());
});

Expand All @@ -102,7 +102,7 @@ describe('SingleSliderFilter', () => {
const filterFilledElms = divContainer.querySelectorAll('.search-filter.slider-container.filter-duration.filled');

expect(filterFilledElms.length).toBe(1);
expect(callbackSpy).toHaveBeenLastCalledWith(new CustomEvent('change'), { columnDef: mockColumn, operator: 'EQ', searchTerms: [3], shouldTriggerQuery: true });
expect(callbackSpy).toHaveBeenLastCalledWith(new CustomEvent('change'), { columnDef: mockColumn, operator: 'GE', searchTerms: [3], shouldTriggerQuery: true });
});

it('should be able to call "setValues" and set empty values and the input to not have the "filled" css class', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/filters/sliderFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class SliderFilter implements Filter {
if (this.sliderType === 'compound') {
return OperatorType.empty;
} else if (this.sliderType === 'single') {
return OperatorType.equal;
return OperatorType.greaterThanOrEqual;
}
return this.gridOptions.defaultFilterRangeOperator || OperatorType.rangeInclusive;
}
Expand Down

0 comments on commit b895864

Please sign in to comment.