Skip to content

SpinnerButton: Clear timeout on disconnect#7779

Merged
aduth merged 2 commits intomainfrom
aduth-spinner-button-clear-timeout-disconnect
Feb 7, 2023
Merged

SpinnerButton: Clear timeout on disconnect#7779
aduth merged 2 commits intomainfrom
aduth-spinner-button-clear-timeout-disconnect

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Feb 6, 2023

🎫 Ticket

Extracted from #7761, related to LG-8771.

🛠 Summary of changes

Implements a disconnectedCallback for the SpinnerButtonElement to ensure that the scheduled timeout handling for the "long delay" action message is removed.

I discovered in #7761 that this is causing the test process to hang open long after tests have finished (up to 20 seconds), likely due to the fact that the process is waiting for pending timeouts. It's a good practice for the component to clean up after itself when removed anyways, even though in the real world this would usually only happen when the user moves from one page to another.

📜 Testing Plan

  • yarn test
  • Ensure no regressions in the behavior of spinner buttons (e.g. PIV/CAC login page)

The open timeout was causing test runner not to terminate cleanly
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM

changelog: Internal, Automated Testing, Improve reliability of JavaScript tests
@aduth aduth merged commit abb1305 into main Feb 7, 2023
@aduth aduth deleted the aduth-spinner-button-clear-timeout-disconnect branch February 7, 2023 14:59
@aduth aduth mentioned this pull request Feb 9, 2023
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