Skip to content

Commit f015d93

Browse files
committed
Add checks for missing intermediate keys
1 parent 4a88bb6 commit f015d93

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/unit/snapshot.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ describe('DataSnapshot', function () {
111111
expect(child.val()).to.equal(null);
112112
});
113113

114+
it('uses null when there is no child data with multiple paths', function () {
115+
var parent = new Snapshot(ref);
116+
var child = parent.child('key/value');
117+
expect(child.val()).to.equal(null);
118+
});
119+
114120
it('passes the priority', function () {
115121
var parent = new Snapshot(ref);
116122
ref.child('key').setPriority(10);
@@ -195,6 +201,7 @@ describe('DataSnapshot', function () {
195201
var snapshot = new Snapshot(ref, {key: {foo: 'bar'}});
196202
expect(snapshot.hasChild('key/foo')).to.equal(true);
197203
expect(snapshot.hasChild('key/bar')).to.equal(false);
204+
expect(snapshot.hasChild('foo/key')).to.equal(false);
198205
});
199206

200207
});

0 commit comments

Comments
 (0)