Skip to content

Commit

Permalink
skip edge for date ops
Browse files Browse the repository at this point in the history
  • Loading branch information
dtassone committed May 17, 2021
1 parent 1a0e25f commit 2ed468a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 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,9 +188,13 @@ describe('<DataGrid /> - Filter', () => {
});

describe('Date operators', function test() {
console.log('BROWSER agent: ', 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 @@ -200,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 2ed468a

Please sign in to comment.