Skip to content

Commit cf2d344

Browse files
committed
fix: add real test
1 parent 2ce2dc1 commit cf2d344

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

test/unit/data.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@
7777
"char_c": {
7878
".priority": "c",
7979
"aLetter": "c"
80+
},
81+
"zbool_true": {
82+
"aBoolean": true
83+
},
84+
"zbool_false": {
85+
"aBoolean": false
8086
}
8187
},
8288
"collections": {

test/unit/query.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ describe('MockQuery', function () {
146146
expect(spy.called).to.equal(true);
147147
});
148148

149+
it('should work with boolean equalTo', function() {
150+
var spy = sinon.spy(function(snap) {
151+
expect(_.keys(snap.val())).eql(['zbool_true']);
152+
});
153+
154+
ref.limitToLast(2).equalTo(true).on('value', spy);
155+
ref.flush();
156+
expect(spy).callCount(1);
157+
});
158+
149159
it('should return null if not equalTo', function() {
150160
var spy = sinon.spy(function(snap) {
151161
expect(snap.val()).equals(null);
@@ -345,8 +355,4 @@ describe('MockQuery', function () {
345355

346356
it('should start at the key+priority given');
347357
});
348-
349-
describe('equalTo', function() {
350-
it('should start and stop at the key given');
351-
});
352358
});

0 commit comments

Comments
 (0)