Skip to content

Run tests in Firefox#3772

Merged
amanmahajan7 merged 62 commits intomainfrom
firefox
Sep 22, 2025
Merged

Run tests in Firefox#3772
amanmahajan7 merged 62 commits intomainfrom
firefox

Conversation

@amanmahajan7
Copy link
Copy Markdown
Collaborator

@amanmahajan7 amanmahajan7 commented Apr 24, 2025

Tests in FF timeout when more than one worker is used. Probably a bug
https://vitest.dev/config/#fileparallelism

@amanmahajan7 amanmahajan7 self-assigned this Apr 24, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.84%. Comparing base (54c213a) to head (a11ffb3).

Additional details and impacted files
@@             Coverage Diff             @@
##              main    #3772      +/-   ##
===========================================
- Coverage   100.00%   97.84%   -2.16%     
===========================================
  Files           46       42       -4     
  Lines         3200     1253    -1947     
  Branches       414      348      -66     
===========================================
- Hits          3200     1226    -1974     
- Misses           0       27      +27     

see 46 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread test/browser/utils.tsx
}
}

export async function tabIntoGrid() {
Copy link
Copy Markdown
Collaborator Author

@amanmahajan7 amanmahajan7 Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this utility so we can control tabbing into the grid

@amanmahajan7 amanmahajan7 marked this pull request as ready for review September 16, 2025 18:30
Comment thread test/browser/column/resizable.test.tsx Outdated
const grid = getGrid();
await expect.element(grid).toHaveStyle({ gridTemplateColumns: '639.328px 639.328px 639.344px' });

function testGridTemplateColumns(chrome: string, firefox: string, firefoxCI = firefox) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better way? I initially thought about using toBeCloseTo but FF in CI has completely different column size. No idea why

@amanmahajan7 amanmahajan7 changed the title Run tests in FF Run tests in Firefox Sep 18, 2025
Comment thread .github/workflows/ci.yml
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await userEvent.tab();
await expect.element(editor).not.toBeInTheDocument();
expect(getCellsAtRowIndex(0)[0]).toHaveTextContent(/^12$/);
expect(getCellsAtRowIndex(0)[0]).toHaveTextContent(12);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not keep the strict check?

await userEvent.click(getCellsAtRowIndex(0)[0]);
await userEvent.keyboard('123{enter}');
expect(getCellsAtRowIndex(0)[0]).toHaveTextContent(/^1123$/);
// TODO: await userEvent.keyboard('123{enter}'); fails in FF
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a bug in RDG no?

Copy link
Copy Markdown
Collaborator Author

@amanmahajan7 amanmahajan7 Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine in FF when I tested. Test is failing for some reason

Comment thread test/browser/column/resizable.test.tsx Outdated
expect(onColumnResize).toHaveBeenCalledExactlyOnceWith(
expect.objectContaining(columns[1]),
327.703125
expect.toSatisfy((width) => (width >= 327.7 && width <= 327.9) || width === 400)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could add comment explaining this

Comment on lines +346 to +347
firefox,
firefoxCI
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it so different in CI? 🤔

Comment thread test/browser/column/renderEditCell.test.tsx Outdated
Comment thread test/browser/column/renderEditCell.test.tsx Outdated
Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Sep 22, 2025

CLA assistant check
All committers have signed the CLA.

Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>
@amanmahajan7 amanmahajan7 merged commit 58d5e3c into main Sep 22, 2025
2 checks passed
@amanmahajan7 amanmahajan7 deleted the firefox branch September 22, 2025 18:08
royue pushed a commit to royue/react-data-grid that referenced this pull request Dec 17, 2025
* Run tests in FF

* Fix editor test, use istanbul for coverage

* Remove optimizeDeps

* revert 1 change

* Fix keyboard tests

* Revert

* Fix rowHeight tests

* Fix focus in FF

* headless

* ESLint

* Tweak focus logic

* Fix test

* Fix test in FF

* Revert firefox workaround

* try beta version

* Revert "try beta version"

This reverts commit a00f60e.

* Try pinning vitest

* Revert "Try pinning vitest"

This reverts commit faafac2.

* Revrt timeout

* try `maxWorkers`

* `maxWorkers: 4,`

* increate testTimeout

* try beta

* Fix grouping test

* Fix a few tests

* Format

* Use stable version

* -1

* -1

* -1

* -2

* tryl gridcell role

* biome

* Remove timeout

* Does this work?

* Set maxWorkers = 1

* revert a few changes

* Revert 1 more change

* one more

* Revert a few more changes

* Fix resizable test

* Add speciial case for firefox CI

* revert 1 change

* Fix test

* Revert accidental change

* tweak

* Use SHA

* remove `react-dnd` pattern

* Disable `fileParallelism`

* Check chrome explicitly

* Use strick check

* Add a comment

* Update test/browser/column/renderEditCell.test.tsx

Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>

* Update test/browser/column/renderEditCell.test.tsx

Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>

---------

Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants