Skip to content

Fixed failing frontend tests#3213

Merged
drosetti merged 4 commits intointelowlproject:developfrom
IshaanXCoder:fix/failing-tests-fixed
Jan 26, 2026
Merged

Fixed failing frontend tests#3213
drosetti merged 4 commits intointelowlproject:developfrom
IshaanXCoder:fix/failing-tests-fixed

Conversation

@IshaanXCoder
Copy link
Contributor

Closes #3190 - Frontend test failing

Description

This PR is a clean version of #3206
Details:

  • Github CI/CD uses node version 18 but i was locally using 24.2.0 because of which most of the tests failed.
  • CI/CD used UTC timezone while my system worked on IST timezone because of wihch charts.test.jsx was failing (added UTC by default in package.json)
  • timepicker.test.jsx is same as changed in 0969cb3

Type of change

  • Bug fix (non-breaking change which fixes an issue).

Checklist

  • I have read and understood the rules about how to Contribute to this project
  • The pull request is for the branch develop
  • [N/A] Linters (Black, Flake, Isort) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.
  • I have added tests for the feature/bug I solved (see tests folder). All the tests (new and old ones) gave 0 errors.

Copilot AI review requested due to automatic review settings January 19, 2026 18:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes failing frontend tests by addressing Node version and timezone inconsistencies between local development and CI/CD environments. The changes ensure tests run consistently regardless of the environment's Node version or timezone settings.

Changes:

  • Set UTC timezone for all test runs to eliminate timezone-dependent test failures
  • Increase test timeout for long-running scan form tests
  • Update TimePicker test assertions to handle browser differences in millisecond formatting
  • Pin @testing-library/dom dependency version

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
frontend/package.json Sets UTC timezone for test script and pins @testing-library/dom dependency version
frontend/tests/components/scan/ScanForm/ScanForm.toastRedirect.test.jsx Increases Jest timeout to 30 seconds for longer-running tests
frontend/tests/components/common/TimePicker.test.jsx Updates assertions to use regex matching for datetime values, handling optional milliseconds

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

);

jest.setTimeout(30000);
describe("ScanForm adavanced use", () => {
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Spelling error: "adavanced" should be "advanced".

Suggested change
describe("ScanForm adavanced use", () => {
describe("ScanForm advanced use", () => {

Copilot uses AI. Check for mistakes.

jest.setTimeout(30000);
describe("ScanForm adavanced use", () => {
/* EXTREMELY IMPORTART! These tests need to be execute sequentially or they will fail!
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Spelling error: "IMPORTART" should be "IMPORTANT".

Suggested change
/* EXTREMELY IMPORTART! These tests need to be execute sequentially or they will fail!
/* EXTREMELY IMPORTANT! These tests need to be execute sequentially or they will fail!

Copilot uses AI. Check for mistakes.
@IshaanXCoder
Copy link
Contributor Author

hey @mlodic PTAL

"prettier": "^3.3.3",
"sass": "^1.83.0",
"stylelint": "^14.9.1",
"stylelint": "^14.16.1",
Copy link
Member

Choose a reason for hiding this comment

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

you updated and added some dependencies...revert this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made the changes

Copilot AI review requested due to automatic review settings January 21, 2026 10:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings January 21, 2026 10:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@IshaanXCoder
Copy link
Contributor Author

@mlodic can you review this whenever free?

@mlodic
Copy link
Member

mlodic commented Jan 22, 2026

you still didn't explain the updated dependency. Also please @drosetti review

@IshaanXCoder
Copy link
Contributor Author

IshaanXCoder commented Jan 22, 2026

Hey @mlodic
@testing-library/dom is a required peer dependency of @testing-library/user-event": "^14.5.2"
Without it being explicitly declared, ~40 test suites failed.

Screen.Recording.2026-01-22.at.12.11.42.PM.mov

@IshaanXCoder
Copy link
Contributor Author

@IshaanXCoder
Copy link
Contributor Author

@mlodic any updates on this? sorry for pinging you again and again, accordingly i'll start working on another issue :)

@drosetti drosetti merged commit f1b30f9 into intelowlproject:develop Jan 26, 2026
14 of 15 checks passed
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.

4 participants