Skip to content

Conversation

@timmywil
Copy link
Member

@timmywil timmywil commented Mar 3, 2016

Fixes gh-2073

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @markelog, @jeresig and @guybedford to be potential reviewers

@markelog
Copy link
Member

markelog commented Mar 3, 2016

Ref jquery-migrate issue.

I wonder if we should add tests not only for the jQuery constructor for these selectors, but specifically and isolated for these functions

@dmethvin
Copy link
Member

dmethvin commented Mar 3, 2016

If we'll start warning about this soon (as in potentially Migrate 3.0) is there a UI ticket for this?

@timmywil
Copy link
Member Author

timmywil commented Mar 3, 2016

@markelog I'm not sure what you're suggesting. We have tests for the added selectors.

@markelog
Copy link
Member

markelog commented Mar 3, 2016

@timmywil

we have stuff like -

assert.equal( jQuery( "#table td:visible" ).length, 1, "hidden cell is not perceived as visible (#4512). Works on table elements" );

but should we have stuff like -

  assert.equal(jQuery.expr.pseudos.visible(td), false);

instead?
Should we have direct tests? Cause tests through jQuery constructor or jQuery#(find | is) are proxies, if they work, doesn't mean the jQuery.expr.pseudos.visible methods works as expected, maybe jQuery constructor as unindent decorator did something along the way and positive result is just a side-effect.

In other words, i'm talking about perfectionism :)

jQuery.expr = Sizzle.selectors;

// Deprecated
jQuery.expr[ ":" ] = jQuery.expr.pseudos;
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this move to the deprecated module?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought it would be odd considering we have selector-native, which doesn't include this.

@timmywil
Copy link
Member Author

timmywil commented Mar 4, 2016

if they work, doesn't mean the jQuery.expr.pseudos.visible methods works as expected

I think it does with the tests we have.

@markelog
Copy link
Member

markelog commented Mar 4, 2016

I think it does with the tests we have.

Some coverage tools would also agree with me in that assessment, but yeah, i guess we can take care of that when we implement it.

@timmywil
Copy link
Member Author

timmywil commented Mar 4, 2016

Some coverage tools would also agree with me in that assessment

How so? It's still hitting the codepaths.

For example, the 2 relevant lines in "src/css/hiddenVisibleSelectors.js" are 7 and 10, and they are executed, so coverage would be good, right?

@timmywil timmywil closed this in 0402963 Mar 7, 2016
@timmywil timmywil deleted the pseudos branch March 7, 2016 16:15
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants