Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
| joinButton.focus = jest.fn(); | ||
| wrapper.appendChild(joinButton); | ||
|
|
||
| Object.defineProperty(document, 'activeElement', { |
There was a problem hiding this comment.
🔴 High Severity - Test isolation leak
This test overrides document.activeElement using Object.defineProperty but never restores the original value in cleanup. This leaks across tests and can cause unpredictable behavior in subsequent tests.
Impact: Flaky tests, hard-to-debug failures in other test suites.
Suggestion: Save the original property descriptor before overriding and restore it in afterEach or at the end of this test:
const originalDescriptor = Object.getOwnPropertyDescriptor(document, 'activeElement');
// ... test code ...
Object.defineProperty(document, 'activeElement', originalDescriptor);
Shreyas281299
left a comment
There was a problem hiding this comment.
Review Summary
Found 4 high-severity test isolation issues that need to be fixed:
- Line 285 & 318: overrides not restored - leaks across tests
- Line 429 & 472: overrides not restored on error - causes flaky tests
- Line 5: Module-scoped shared across tests without reset
Additionally, there's an optional suggestion at line 233 about refactoring the accessibility tests for better resilience.
Please address the high-severity isolation issues to prevent flaky test behavior.
Shreyas281299
left a comment
There was a problem hiding this comment.
Review Summary: Found 4 high-severity test isolation issues that need to be fixed. Lines 285 and 318: activeElement overrides not restored. Lines 429 and 472: MutationObserver overrides not restored on error. Line 5: Module-scoped state shared across tests. Please address these isolation issues to prevent flaky tests.
|
Comments Addressed |
COMPLETES #https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-772626
This pull request addresses
Adds unit tests for our meetings widget repo
by making the following changes
wrote UTs
Change Type
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging
Make sure to have followed the contributing guidelines before submitting.