Skip to content

Commit

Permalink
Merge branch 'kuraga-null-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
arqex committed Jan 18, 2016
2 parents 69c76c7 + be82b90 commit 7838c7f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var commonMethods = {

if( !update ){
for( var key in attrs ){
update = update || this[ key ] != attrs[ key ];
update = update || this[ key ] !== attrs[ key ];
}

// No changes, just return the node
Expand Down
32 changes: 32 additions & 0 deletions tests/freezer-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,38 @@ describe("Freezer test", function(){
assert.notEqual( updated, data );
});

it( "Update a value to null", function(){
data.set('a', null);

var updated = freezer.getData();

assert.deepEqual( updated.a, null );

assert.notEqual( updated, data );
});

it( "Update an undefined value to null", function(){
data = data.set('a', undefined);
data.set('a', null);

var updated = freezer.getData();

assert.strictEqual( updated.a, null );

assert.notEqual( updated, data );
});

it( "Update an null value to undefined", function(){
data = data.set('a', null);
data.set('a', undefined);

var updated = freezer.getData();

assert.strictEqual( updated.a, undefined );

assert.notEqual( updated, data );
});

it( "Update a value doesnt modify other elements", function(){
data.set({a: 2});

Expand Down

0 comments on commit 7838c7f

Please sign in to comment.