[database][tests] Add tests for #489

This commit is contained in:
Chris Bianca 2017-10-23 18:01:42 +01:00
parent f414796d16
commit b12d9b29d0
2 changed files with 28 additions and 0 deletions

View File

@ -84,6 +84,30 @@ function issueTests({ describe, it, context, firebase }) {
});
});
describe('issue_489', () => {
context('long numbers should', () => {
it('return as longs', async () => {
// Setup
const long1Ref = firebase.native.database().ref('tests/issues/489/long1');
const long2Ref = firebase.native.database().ref('tests/issues/489/long2');
const long2 = 1234567890123456;
// Test
let snapshot = await long1Ref.once('value');
snapshot.val().should.eql(DatabaseContents.ISSUES[489].long1);
await long2Ref.set(long2);
snapshot = await long2Ref.once('value');
snapshot.val().should.eql(long2);
return Promise.resolve();
});
});
});
describe('issue_521', () => {
context('orderByChild (numerical field) and limitToLast', () => {
it('once() returns correct results', async () => {

View File

@ -92,6 +92,10 @@ export default {
},
},
489: {
long1: 1508777379000,
},
// https://github.com/invertase/react-native-firebase/issues/521
521: {
key1: {