Commit Graph

87 Commits

Author SHA1 Message Date
Richard Gibson
4ef516903e Fix #13539: Utilize Sizzle hooks. Close gh-1215. 2013-04-04 23:04:05 -04:00
dmitrygusev
a13cadadf6 Fix typos. Close gh-1186. 2013-02-28 15:55:55 -05:00
Richard Gibson
1f76536650 No ticket: Revise unit tests in anticipation of Sizzle-free builds
(cherry picked from commit 59f5adb622)
2013-02-22 20:33:00 -05:00
Richard Gibson
5e29ff7e59 Fix #13265 #13332: Allow .parent/.closest with text nodes. Close gh-1146. 2013-02-13 21:22:53 -05:00
Richard Gibson
a763ae7277 Fix #11115: Normalize boolean attributes/properties. Close gh-1066. 2012-12-15 23:16:48 -05:00
timmywil
05531fc408 Adjust jQuery('html') detection to only match when html starts with '<' (not counting space characters). Fixes #11290. 2012-12-13 15:31:02 -05:00
Timo Tijhof
55313d32a2 Test: Update index.html to new QUnit format. Close gh-1061.
Depends on jquery/sizzle#177, included with the Sizzle submodule in this commit.
2012-12-10 21:48:20 -05:00
Dave Methvin
8657538b33 Test case for #12816 2012-10-31 23:36:43 -04:00
Mike Sherov
e8f91514a6 Fix #12009. $().find( DOMElement ) should pushStack properly. Close gh-927. 2012-10-30 13:32:53 -04:00
Timo Tijhof
36c9ecb0f5 Implement expectation test instead of using _removeData. Close gh-997.
* Removed inline usage of QUnit.reset() because it is messing with the
  expectation model as reset does .empty() which does a recursive cleanData
  on everything in #qunit-fixture, so any expectJqData above .reset() would
  fail negatively.

  Instead of calling reset inline, either updated the following assertions to
  take previous assertions' state into account, or broke the test() up into
  2 tests at the point where it would call QUnit.reset.

* After introducing the new memory leak discovery a whole bunch of tests were
  failing as they didn't clean up everything. However I didn't (yet) add
  QUnit.expectJqData calls all over the place because in most if not all of
  these cases it is valid data storage. For example in test "data()", there
  will be an internal data key for "parsedAttrs". This particular test isn't
  intending to test for memory leaks, so therefor I made the new discovery
  system only push failures when the test contains at least 1 call to
  QUnit.expectJqData.

  When not, we'll assume that whatever data is being stored is acceptable
  because the relevant elements still exist in the DOM anyway (QUnit.reset
  will remove the elements and clean up the data automatically).

  I did add a "Always check jQuery.data" mode in the test suite that will
  trigger it everywhere. Maybe one day we'll include a call to everywhere,
  but for now I'm keeping the status quo: Only consider data left in storage
  to be a problem if the test says so ("opt-in").

