Lines Matching full:sort

19   QUnit.test('new and sort', function(assert) {
22 col.on('sort', function(){ counter++; });
27 col.sort();
31 col.sort();
307 QUnit.test('add model to collection with sort()-style comparator', function(assert) {
338 collection.sort();
1093 QUnit.test('#1638 - `sort` during `add` triggers correctly.', function(assert) {
1099 collection.sort();
1121 QUnit.test("`sort` shouldn't always fire on `add`", function(assert) {
1126 collection.sort = function(){ assert.ok(true); }; function
1355 QUnit.test('#1894 - Push should not trigger a sort', function(assert) {
1359 sort: function() { assert.ok(false); }
1381 QUnit.test('#1894 - `sort` can optionally be turned off', function(assert) {
1385 sort: function() { assert.ok(false); }
1387 new Collection().add({id: 1}, {sort: false});
1442 QUnit.test('`add` only `sort`s when necessary', function(assert) {
1447 collection.on('sort', function() { assert.ok(true); });
1448 collection.add({id: 4}); // do sort, new model
1449 collection.add({id: 1, a: 1}, {merge: true}); // do sort, comparator change
1450 collection.add({id: 1, b: 1}, {merge: true}); // don't sort, no comparator change
1451 collection.add({id: 1, a: 1}, {merge: true}); // don't sort, no comparator change
1452 collection.add(collection.models); // don't sort, nothing new
1453 collection.add(collection.models, {merge: true}); // don't sort
1456 QUnit.test('`add` only `sort`s when necessary with comparator function', function(assert) {
1463 collection.on('sort', function() { assert.ok(true); });
1464 collection.add({id: 4}); // do sort, new model
1465 collection.add({id: 1, a: 1}, {merge: true}); // do sort, model change
1466 collection.add({id: 1, b: 1}, {merge: true}); // do sort, model change
1467 collection.add({id: 1, a: 1}, {merge: true}); // don't sort, no model change
1468 collection.add(collection.models); // don't sort, nothing new
1469 collection.add(collection.models, {merge: true}); // don't sort
1780 QUnit.test('#3199 - Order changing should trigger a sort', function(assert) {
1786 collection.on('sort', function() {
1792 QUnit.test('#3199 - Adding a model should trigger a sort', function(assert) {
1798 collection.on('sort', function() {
1804 QUnit.test('#3199 - Order not changing should not trigger a sort', function(assert) {
1810 collection.on('sort', function() {