Lines Matching refs:QUnit

1 (function(QUnit) {
5 QUnit.module('Backbone.Collection', {
19 QUnit.test('new and sort', function(assert) {
37 QUnit.test('String comparator.', function(assert) {
47 QUnit.test('new and parse', function(assert) {
63 QUnit.test('clone preserves model and comparator', function(assert) {
78 QUnit.test('get', function(assert) {
88 QUnit.test('get with non-default ids', function(assert) {
104 QUnit.test('has', function(assert) {
124 QUnit.test('update index when id changes', function(assert) {
139 QUnit.test('at', function(assert) {
145 QUnit.test('pluck', function(assert) {
150 QUnit.test('add', function(assert) {
194 QUnit.test('add multiple models', function(assert) {
203 QUnit.test('add; at should have preference over comparator', function(assert) {
217 QUnit.test('add; at should add to the end if the index is out of bounds', function(assert) {
225 QUnit.test("can't add model to collection twice", function(assert) {
230 QUnit.test("can't add different model with same id to collection twice", function(assert) {
238 QUnit.test('merge in duplicate models with {merge: true}', function(assert) {
250 QUnit.test('add model to multiple collections', function(assert) {
279 QUnit.test('add model with parse', function(assert) {
294 QUnit.test('add with parse and merge', function(assert) {
307 QUnit.test('add model to collection with sort()-style comparator', function(assert) {
324 QUnit.test('comparator that depends on `this`', function(assert) {
342 QUnit.test('remove', function(assert) {
370 QUnit.test('add and remove return values', function(assert) {
404 QUnit.test('shift and pop', function(assert) {
411 QUnit.test('slice', function(assert) {
419 QUnit.test('events are unbound on remove', function(assert) {
433 QUnit.test('remove in multiple collections', function(assert) {
458 QUnit.test('remove same model in multiple collection', function(assert) {
493 QUnit.test('model destroy removes from all collections', function(assert) {
505QUnit.test('Collection: non-persisted model destroy removes from all collections', function(assert…
517 QUnit.test('fetch', function(assert) {
530 QUnit.test('fetch with an error response triggers an error event', function(assert) {
540 QUnit.test('#3283 - fetch with an error response calls error with context', function(assert) {
556 QUnit.test('ensure fetch only parses once', function(assert) {
570 QUnit.test('create', function(assert) {
581 QUnit.test('create with validate:true enforces validation', function(assert) {
599 QUnit.test('create will pass extra options to success callback', function(assert) {
623 QUnit.test('create with wait:true should not call collection.parse', function(assert) {
638 QUnit.test('a failing create returns model with errors', function(assert) {
653 QUnit.test('initialize', function(assert) {
664 QUnit.test('preinitialize', function(assert) {
675 QUnit.test('preinitialize occurs before the collection is set up', function(assert) {
689 QUnit.test('toJSON', function(assert) {
694 QUnit.test('where and findWhere', function(assert) {
714 QUnit.test('Underscore methods', function(assert) {
747 QUnit.test('Underscore methods with object-style and property-style iteratee', function(assert) {
784 QUnit.test('reset', function(assert) {
817 QUnit.test('reset with different values', function(assert) {
823 QUnit.test('same references in reset', function(assert) {
830 QUnit.test('reset passes caller options', function(assert) {
845 QUnit.test('reset does not alter options by reference', function(assert) {
856 QUnit.test('trigger custom events on models', function(assert) {
864 QUnit.test('add does not alter arguments', function(assert) {
873 QUnit.test('#714: access `model.collection` in a brand new model.', function(assert) {
888 QUnit.test('#574, remove its own reference to the .models array.', function(assert) {
898QUnit.test('#861, adding models to a collection which do not pass validation, with validate:true',…
917 QUnit.test('Invalid models are discarded with validate:true.', function(assert) {
933 QUnit.test('multiple copies of the same model', function(assert) {
944 QUnit.test('#964 - collection.get return inconsistent', function(assert) {
951 QUnit.test('#1112 - passing options.model sets collection.model', function(assert) {
959 QUnit.test('null and undefined are invalid ids.', function(assert) {
970 QUnit.test('falsy comparator', function(assert) {
985 QUnit.test('#1355 - `options` is passed to success callbacks', function(assert) {
1002 QUnit.test("#1412 - Trigger 'request' and 'sync' events.", function(assert) {
1027 QUnit.test('#3283 - fetch, create calls success with context', function(assert) {
1046 QUnit.test('#1447 - create with wait adds model.', function(assert) {
1055 QUnit.test('#1448 - add sorts collection after merge.', function(assert) {
1066 QUnit.test('#1655 - groupBy can be used with a string argument.', function(assert) {
1075 QUnit.test('#1655 - sortBy can be used with a string argument.', function(assert) {
1084 QUnit.test('#1604 - Removal during iteration.', function(assert) {
1093 QUnit.test('#1638 - `sort` during `add` triggers correctly.', function(assert) {
1106 QUnit.test('fetch parses models by default', function(assert) {
1121 QUnit.test("`sort` shouldn't always fire on `add`", function(assert) {
1133 QUnit.test('#1407 parse option on constructor parses collection and models', function(assert) {
1155 QUnit.test('#1407 parse option on reset parses collection and models', function(assert) {
1179 QUnit.test('Reset includes previous models in triggered event.', function(assert) {
1189 QUnit.test('set', function(assert) {
1242 QUnit.test('set with only cids', function(assert) {
1255 QUnit.test('set with only idAttribute', function(assert) {
1273 QUnit.test('set + merge with default values defined', function(assert) {
1291 QUnit.test('merge without mutation', function(assert) {
1309 QUnit.test('`set` and model level `parse`', function(assert) {
1324 QUnit.test('`set` data is only parsed once', function(assert) {
1336 QUnit.test('`set` matches input order in the absence of a comparator', function(assert) {
1355 QUnit.test('#1894 - Push should not trigger a sort', function(assert) {
1364 QUnit.test('#2428 - push duplicate models, return the correct one', function(assert) {
1372 QUnit.test('`set` with non-normal id', function(assert) {
1381 QUnit.test('#1894 - `sort` can optionally be turned off', function(assert) {
1390 QUnit.test('#1915 - `parse` data in the right order in `set`', function(assert) {
1401 QUnit.test('#1939 - `parse` is passed `options`', function(assert) {
1422 QUnit.test('fetch will pass extra options to success callback', function(assert) {
1442 QUnit.test('`add` only `sort`s when necessary', function(assert) {
1456 QUnit.test('`add` only `sort`s when necessary with comparator function', function(assert) {
1472 QUnit.test('Attach options to collection.', function(assert) {
1486 QUnit.test('Pass falsey for `models` for empty Col with `options`', function(assert) {
1502 QUnit.test('`add` overrides `set` flags', function(assert) {
1511 QUnit.test('#2606 - Collection#create, success arguments', function(assert) {
1523 QUnit.test('#2612 - nested `parse` works with `Collection#set`', function(assert) {
1605QUnit.test('_addReference binds all collection events & adds to the lookup hashes', function(asser…
1638 QUnit.test('Do not allow duplicate models to be `add`ed or `set`', function(assert) {
1650 QUnit.test('#3020: #set with {add: false} should not throw.', function(assert) {
1658 QUnit.test('create with wait, model instance, #3028', function(assert) {
1668 QUnit.test('modelId', function(assert) {
1678 QUnit.test('Polymorphic models work with "simple" constructors', function(assert) {
1694 QUnit.test('Polymorphic models work with "advanced" constructors', function(assert) {
1730QUnit.test('Collection with polymorphic models receives default id from modelId', function(assert)…
1761 QUnit.test('#3039 #3951: adding at index fires with correct at', function(assert) {
1771 QUnit.test('#3039: index is not sent when at is not specified', function(assert) {
1780 QUnit.test('#3199 - Order changing should trigger a sort', function(assert) {
1792 QUnit.test('#3199 - Adding a model should trigger a sort', function(assert) {
1804 QUnit.test('#3199 - Order not changing should not trigger a sort', function(assert) {
1816 QUnit.test('add supports negative indexes', function(assert) {
1825 QUnit.test('#set accepts options.at as a string', function(assert) {
1832 QUnit.test('adding multiple models triggers `update` event once', function(assert) {
1839 QUnit.test('removing models triggers `update` event once', function(assert) {
1846 QUnit.test('remove does not trigger `update` when nothing removed', function(assert) {
1853 QUnit.test('set triggers `set` event once', function(assert) {
1860QUnit.test('set does not trigger `update` event when nothing added nor removed', function(assert) {
1870 QUnit.test('#3610 - invoke collects arguments', function(assert) {
1886 QUnit.test('#3662 - triggering change without model will not error', function(assert) {
1896 QUnit.test('#3871 - falsy parse result creates empty collection', function(assert) {
1904 QUnit.test("#3711 - remove's `update` event returns one removed model", function(assert) {
1916 QUnit.test("#3711 - remove's `update` event returns multiple removed models", function(assert) {
1931 QUnit.test("#3711 - set's `update` event returns one added model", function(assert) {
1942 QUnit.test("#3711 - set's `update` event returns multiple added models", function(assert) {
1955 QUnit.test("#3711 - set's `update` event returns one removed model", function(assert) {
1970 QUnit.test("#3711 - set's `update` event returns multiple removed models", function(assert) {
1984 QUnit.test("#3711 - set's `update` event returns one merged model", function(assert) {
1997 QUnit.test("#3711 - set's `update` event returns multiple merged models", function(assert) {
2012QUnit.test("#3711 - set's `update` event should not be triggered adding a model which already exis…
2023 })(QUnit);