Skip to content

Comments

[NDH-776] Fix Frontend Unit Test Warnings#374

Merged
spopelka-dsac merged 5 commits intomainfrom
sachin/ndh-776-fixing-playwright-warnings
Feb 3, 2026
Merged

[NDH-776] Fix Frontend Unit Test Warnings#374
spopelka-dsac merged 5 commits intomainfrom
sachin/ndh-776-fixing-playwright-warnings

Conversation

@sachin-panayil
Copy link
Collaborator

Fix Frontend Unit Test Warnings

Jira Ticket #776

Problem

When running make test locally, The frontend unit tests outputs a number of errors and warnings.
image

Solution

Pass in mock frontend settings when building unit tests so that we no longer need to make async calls.

Result

Warnings are all gone and all tests pass

Test Plan

  • run make test

Copy link
Contributor

@spopelka-dsac spopelka-dsac left a comment

Choose a reason for hiding this comment

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

Minor change to one test. I'm interested how you arrived at this approach vs. wrapping the render statements in act() as indicated in the error messages, but this approach works, too!

@sachin-panayil
Copy link
Collaborator Author

I'm interested how you arrived at this approach vs. wrapping the render statements in act() as indicated in the error messages,

@spopelka-dsac the warnings were caused because there was state changes after the component was unmounted so if we wrapped render in act(), we would still get the warning. mocking eliminates the async behavior that caused the state changes which actually solves the problem. a side effect is that we dont need to make that fetch anymore so we run tests faster (by like 5ms lol)

Copy link
Contributor

@spopelka-dsac spopelka-dsac left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@spopelka-dsac spopelka-dsac reopened this Feb 3, 2026
@spopelka-dsac spopelka-dsac enabled auto-merge (squash) February 3, 2026 14:29
@spopelka-dsac spopelka-dsac merged commit a3bdac0 into main Feb 3, 2026
12 of 18 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.

2 participants