From a5fe12b9a1f6700ecadefbb52956ea7babd96a90 Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Wed, 23 Jan 2008 12:45:28 +0000 Subject: [PATCH] prototype: Add tests for Element#match. --- CHANGELOG | 2 ++ test/unit/selector.html | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 10410b8..5f0c3e9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Add tests for Element#match. [Tobie Langel] + * Fix Element#writeAttribute to work with 'cellspacing' and 'cellpadding' attributes in IE. Closes #9983. [/dev/urandom, Tobie Langel] * Prevent a potential security issue for cross-site ajax requests. [Alexey Feldgendler, sam, Tobie Langel] diff --git a/test/unit/selector.html b/test/unit/selector.html index 6ccb819..f4e93f9 100644 --- a/test/unit/selector.html +++ b/test/unit/selector.html @@ -229,6 +229,7 @@ testElementMatch: function() {with(this) { var span = $('dupL1'); + // tests that should pass assert(span.match('span')); assert(span.match('span#dupL1')); @@ -248,6 +249,9 @@ assert(!$('link_2').match('a[rel^=external]')); assert($('link_1').match('a[rel^=external]')); + + assert(span.match({ match: function(element) { return true }}), 'custom selector'); + assert(!span.match({ match: function(element) { return false }}), 'custom selector'); }}, testSelectorWithSpaceInAttributeValue: function() {with(this) {