aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/selector.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-02-09 15:18:07 +0000
committerJohn Resig <jeresig@gmail.com>2009-02-09 15:18:07 +0000
commitb16da9d762c5fc87c5a9afacd517af0036972a47 (patch)
tree75c6e14ce6a08720fd282e75714455f5e2a31232 /test/unit/selector.js
parentab74ce7b57f2baa297723416573c2cf6ca67f936 (diff)
downloadjquery-b16da9d762c5fc87c5a9afacd517af0036972a47.tar.gz
jquery-b16da9d762c5fc87c5a9afacd517af0036972a47.zip
Reworked the attribute selection code to be able to select false-y values - and added some tests to verify that they work well against expandos.
Diffstat (limited to 'test/unit/selector.js')
-rw-r--r--test/unit/selector.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/unit/selector.js b/test/unit/selector.js
index 4c63a7a19..924f41d0e 100644
--- a/test/unit/selector.js
+++ b/test/unit/selector.js
@@ -215,7 +215,7 @@ test("child and adjacent", function() {
});
test("attributes", function() {
- expect(37);
+ expect(40);
t( "Attribute Exists", "a[title]", ["google"] );
t( "Attribute Exists", "*[title]", ["google"] );
t( "Attribute Exists", "[title]", ["google"] );
@@ -233,6 +233,13 @@ test("attributes", function() {
t( "for Attribute", "form label[for]", ["label-for"] );
t( "for Attribute in form", "#form [for=action]", ["label-for"] );
+
+ jQuery("form input")[0].test = 0;
+ jQuery("form input")[1].test = 1;
+
+ t( "Expando attribute", "form input[test]", ["text1", "text2"] );
+ t( "Expando attribute value", "form input[test=0]", ["text1"] );
+ t( "Expando attribute value", "form input[test=1]", ["text2"] );
t( "Attribute containing []", "input[name^='foo[']", ["hidden2"] );
t( "Attribute containing []", "input[name^='foo[bar]']", ["hidden2"] );