diff --git a/packages/grid/data-grid/src/tests/filtering.DataGrid.test.tsx b/packages/grid/data-grid/src/tests/filtering.DataGrid.test.tsx index 38cb88af319f..c59fe78ec806 100644 --- a/packages/grid/data-grid/src/tests/filtering.DataGrid.test.tsx +++ b/packages/grid/data-grid/src/tests/filtering.DataGrid.test.tsx @@ -36,7 +36,7 @@ describe(' - Filter', () => { rows?: any[]; columns?: any[]; operator?: string; - value?: string; + value?: any; field?: string; }) => { const { operator, value, rows, columns, field = 'brand' } = props; @@ -149,7 +149,7 @@ describe(' - Filter', () => { }); }); - describe('Numeric operators', () => { + describe('numeric operators', () => { [ { operator: '=', value: 1984, expected: [1984] }, { operator: '!=', value: 1984, expected: [1954, 1974] }, @@ -187,14 +187,7 @@ describe(' - Filter', () => { }); }); - describe('Date operators', function test() { - const isEdge = /Edg/.test(window.navigator.userAgent); - before(function before() { - if (isEdge) { - // We need to skip edge as it does not handle the date the same way as other browsers. - this.skip(); - } - }); + describe('date operators', () => { [ { operator: 'is', value: new Date(2000, 11, 1), expected: ['12/1/2000'] }, { operator: 'not', value: new Date(2000, 11, 1), expected: ['1/1/2001', '1/1/2002'] }, @@ -203,10 +196,10 @@ describe(' - Filter', () => { { operator: 'before', value: new Date(2001, 0, 1), expected: ['12/1/2000'] }, { operator: 'onOrBefore', value: new Date(2001, 0, 1), expected: ['12/1/2000', '1/1/2001'] }, ].forEach(({ operator, value, expected }) => { - it(`should allow object as value and work with valueGetter, operator: ${operator}`, function dateOpsTest() { + it(`should allow object as value and work with valueGetter, operator: ${operator}`, () => { render( - Filter', () => { brand: { date: new Date(2002, 0, 1) }, }, ]} - columns={[{ field: 'brand', valueGetter: (params) => params.value.date, type: 'date' }]} + columns={[ + { + field: 'brand', + type: 'date', + valueGetter: (params) => params.value.date, + valueFormatter: (params) => params.value.toLocaleDateString('en-US'), + }, + ]} />, ); expect(getColumnValues()).to.deep.equal(expected.map((res) => res));