Browse Source

Fixed broken unit test

fixDataView
jos 9 years ago
parent
commit
1dff079d4a
1 changed files with 15 additions and 3 deletions
  1. +15
    -3
      test/DataView.test.js

+ 15
- 3
test/DataView.test.js View File

@ -177,15 +177,27 @@ describe('DataView', function () {
// make a change not affecting the DataView
data.update({id: 1, title: 'Item 1 (changed)'});
assert.deepEqual(dataUpdates, [
['update', {items: [1], data: [{id: 1, title: 'Item 1 (changed)'}]}]
['update', {
items: [1],
data: [{id: 1, title: 'Item 1 (changed)'}],
oldData: [{"group": 1, "id": 1, "title": "Item 1"}]
}]
]);
assert.deepEqual(viewUpdates, []);
// make a change affecting the DataView
data.update({id: 2, title: 'Item 2 (changed)'});
assert.deepEqual(dataUpdates, [
['update', {items: [1], data: [{id: 1, title: 'Item 1 (changed)'}]}],
['update', {items: [2], data: [{id: 2, title: 'Item 2 (changed)'}]}]
['update', {
items: [1],
data: [{id: 1, title: 'Item 1 (changed)'}],
oldData: [{"group": 1, "id": 1, "title": "Item 1"}]
}],
['update', {
items: [2],
data: [{id: 2, title: 'Item 2 (changed)'}],
oldData: [{"group": 2, "id": 2, "title": "Item 2"}]
}]
]);
assert.deepEqual(viewUpdates, [
['update', {items: [2], data: [{id: 2, title: 'Item 2 (changed)'}]}]

Loading…
Cancel
Save