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

Fix and Re-enable some unit tests on dialog, tooltip, and draggable #1144

Closed
wants to merge 2 commits into from

Conversation

bdowling
Copy link
Contributor

@bdowling bdowling commented Dec 2, 2013

While working on one of my own modules that extends dialogs, I wanted to validate existing dialog tests passed and realized they were disabled in grunt/phantomjs out of the box.

When looking deeper, it seems the main reason my have been the tiny viewportSize phantomjs starts out with causing some of the issues. A PR to gruntjs/grunt-lib-phantomjs#21 adds the ability to change the viewport directly from the config. I know the tests won't pass in your CI until this is fixed, but I wanted to record this PR just so I didn't forget about them. Alternatively, I could have included alternate phantomjs/main.js and a phantomScript option, but that didn't seem like the best option.

Note, I do have questions about the fixes I did here (bdowling/jquery-ui@jquery:master...master#diff-1b4b30b16776f6b3f0a4f05ddfbeb518R561).. Not sure why $(":focus") differs from document.activeElement in these instances in phantomjs, but I don't think changing this impacts what is being tested here. Perhaps a separate test that should be included in jQuery itself?

I noticed some unit tests were disabled in phantomjs.  dialog and draggable depend
on a larger viewPort.  tooltip just seemed to work, so I reenebaled that as well.

Changing the viewportSize depends on a not yet merged feature in gruntjs/grunt-lib-phantomjs#21
Note, this depends on the new phantomjs/main.js in the not yet merged feature
in gruntjs/grunt-lib-phantomjs#21
@bdowling
Copy link
Contributor Author

bdowling commented Dec 2, 2013

fwiw, I see Tooltip tests failed in the CI build as well. In my environment that passes just fine. I suspect that is the later phantomjs v1.9.2 that I'm using vs 1.8.2-2 in your CI build.

The other CI failures were expected as mentioned.

In my build:

>> 5659 assertions passed (38096ms)

@tjvantoll
Copy link
Member

Interesting, I can't speak to the history of exactly why these tests were disabled.

I verified that the :focus change fixes a few dialog tests in phantom. I wonder if this is related to ariya/phantomjs#10427, although @JamesMGreene's comment says there should be a workaround in place in jQuery core 1.8.2.

Despite the focus tests working, I'm still getting several dialog and tooltip failures in my environment. I'm not sure why we would have different results. I'm also using version 1.9.2 of phantomjs.

@bdowling
Copy link
Contributor Author

bdowling commented Dec 2, 2013

If you drop this file https:/bdowling/grunt-lib-phantomjs/blob/570fce49f9ca0be04230f693d98c637d9404c0a8/phantomjs/main.js
Into your grunt-lib-phantomjs phantomjs/ folder you can get the needed viewportSize support I mentioned is needed as well..

@tjvantoll
Copy link
Member

Ah ok. After doing that all tests pass for me as well. This look great. Could you ping us when your PR is included in a released version of grunt-lib-phantomjs so we can look into moving forward with this?

@jzaefferer
Copy link
Member

@bdowling I've reviewed gruntjs/grunt-lib-phantomjs#47, see my comments there.

@@ -56,7 +56,7 @@
},
"dependencies": {},
"devDependencies": {
"grunt": "0.4.1",
"grunt": "~0.4.2",
Copy link
Member

Choose a reason for hiding this comment

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

Can you change this to "0.4.2"? We like using exact version numbers.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, why is this change required?

@mikesherov
Copy link
Member

@bdowling thanks again for contributing! Can you split this into different PRs? One for the focus issue, and one for the viewportSize issue? That way, we can merge in the portion that isn't waiting on grunt to be updated?

@scottgonzalez
Copy link
Member

@bdowling I'd like to land what we can. Can you split this as @mikesherov suggested?

@bdowling
Copy link
Contributor Author

Sure, I will take a look, I was hoping to see the grunt phantomjs fix go in so I could mark the release # dependency on that side at the same time.

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

Successfully merging this pull request may close these issues.

5 participants