Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions spec/providers/database.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ describe('DeltaSnapshot', () => {
expect(out).to.equal('bd');
});

it('should have correct key values for child snapshots', () => {
populate({ a: 'b' }, { c: 'd' });
let out = '';
subject.forEach(snap => {
out += snap.key;
});
expect(out).to.equal('ac');
});

it('should not execute for leaf or null nodes', () => {
populate(null, 23);
let count = 0;
Expand Down
5 changes: 1 addition & 4 deletions src/providers/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,7 @@ export class DeltaSnapshot implements firebase.database.DataSnapshot {
}

private _fullPath(): string {
let out = (this._path || '') + (this._childPath || '');
if (out === '') {
out = '/';
}
let out = (this._path || '') + '/' + (this._childPath || '');
return out;
}
}