fix(change_detection): expose values when detecting changes in key-value pairs

Fixes #1118

Closes #1123
This commit is contained in:
Pawel Kozlowski
2015-03-26 19:19:10 +01:00
parent b09624024b
commit 5306b6dd0c
2 changed files with 33 additions and 15 deletions
@@ -54,6 +54,24 @@ export function main() {
}));
});
it('should expose previous and current value', () => {
var previous, current;
MapWrapper.set(m, 1, 10);
changes.check(m);
MapWrapper.set(m, 1, 20);
changes.check(m);
changes.forEachChangedItem((record) => {
previous = record.previousValue;
current = record.currentValue;
})
expect(previous).toEqual(10);
expect(current).toEqual(20);
});
it('should do basic map watching', () => {
changes.check(m);