Skip to content

Commit

Permalink
[test] Remove skip on Edge (#1708)
Browse files Browse the repository at this point in the history
  • Loading branch information
m4theushw authored May 21, 2021
1 parent c29da5d commit 2f61504
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/grid/data-grid/src/tests/filtering.DataGrid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('<DataGrid /> - Filter', () => {
rows?: any[];
columns?: any[];
operator?: string;
value?: string;
value?: any;
field?: string;
}) => {
const { operator, value, rows, columns, field = 'brand' } = props;
Expand Down Expand Up @@ -149,7 +149,7 @@ describe('<DataGrid /> - Filter', () => {
});
});

describe('Numeric operators', () => {
describe('numeric operators', () => {
[
{ operator: '=', value: 1984, expected: [1984] },
{ operator: '!=', value: 1984, expected: [1954, 1974] },
Expand Down Expand Up @@ -187,14 +187,7 @@ describe('<DataGrid /> - 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'] },
Expand All @@ -203,10 +196,10 @@ describe('<DataGrid /> - 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(
<TestCase
value={value.toLocaleDateString()}
value={value}
operator={operator}
rows={[
{
Expand All @@ -222,7 +215,14 @@ describe('<DataGrid /> - 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));
Expand Down

0 comments on commit 2f61504

Please sign in to comment.