Skip to content

Commit

Permalink
fix new eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasTy committed Feb 28, 2024
1 parent f2a26bd commit fde767e
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -481,15 +481,19 @@ describe('<DataGridPro /> - Columns', () => {
it('.columns works', async () => {
await autosize({ columns: [columns[0].field] }, [50, 100]);
});

it('.includeHeaders works', async () => {
await autosize({ includeHeaders: true }, [213, 235]);
});

it('.includeOutliers works', async () => {
await autosize({ includeOutliers: true }, [50, 144]);
});

it('.outliersFactor works', async () => {
await autosize({ outliersFactor: 40 }, [50, 144]);
});

it('.expand works', async () => {
await autosize({ expand: true }, [134, 148]);
});
Expand All @@ -498,6 +502,7 @@ describe('<DataGridPro /> - Columns', () => {

describe('column pipe processing', () => {
type GridPrivateApiContextRef = ReturnType<typeof useGridPrivateApiContext>;

it('should not loose column width when re-applying pipe processing', () => {
let privateApi: GridPrivateApiContextRef;
function Footer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ describe('<DataGridPro /> - Tree data', () => {
/>
);
}

it('should respect the pageSize for the top level rows when toggling children expansion', () => {
render(<PaginatedTest initialModel={{ pageSize: 2, page: 0 }} />);
expect(getColumnValues(1)).to.deep.equal(['A', 'B']);
Expand Down
1 change: 1 addition & 0 deletions packages/x-data-grid/src/tests/export.DataGrid.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('<DataGrid /> - Export', () => {
});

let spyCreateObjectURL: SinonSpy;

beforeEach(() => {
spyCreateObjectURL = spy(global.URL, 'createObjectURL');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,12 @@ describe('<DesktopDatePicker />', () => {

let originalScrollX: number;
let originalScrollY: number;

beforeEach(() => {
originalScrollX = window.screenX;
originalScrollY = window.scrollY;
});

afterEach(() => {
window.scrollTo(originalScrollX, originalScrollY);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ describe('<StaticDatePicker /> - Keyboard interactions', () => {
});
});
});

describe('MonthCalendar keyboard navigation', () => {
[
{ key: 'ArrowLeft', expectFocusedMonth: 'Jul' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ describe('useLicenseVerifier', function test() {
const { render } = createRenderer();

let env: any;

beforeEach(() => {
env = process.env.NODE_ENV;
// Avoid Karma "Invalid left-hand side in assignment" SyntaxError
Expand Down
1 change: 1 addition & 0 deletions packages/x-license/src/verifyLicense/verifyLicense.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const RELEASE_INFO = generateReleaseInfo(releaseDate);

describe('License: verifyLicense', () => {
let env: any;

beforeEach(() => {
env = process.env.NODE_ENV;
process.env.NODE_ENV = 'test';
Expand Down
3 changes: 3 additions & 0 deletions packages/x-tree-view/src/TreeItem/TreeItem.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ describe('<TreeItem />', () => {

expect(getByTestId('2')).not.to.have.attribute('aria-expanded');
});

it('should treat multiple empty conditional arrays as empty', () => {
const { getByTestId } = render(
<SimpleTreeView defaultExpandedNodes={['1']}>
Expand All @@ -202,6 +203,7 @@ describe('<TreeItem />', () => {

expect(getByTestId('2')).not.to.have.attribute('aria-expanded');
});

it('should treat one conditional empty and one conditional with results as expandable', () => {
const { getByTestId } = render(
<SimpleTreeView defaultExpandedNodes={['1', '2']}>
Expand All @@ -218,6 +220,7 @@ describe('<TreeItem />', () => {

expect(getByTestId('2')).to.have.attribute('aria-expanded', 'true');
});

it('should handle edge case of nested array of array', () => {
const { getByTestId } = render(
<SimpleTreeView defaultExpandedNodes={['1', '2']}>
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ async function initializeEnvironment(
expect(await input.inputValue()).to.equal('02/11/2022');
});
});

describe('<MobileDatePicker />', () => {
it('should allow selecting a value', async () => {
await renderFixture('DatePicker/BasicMobileDatePicker');
Expand All @@ -606,6 +607,7 @@ async function initializeEnvironment(
});
});
});

describe('<DesktopDateTimePicker />', () => {
it('should allow selecting a value', async () => {
await renderFixture('DatePicker/BasicDesktopDateTimePicker');
Expand Down Expand Up @@ -695,6 +697,7 @@ async function initializeEnvironment(
});
});
});

describe('<DateRangePicker />', () => {
it('should allow selecting a range value', async () => {
// firefox in CI is not happy with this test
Expand Down

0 comments on commit fde767e

Please sign in to comment.