* Had to move #fx-tests inside the fixture because ".remove()" test would
  otherwise remove stuff permanently and cause random other tests to fail
  as "#hide div" would yield an empty collection.
  (Why wasn't this in the fixture in the first place?)

  As a result moving fx-tests into the fixture a whole bunch of tests failed
  that relied on arbitrary stuff about the document-wide or fixture-wide
  state (e.g. number of divs etc.). So I had to adjust various tests to
  limit their sample data to not be so variable and unlimited...

* Moved out tests for expando cleanup into a separate test.

* Fixed implied global variable 'pass' in effects.js that was causing
  "TypeError: boolean is not a function" in *UNRELATED* dimensions.js that
  uses a global variable "pass = function () {};" ...

* Removed spurious calls to _removeData. The new test exposed various failures
  e.g. where div[0] isn't being assigned any data anyway.
  (queue.js and attributes.js toggleClass).

* Removed spurious clean up at the bottom of test() functions that are
  already covered by the teardown (calling QUnit.reset or removeClass to
  supposedly undo any changes).

* Documented the parentheses-less magic line in toggleClass. It appeared that
  it would always keep the current class name if there was any (since the
  assignment started with "this.className || ...".

  Adding parentheses + spacing is 8 bytes (though only 1 in gzip apparently).
  Only added the comment for now, though I prefer clarity with logical
  operators, I'd rather not face the yayMinPD[1] in this test-related commit.

* Updated QUnit urlConfig to the new format (raw string is deprecated).

* Clean up odd htmlentities in test titles, QUnit escapes this.
  (^\s+test\(.*)(&gt\;) → $1>
  (^\s+test\(.*)(&lt\;) → $1<

[1] jQuery MinJsGz Release Police Department (do the same, download less)
2012-10-28 22:44:57 -04:00
Timmy Willison
420dcc5842 Update Sizzle: allows disconnected sorting. Change add to always sort with added nodes, even when disconnected. 2012-10-16 11:54:54 -04:00
MORGAN
4bb46f413a Return correct index for no-arg index() calls. Fixes #10977. Closes gh-971 2012-10-16 10:25:08 -04:00
Mike Sherov
ed9e34482a enforce double quotes via JSHint. Closes gh-975 2012-10-16 10:17:14 -04:00
James Huston
435fbe1793 Enforce expects in events.js (https://github.com/jquery/2012-dev-summit/issues/53) Closes gh-962 2012-10-15 12:18:14 -04:00
Timmy Willison
e07b444dfe Fix a regression where has with multiple contexts was not filtering correctly. Test added. 2012-07-27 18:19:18 -04:00
Timmy Willison
17a26f5bd9 Fail silently if closest is somehow called on a document. Fixes #10726. 2012-07-25 16:05:59 -04:00
Dave Methvin
cde4c326b8 Fix #11969. Never a null moment when checking siblings. 2012-06-26 17:08:49 -04:00
Rick Waldron
7ff3da186c Unit tests are linted and passing. 2012-06-21 15:30:24 -04:00
Ben Alman
02dd7c570b jQuery#addBack supports an optional selector that can be used to filter the prior set before adding it back. Fixes #9800 2012-05-29 12:04:27 -04:00
Dave Methvin
f76518e393 Rename .andSelf to .addBack, deprecate .andSelf #9800 2012-05-15 23:14:13 -04:00
Dave Methvin
56d5c1c3a3 Fix #11738. Remove deprecated .closest(Array) => Array. 2012-05-11 15:11:13 -04:00
Richard Gibson
590bcab245 Fix #11543: .has should work on detached elements. 2012-04-05 21:03:41 -04:00
Richard Gibson
a619cb3063 Fix #11370: .siblings() shouldn't throw exception on a detached element 2012-02-23 22:40:07 -05:00
timmywil
2a63b980ed Use Sizzle.Expr.match.globalPOS for identifying POS selectors in traversing. Fixes #10970. 2011-12-12 11:23:47 -05:00
Rick Waldron
7cbd7a640f Coerce eq() argument all the time. Fixes #10616 2011-11-06 16:17:59 -05:00
Mike Sherov
f35ba5e699 Fix #10691. Remove all instances of equals() and same(), as these are deprecated in QUnit. 2011-11-06 15:27:42 -05:00
Dave Methvin
70e2e32e0e Landing pull request 491. Fix #7322. Make .is() with a positional selector work like delegated event logic. Fixes #7322.
More Details:
 - https://github.com/jquery/jquery/pull/491
 - http://bugs.jquery.com/ticket/7322
2011-09-19 23:50:52 -04:00
timmywil
0ced30e319 Move filter tests to proper location 2011-09-19 23:14:37 -04:00
timmywil
11c9de477c Added filtering tests and updating sizzle to fix filtering with positional selectors. Fixes #10315. 2011-09-19 23:09:40 -04:00
timmywil
92405d4f5f Override Sizzle attribute retrieval with jQuery.attr. Fixes #5637, #7128, #9261, #9570, #10178.
Bug fixed on the side: $(window).is('a') was throwing an exception. Fixes #10178.
2011-09-19 15:42:30 -04:00
Rick Waldron
13647e94e0 Fixes assertion counts and dom element fixture issue 2011-08-05 10:02:33 -04:00
gnarf
9a96af1d59 Quick improvement to the performace of .index() with no arguments - Adding a unit test for .index() of a node without a parent returns -1 2011-06-14 23:38:36 -05:00
John Resig
9b00827ac9 Disabling .add(form.elements) unit test. 2011-04-22 00:51:23 -04:00
timmywil
3aa46725ed Merge branch 'qunit_fixture' 2011-04-17 14:12:31 -04:00
John Resig
728a70c036 Make sure that forms and selects are added to a jQuery set correctly. Fixes #6912. 2011-04-17 10:51:24 -07:00
timmywil
ecf6a3c383 Switch QUnit div from depreceted #main to #qunit-fixture 2011-04-17 02:43:57 -04:00
timmywil
38d6d9f6e0 Adjust the unit tests in traversing - is(jQuery) to avoid long-running script alerts 2011-04-14 00:46:10 -04:00
louisremi
a5604aedb7 merge with master and resolve more conflicts 2011-04-12 11:29:25 +02:00
louisremi
8547b34f92 resolve conflict 2011-04-12 11:18:44 +02:00
louisremi
f42010b657 third batch 2011-04-12 10:47:46 +02:00
timmywil
a564a0b1ec Run order problem when running full test suite in Opera 11, removed failing test as it passed by itself and there are others just like it 2011-04-11 12:24:31 -04:00
jeresig
6591f6dd9d Fix broken merge. 2011-04-11 11:22:52 -04:00
jeresig
909a6ff60a Merge branch 'bug_7369' of https://github.com/timmywil/jquery into timmywil-bug_7369 2011-04-10 16:48:02 -04:00
jeresig
523db95de2 Merge branch '2773_find_closest' of https://github.com/timmywil/jquery into timmywil-2773_find_closest
Conflicts:
	test/unit/traversing.js
2011-04-10 16:37:09 -04:00
timmywil
a807451a23 Fixes #7369 - Using an attribute selector for a non-existent attribute raised an exception on disconnected nodes 2011-03-30 23:39:19 -04:00
timmywil
1a16776730 Remove test for bug #7369 to move the fix to a separate branch for a sooner pull 2011-03-30 23:23:38 -04:00
timmywil
e93ca40aa7 Bug #7369: Check non-existent attribute as well to be sure 2011-03-25 23:52:36 -04:00
timmywil
e6da0fa6a9 Bug #7369: Add test for disconnected node in closest when passing attribute selector; this was recently fixed in 1.5.2rc 2011-03-25 23:46:29 -04:00
timmywil
85232c97bf Traversing unit tests: added tests for passing invalid arguments to $.fn.not (should have no effect on existing object rather than return an empty object as filter does) 2011-03-23 16:04:12 -04:00
timmywil
b8013581ce Closest unit tests: add one for passing a jQuery collection with multiple elements 2011-03-23 15:56:05 -04:00