1 parent cf60ffe commit 42b9086Copy full SHA for 42b9086
1 file changed
test/unit/snapshot.js
@@ -119,6 +119,18 @@ describe('DataSnapshot', function () {
119
expect(child.getPriority()).to.equal(10);
120
});
121
122
+ it('allows array indexes', function () {
123
+ var parent = new Snapshot(ref, ['foo', 'bar']);
124
+ var child = parent.child(0);
125
+ expect(child.val()).to.equal('foo');
126
+ });
127
+
128
+ it('allows array indexes in multiple paths', function () {
129
+ var parent = new Snapshot(ref, { key: { array: ['foo', 'bar'] }});
130
+ var child = parent.child('key/array/1');
131
+ expect(child.val()).to.equal('bar');
132
133
134
135
136
describe('#exists', function () {
0 commit comments