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

Fixed datepicker positioning calculation #2337

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oojacoboo
Copy link

See #2057. This still needs merging.

Copy link

linux-foundation-easycla bot commented Mar 14, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

Copy link
Member

@mgol mgol left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. We'll need tests for this change, though, as I indicated in the other PR. Have a look at existing test in https://github.com/jquery/jquery-ui/tree/main/tests/unit/datepicker to see how to write one.

@oojacoboo
Copy link
Author

@mgol these are unit tests. Can you please explain what about this change needs to be added or updated with unit tests? As for integration tests, which is actually the only way to add tests around this - does this lib even have those? And if so, can you please direct me to one as an example where you can test the visibility of the datepicker's location within a browser window?

@mgol
Copy link
Member

mgol commented Mar 14, 2025

We only have unit tests. While I agree some tests would better work as integration ones, most of the changes can be tested via unit tests.

I'd start with constructing a runnable example on a platform like JS Bin where the issue is obvious - this would be useful for people looking at the reasons for this patch in the future as well. Then we can think about a possible test case that would represent what we saw.

If you don't have any idea for how the unit test would look like, start with a runnable example and maybe I'll be able to propose something.

@oojacoboo
Copy link
Author

@mgol How are you going to write a unit test for something that's dynamically calculated based on a browser window's scroll position?

@mgol
Copy link
Member

mgol commented Mar 15, 2025

Tests are run on real browsers, the HTML files used for tests are also defined by us. You can scroll programmatically as long as you make sure there’s enough content to have something to scroll even on large screens.

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

Successfully merging this pull request may close these issues.

2 participants