Skip to content

Commit

Permalink
Add checks for missing intermediate keys
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurvihill committed Nov 20, 2019
1 parent 4a88bb6 commit f015d93
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/unit/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ describe('DataSnapshot', function () {
expect(child.val()).to.equal(null);
});

it('uses null when there is no child data with multiple paths', function () {
var parent = new Snapshot(ref);
var child = parent.child('key/value');
expect(child.val()).to.equal(null);
});

it('passes the priority', function () {
var parent = new Snapshot(ref);
ref.child('key').setPriority(10);
Expand Down Expand Up @@ -195,6 +201,7 @@ describe('DataSnapshot', function () {
var snapshot = new Snapshot(ref, {key: {foo: 'bar'}});
expect(snapshot.hasChild('key/foo')).to.equal(true);
expect(snapshot.hasChild('key/bar')).to.equal(false);
expect(snapshot.hasChild('foo/key')).to.equal(false);
});

});
Expand Down

0 comments on commit f015d93

Please sign in to comment.