Skip to content

Commit

Permalink
Add regression test for #4284
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Jan 23, 2024
1 parent 8c0916a commit d981caa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,16 @@
this.ajaxSettings.success();
});

QUnit.test('successful create with wait:true drops special error listener (#4284)', function(assert) {
assert.expect(1);
var collection = new Backbone.Collection;
collection.url = '/test';
collection.on('error', function() { assert.ok(true); });
var model = collection.create({id: '1'}, {wait: true});
this.ajaxSettings.success();
model.trigger('error');
});

QUnit.test('failing create pre-existing with wait:true triggers once (#4262)', function(assert) {
assert.expect(1);
var model = new Backbone.Model;
Expand Down

0 comments on commit d981caa

Please sign in to comment.