Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new test cases for the SmoothScroll of the scrollspy spec #40653

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

caioalvesbraga
Copy link

Description

CT1: should enable smoothScroll and support scroll if ScrollSpy is enabled and the section is visible

This test initializes the ScrollSpy with smooth scrolling enabled and verifies that the EventHandler.off and EventHandler.on methods are called with the expected arguments when the section is visible.
CT2: should disable smoothScroll and support scroll if ScrollSpy is disabled and the section is visible

This test initializes the ScrollSpy with smooth scrolling disabled and checks if the EventHandler.off method is called and EventHandler.on is not called, even when the section is visible.
CT3: should not smoothScroll if the section is not visible, even if ScrollSpy is enabled

This test ensures that smooth scrolling does not occur when the section is not visible, despite ScrollSpy being enabled. It verifies that the scroll action is not triggered for a hidden section.

CT4: should not smoothScroll if the section is not visible and smoothScroll is disabled

This test checks that smooth scrolling does not occur when both the section is not visible and smooth scrolling is disabled. It ensures that the scroll action is not triggered for a hidden section with smooth scrolling turned off.

Motivation & Context

The new tests improve the coverage of the Statements (97,54% to 97,59%), Branches (91,59% to 91,73%) and Lines (97,53% to 91,58%)

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [] Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • [] My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@caioalvesbraga caioalvesbraga requested a review from a team as a code owner July 23, 2024 02:33
@XhmikosR XhmikosR requested a review from GeoSot July 23, 2024 04:42
js/tests/unit/scrollspy.spec.js Fixed Show fixed Hide fixed
js/tests/unit/scrollspy.spec.js Fixed Show fixed Hide fixed
@XhmikosR XhmikosR changed the title Adding new test cases for the SmoothScroll of the scrollspy spec Add new test cases for the SmoothScroll of the scrollspy spec Jul 23, 2024
- Added StackedNotificationManager class to handle creation, management, and dismissal of stacked notifications.
- Notifications are displayed in a stack format with the newest at the top.
- Added automatic dismissal feature with customizable timeouts.
- Added manual dismissal option via a close button.
- Included functionality to clear all active notifications at once.
@caioalvesbraga caioalvesbraga requested a review from a team as a code owner August 15, 2024 02:14
@louismaximepiton
Copy link
Member

louismaximepiton commented Aug 19, 2024

Hey there, can you revert 184f4c7 and make it a different PR if needed (see #40731 (comment)), so it would be easier for us to review.

@caioalvesbraga
Copy link
Author

caioalvesbraga commented Aug 19, 2024

Hey there, can you revert 184f4c7 and make it a different PR if needed (see #40731 (comment)), so it would be easier for us to review.

Hey there. I followed your instructions and revert it 184f4c7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants