Summary
The test in actionBar.test.ts currently relies on anonymous polling logic to wait for packager state updates. This logic duplicates existing utilities and lacks consistent timeout and error handling.
Specifically, the test manually polls for state changes instead of reusing ComponentHelper.waitPackagerStateIncludes, which is already designed for this purpose.
This can lead to:
duplicated wait logic
inconsistent timeout behavior
potential missed assertions if the packager state does not update in time
Why this is useful
Replacing the custom polling logic with ComponentHelper.waitPackagerStateIncludes improves consistency across tests and leverages centralized timeout and error handling.
It also reduces maintenance overhead and prevents subtle test instability caused by incomplete or inconsistent wait implementations.
Suggested scope
Replace the anonymous polling logic in actionBar.test.ts with ComponentHelper.waitPackagerStateIncludes
Ensure the test still correctly asserts the expected packager state
Remove any redundant or duplicated wait logic
Verify test stability under normal and delayed packager scenarios
Evidence
Current implementation uses manual polling instead of shared helper utilities
ComponentHelper.waitPackagerStateIncludes already provides standardized waiting behavior
Similar patterns in other tests already rely on shared helpers
Validation
Tests should pass consistently after replacing the polling logic
No duplicated wait logic should remain in the test
Simulated delayed packager updates should still be handled correctly
Full test suite (npm test) should pass without regressions
Summary
The test in actionBar.test.ts currently relies on anonymous polling logic to wait for packager state updates. This logic duplicates existing utilities and lacks consistent timeout and error handling.
Specifically, the test manually polls for state changes instead of reusing ComponentHelper.waitPackagerStateIncludes, which is already designed for this purpose.
This can lead to:
duplicated wait logic
inconsistent timeout behavior
potential missed assertions if the packager state does not update in time
Why this is useful
Replacing the custom polling logic with ComponentHelper.waitPackagerStateIncludes improves consistency across tests and leverages centralized timeout and error handling.
It also reduces maintenance overhead and prevents subtle test instability caused by incomplete or inconsistent wait implementations.
Suggested scope
Replace the anonymous polling logic in actionBar.test.ts with ComponentHelper.waitPackagerStateIncludes
Ensure the test still correctly asserts the expected packager state
Remove any redundant or duplicated wait logic
Verify test stability under normal and delayed packager scenarios
Evidence
Current implementation uses manual polling instead of shared helper utilities
ComponentHelper.waitPackagerStateIncludes already provides standardized waiting behavior
Similar patterns in other tests already rely on shared helpers
Validation
Tests should pass consistently after replacing the polling logic
No duplicated wait logic should remain in the test
Simulated delayed packager updates should still be handled correctly
Full test suite (npm test) should pass without regressions