Skip to content

Commit

Permalink
try making test pass in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Dec 13, 2024
1 parent c9c3cce commit 26d0486
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { expect } from 'chai';
import { spy } from 'sinon';
import { createRenderer, fireEvent, screen, createEvent } from '@mui/internal-test-utils';
import { getCell, getColumnValues, getRowsFieldContent } from 'test/utils/helperFn';
import { getCell, getColumnValues, getRowsFieldContent, microtasks } from 'test/utils/helperFn';
import { useGridApiRef, DataGridPro, gridClasses, GridApi } from '@mui/x-data-grid-pro';
import { useBasicDemoData } from '@mui/x-data-grid-generator';

Expand Down Expand Up @@ -247,8 +247,7 @@ describe('<DataGridPro /> - Row reorder', () => {
expect(getRowsFieldContent('brand')).to.deep.equal(['Skechers', 'Puma']);
});

it('should reorder rows correctly with filtered data', () => {
let apiRef: React.MutableRefObject<GridApi>;
it('should reorder rows correctly with filtered data', async () => {
const rows = [
{ id: 0, brand: 'Nike' },
{ id: 1, brand: 'Adidas' },
Expand All @@ -258,12 +257,9 @@ describe('<DataGridPro /> - Row reorder', () => {
const columns = [{ field: 'brand' }];

function Test() {
apiRef = useGridApiRef();

return (
<div style={{ width: 300, height: 300 }}>
<DataGridPro
apiRef={apiRef}
rows={rows}
columns={columns}
rowReordering
Expand All @@ -284,6 +280,7 @@ describe('<DataGridPro /> - Row reorder', () => {
fireEvent.dragEnter(targetCell);
const dragOverEvent = createDragOverEvent(targetCell);
fireEvent(targetCell, dragOverEvent);
await microtasks();
expect(getColumnValues(1)).to.deep.equal(['Puma', 'Adidas', 'Skechers']);
});
});

0 comments on commit 26d0486

Please sign in to comment.