Skip to content

Add missing tests, make tests less "interactive", minor fixes #6

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

Closed

Conversation

gkalpak
Copy link

@gkalpak gkalpak commented Oct 10, 2014

Fixes a couple of bugs.
Simplified logic in a couple of places.
Added tests for <body> with border/margin/padding/boxSizing.
Refactored tests to make them less dependent from the actual interaction with the browser.

@gkalpak
Copy link
Author

gkalpak commented Oct 10, 2014

@petebacondarwin : With this PR I think all comments from angular#9517 are taken care of.

Except for the one about using the load event. I couldn't make it work, so I reverted back to using readystatechange.
Besides having to mock a bunch of stuff (because we are passing a mocked $window object), I couldn't find a way to trigger the load event.

gkalpak and others added 5 commits October 10, 2014 13:05
Add support for a configurable vertical scroll offset to `$anchorScroll`.

The offset can be defined by a specific number of pixels, a callback function
that returns the number of pixels on demand or a jqLite/JQuery wrapped DOM
element whose height and position are used if it has fixed position.

The offset algorithm takes into account items that are near the bottom of
the page preventing over-zealous offset correction.

Closes angular#9368
Closes angular#2070
Closes angular#9360
Add tests for <body> with border/margin/padding and boxSizing.
Simplify and fix a couple of bugs.
Mock `getBoundingClientRect()` method of elements in tests, instead of
relying on the browser to actually size and scroll the elements.
@gkalpak gkalpak force-pushed the anchorScroll-offset branch from fbe10a6 to 4e7569c Compare October 10, 2014 10:26
@gkalpak
Copy link
Author

gkalpak commented Oct 10, 2014

There is one failing test, because of this:
https://github.com/angular/angular.js/pull/9540/files#diff-8e0d9e5c18fe4f1050484080525d4367L283

Once it's merged, the test will pass.

@petebacondarwin petebacondarwin force-pushed the anchorScroll-offset branch 2 times, most recently from 41f6e7e to f774412 Compare October 10, 2014 12:14
@petebacondarwin
Copy link
Owner

Merged

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