aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/traversing.js
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2013-04-08 23:40:08 +0200
committerDave Methvin <dave.methvin@gmail.com>2013-04-17 23:06:33 -0400
commit0db70aa1fa084ccf1ef90d9b78382df95bdf9c85 (patch)
tree6588d1e0f43d977fb7cf0eabda9260d1b9231586 /test/unit/traversing.js
parent12a101729086ec1f9b8b029cd66971c11959bc33 (diff)
downloadjquery-0db70aa1fa084ccf1ef90d9b78382df95bdf9c85.tar.gz
jquery-0db70aa1fa084ccf1ef90d9b78382df95bdf9c85.zip
Fix #13741. Make wrap/unwrap methods optional; close gh-1236.
move size() test to unit/deprecated; don't use size() in other tests; make 2 unit tests actually fire; code cleanup
Diffstat (limited to 'test/unit/traversing.js')
-rw-r--r--test/unit/traversing.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/test/unit/traversing.js b/test/unit/traversing.js
index 709d357e6..b0e5011e8 100644
--- a/test/unit/traversing.js
+++ b/test/unit/traversing.js
@@ -143,14 +143,14 @@ test("is() with :has() selectors", function() {
test("is() with positional selectors", function() {
expect(24);
- jQuery(
- "<p id='posp'><a class='firsta' href='#'><em>first</em></a><a class='seconda' href='#'><b>test</b></a><em></em></p>"
- ).appendTo( "#qunit-fixture" );
-
var isit = function(sel, match, expect) {
equal( jQuery( sel ).is( match ), expect, "jQuery('" + sel + "').is('" + match + "')" );
};
+ jQuery(
+ "<p id='posp'><a class='firsta' href='#'><em>first</em></a><a class='seconda' href='#'><b>test</b></a><em></em></p>"
+ ).appendTo( "#qunit-fixture" );
+
isit( "#posp", "#posp:first", true );
isit( "#posp", "#posp:eq(2)", false );
isit( "#posp", "#posp a:first", false );
@@ -272,21 +272,21 @@ test("filter(jQuery)", function() {
test("filter() with positional selectors", function() {
expect(19);
- jQuery( "" +
- "<p id='posp'>" +
- "<a class='firsta' href='#'>" +
- "<em>first</em>" +
- "</a>" +
- "<a class='seconda' href='#'>" +
- "<b>test</b>" +
- "</a>" +
- "<em></em>" +
- "</p>" ).appendTo( "#qunit-fixture" );
-
var filterit = function(sel, filter, length) {
equal( jQuery( sel ).filter( filter ).length, length, "jQuery( " + sel + " ).filter( " + filter + " )" );
};
+ jQuery( "" +
+ "<p id='posp'>" +
+ "<a class='firsta' href='#'>" +
+ "<em>first</em>" +
+ "</a>" +
+ "<a class='seconda' href='#'>" +
+ "<b>test</b>" +
+ "</a>" +
+ "<em></em>" +
+ "</p>" ).appendTo( "#qunit-fixture" );
+
filterit( "#posp", "#posp:first", 1);
filterit( "#posp", "#posp:eq(2)", 0 );
filterit( "#posp", "#posp a:first", 0 );