Skip to content

Commit c573ff7

Browse files
committed
Added test cases for fix
1 parent 18b714b commit c573ff7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spec/v1/providers/database.spec.ts

+11
Original file line numberDiff line numberDiff line change
@@ -494,20 +494,31 @@ describe("DataSnapshot", () => {
494494
it("should deal with null-values appropriately", () => {
495495
populate(null);
496496
expect(subject.val()).to.be.null;
497+
expect(subject.child("a").val()).to.be.null;
498+
expect(subject.child("a/b").val()).to.be.null;
497499

498500
populate({ myKey: null });
499501
expect(subject.val()).to.be.null;
502+
expect(subject.child("myKey").val()).to.be.null;
503+
expect(subject.child("myKey/a").val()).to.be.null;
504+
expect(subject.child("myKey/a/b").val()).to.be.null;
505+
expect(subject.child("a").val()).to.be.null;
506+
expect(subject.child("a/b").val()).to.be.null;
500507
});
501508

502509
it("should deal with empty object values appropriately", () => {
503510
populate({});
504511
expect(subject.val()).to.be.null;
512+
expect(subject.child("a").val()).to.be.null;
505513

506514
populate({ myKey: {} });
507515
expect(subject.val()).to.be.null;
516+
expect(subject.child("myKey").val()).to.be.null;
508517

509518
populate({ myKey: { child: null } });
510519
expect(subject.val()).to.be.null;
520+
expect(subject.child("myKey").val()).to.be.null;
521+
expect(subject.child("myKey/child").val()).to.be.null;
511522
});
512523

513524
it("should deal with empty array values appropriately", () => {

0 commit comments

Comments
 (0)