Skip to content

Commit

Permalink
fixed bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Kogut committed Jan 26, 2017
1 parent 62b1bb1 commit 9d92b8d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions test/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,19 +283,18 @@ test('issue 100', function(t) {
t.end();
});

// FIXME: WTF
test.skip('issue 119 - unobserve before delete', function(t) {
test('issue 119 - unobserve before delete', function(t) {
var propValues = [];
var myObservable = mobx.observable({
myMap: map()
});
myObservable.myMap.set('myId', {
myProp: 'myPropValue',
myCalculatedProp: function() {
myCalculatedProp: mobx.computed(function() {
if (myObservable.myMap.has('myId'))
return myObservable.myMap.get('myId').myProp + ' calculated';
return undefined;
}
})
});
// the error only happens if the value is observed
mobx.autorun(function() {
Expand Down Expand Up @@ -347,19 +346,18 @@ test('map modifier', t => {
t.end();
});

// FIXME: Why is it failing?
test.skip('map modifier with modifier', t => {
var x = mobx.observable(mobx.asMap({ a: { c: 3 } }));
test('map modifier with modifier', t => {
var x = mobx.observable.map({ a: { c: 3 } });
t.equal(mobx.isObservableObject(x.get("a")), true);
x.set("b", { d: 4 });
t.equal(mobx.isObservableObject(x.get("b")), true);

x = mobx.observable(mobx.asMap({ a: { c: 3 } }, mobx.asFlat));
x = mobx.observable.shallowMap({ a: { c: 3 } });
t.equal(mobx.isObservableObject(x.get("a")), false);
x.set("b", { d: 4 });
t.equal(mobx.isObservableObject(x.get("b")), false);

x = mobx.observable({ a: mobx.asMap({ b: {} }, mobx.asFlat)});
x = mobx.observable({ a: mobx.observable.shallowMap({ b: {} })});
t.equal(mobx.isObservableObject(x), true);
t.equal(mobx.isObservableMap(x.a), true);
t.equal(mobx.isObservableObject(x.a.get("b")), false);
Expand Down

0 comments on commit 9d92b8d

Please sign in to comment.