Wait, how about success? (#4262)

Amazingly, this test passes.
This commit is contained in:
Julian Gonggrijp
2023-07-19 00:53:02 +02:00
parent 2104aa771f
commit b22474b517

View File

@@ -664,6 +664,16 @@
this.ajaxSettings.error();
});
QUnit.test('successful create with wait:true triggers success event (#4262)', function(assert) {
assert.expect(2);
var collection = new Backbone.Collection;
collection.url = '/test';
collection.on('sync', function() { assert.ok(true); });
var model = collection.create({id: '1'}, {wait: true});
model.on('sync', function() { assert.ok(true); });
this.ajaxSettings.success();
});
QUnit.test('initialize', function(assert) {
assert.expect(1);
var Collection = Backbone.Collection.extend({