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 6995288
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/-ember-data/tests/integration/debug-adapter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ module('integration/debug-adapter - DS.DebugAdapter', function(hooks) {
let recordsRemoved = function(...args) {
// in 3.26 there is only 1 argument - wrappedRecords
// below 3.26, it is 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.deepEqual(record.columnValues, { id: '2', title: 'New Post' }, 'The remove post values are 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 6995288

Please sign in to comment.