Skip to content

Commit

Permalink
test edge
Browse files Browse the repository at this point in the history
test edge

skip edge for date ops
  • Loading branch information
dtassone committed May 17, 2021
1 parent 403d05b commit 3970c48
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions packages/grid/data-grid/src/tests/filtering.DataGrid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,13 @@ describe('<DataGrid /> - Filter', () => {
});

describe('Date operators', function test() {
const isEdge = /Edge/.test(window.navigator.userAgent);

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();
}
});
[
{ 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 @@ -199,12 +204,6 @@ describe('<DataGrid /> - Filter', () => {
{ 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() {
if (isEdge) {
// We need to skip edge as it does not handle the date the same way as other browsers.
this.skip();
return;
}

render(
<TestCase
value={value.toLocaleDateString()}
Expand Down

0 comments on commit 3970c48

Please sign in to comment.