Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MBilalShafi committed Jan 24, 2025
1 parent c41f0ee commit 1274a93
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('<DataGridPro /> - Data source', () => {
});
});
await waitFor(() => {
expect(fetchRowsSpy.callCount).to.equal(2);
expect(fetchRowsSpy.callCount).to.be.greaterThan(1);
});
});

Expand All @@ -118,7 +118,7 @@ describe('<DataGridPro /> - Data source', () => {
apiRef.current.setSortModel([{ field: 'name', sort: 'asc' }]);
});
await waitFor(() => {
expect(fetchRowsSpy.callCount).to.equal(2);
expect(fetchRowsSpy.callCount).to.be.greaterThan(1);
});
});

Expand All @@ -131,7 +131,7 @@ describe('<DataGridPro /> - Data source', () => {
apiRef.current.setPage(1);
});
await waitFor(() => {
expect(fetchRowsSpy.callCount).to.equal(2);
expect(fetchRowsSpy.callCount).to.be.greaterThan(1);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ describeSkipIf(isJSDOM)('<DataGridPro /> - Data source tree data', () => {
expect(fetchRowsSpy.callCount).to.equal(1);
});
act(() => {
apiRef.current.setFilterModel({ items: [{ field: 'name', value: 'John', operator: 'contains' }] });
})
apiRef.current.setFilterModel({
items: [{ field: 'name', value: 'John', operator: 'contains' }],
});
});
await waitFor(() => {
expect(fetchRowsSpy.callCount).to.equal(2);
expect(fetchRowsSpy.callCount).to.be.greaterThan(1);
});
});

Expand All @@ -112,7 +114,7 @@ describeSkipIf(isJSDOM)('<DataGridPro /> - Data source tree data', () => {
apiRef.current.setSortModel([{ field: 'name', sort: 'asc' }]);
});
await waitFor(() => {
expect(fetchRowsSpy.callCount).to.equal(2);
expect(fetchRowsSpy.callCount).to.be.greaterThan(1);
});
});

Expand All @@ -125,7 +127,7 @@ describeSkipIf(isJSDOM)('<DataGridPro /> - Data source tree data', () => {
apiRef.current.setPaginationModel({ page: 1, pageSize: 10 });
});
await waitFor(() => {
expect(fetchRowsSpy.callCount).to.equal(2);
expect(fetchRowsSpy.callCount).to.be.greaterThan(1);
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/utils/skipIf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ export const testSkipIf: (condition: boolean) => Mocha.PendingTestFunction =
export const isJSDOM = /jsdom/.test(window.navigator.userAgent);
export const isOSX = /macintosh/i.test(window.navigator.userAgent);
export const hasTouchSupport =
typeof window.Touch !== 'undefined' && typeof window.TouchEvent !== 'undefined';
typeof window.Touch !== 'undefined' && typeof window.TouchEvent !== 'undefined';

0 comments on commit 1274a93

Please sign in to comment.