From 815f10d3ec5d6efe69def1f500d83279ed5cd121 Mon Sep 17 00:00:00 2001 From: Andrew Cherniavskii Date: Tue, 3 Dec 2024 12:11:48 +0100 Subject: [PATCH] [test] Force hover in headless Chrome (#15710) --- .../src/tests/columns.DataGridPro.test.tsx | 16 ++++++++-------- test/karma.conf.js | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx b/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx index 3d6e0567771d6..de3639feaffd0 100644 --- a/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx +++ b/packages/x-data-grid-pro/src/tests/columns.DataGridPro.test.tsx @@ -166,11 +166,11 @@ describe(' - Columns', () => { await microtasks(); expect(onColumnWidthChange.callCount).to.be.at.least(2); const widthArgs = onColumnWidthChange.args.map((arg) => arg[0].width); - const isWidth114Present = widthArgs.some((width) => width === 114); - expect(isWidth114Present).to.equal(true); + const isWidth120Present = widthArgs.some((width) => width === 120); + expect(isWidth120Present).to.equal(true); const colDefWidthArgs = onColumnWidthChange.args.map((arg) => arg[0].colDef.width); - const isColDefWidth114Present = colDefWidthArgs.some((width) => width === 114); - expect(isColDefWidth114Present).to.equal(true); + const isColDefWidth120Present = colDefWidthArgs.some((width) => width === 120); + expect(isColDefWidth120Present).to.equal(true); }); it('should not affect other cell elements that are not part of the main DataGrid instance', () => { @@ -473,7 +473,7 @@ describe(' - Columns', () => { render(); await apiRef.current.autosizeColumns(); await microtasks(); - expect(getWidths()).to.deep.equal([211, 233]); + expect(getWidths()).to.deep.equal([155, 177]); }); it('should work through double-clicking the separator', async () => { @@ -483,14 +483,14 @@ describe(' - Columns', () => { )[1]; fireEvent.doubleClick(separator); await microtasks(); - expect(getWidths()).to.deep.equal([100, 233]); + expect(getWidths()).to.deep.equal([100, 177]); }); it('should work on mount', async () => { render(); await microtasks(); /* first effect after render */ await microtasks(); /* async autosize operation */ - expect(getWidths()).to.deep.equal([211, 233]); + expect(getWidths()).to.deep.equal([155, 177]); }); describe('options', () => { @@ -506,7 +506,7 @@ describe(' - Columns', () => { }); it('.includeHeaders works', async () => { - await autosize({ includeHeaders: true }, [211, 233]); + await autosize({ includeHeaders: true }, [155, 177]); }); it('.includeOutliers works', async () => { diff --git a/test/karma.conf.js b/test/karma.conf.js index 87070fd88d443..a83e613e0f199 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -97,7 +97,7 @@ module.exports = function setKarmaConfig(config) { // to mimic "desktop" environment more correctly we force blink to have `pointer: fine` support // this allows correct pickers behavior, where their rendering depends on this condition // /~https://github.com/microsoft/playwright/issues/7769#issuecomment-1205106311 - '--blink-settings=primaryPointerType=4', + '--blink-settings=primaryPointerType=4,primaryHoverType=2', // increasing default `800x600` size to certain window sizing cases to consider browser as "mobile" // i.e.: date time pickers do check height > 667 '--window-size=1000,800',