Skip to content

Commit

Permalink
improve test for 3.26 to refer to actual removed record
Browse files Browse the repository at this point in the history
  • Loading branch information
snewcomer committed Feb 24, 2021
1 parent de68a6d commit 03a2594
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/-ember-data/tests/integration/debug-adapter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ module('integration/debug-adapter - DS.DebugAdapter', function(hooks) {
updatedRecords = wrappedRecords;
};
let recordsRemoved = function(...args) {
// in 3.26 there is only 1 argument - wrappedRecords
// below 3.26, it is the index and count removed
// in 3.26 there is only 1 argument - the record removed
// below 3.26, it is 2 arguments - the index and count removed
// https://github.com/emberjs/ember.js/pull/19379
removedRecords = args;
};

Expand Down Expand Up @@ -168,10 +169,9 @@ module('integration/debug-adapter - DS.DebugAdapter', function(hooks) {

await settled();

// this is an array with length 1 in 3.26. Simple ok assertion for now due to API change
// https://github.com/emberjs/ember.js/pull/19379
if (gte('3.26.0')) {
assert.ok(removedRecords[0], 'We are notified of the total posts removed');
assert.equal(removedRecords.length, 1, 'We are notified of the total posts removed');
assert.equal(removedRecords[0], post, 'The removed post is correct');
} else {
assert.equal(removedRecords[0], 1, 'We are notified of the start index of a removal when we remove posts');
assert.equal(removedRecords[1], 1, 'We are notified of the total posts removed');
Expand Down

0 comments on commit 03a2594

Please sign in to comment.