Update tests
This commit is contained in:
parent
5e1d4d7f66
commit
55864b744a
@ -1,8 +1,9 @@
|
|||||||
function configTests({ tryCatch, before, fdescribe, it, firebase }) {
|
function configTests({ before, describe, it, firebase }) {
|
||||||
|
|
||||||
/* Remote config service values = {
|
/* Remote config service values = {
|
||||||
foo: true,
|
foo: true,
|
||||||
foobar: 'barbaz',
|
foobar: 'barbaz',
|
||||||
|
numvalue: 0,
|
||||||
} */
|
} */
|
||||||
|
|
||||||
before(() => {
|
before(() => {
|
||||||
@ -13,7 +14,7 @@ function configTests({ tryCatch, before, fdescribe, it, firebase }) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
fdescribe('Config', () => {
|
describe('Config', () => {
|
||||||
it('it should fetch and activate config', () => {
|
it('it should fetch and activate config', () => {
|
||||||
return firebase.native.config().fetch()
|
return firebase.native.config().fetch()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -39,17 +40,19 @@ function configTests({ tryCatch, before, fdescribe, it, firebase }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('it should get multiple values by an array of keys', () => {
|
it('it should get multiple values by an array of keys', () => {
|
||||||
return firebase.native.config().getValues(['foo', 'bar', 'foobar'])
|
return firebase.native.config().getValues(['foo', 'bar', 'foobar', 'numvalue'])
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
result.should.be.a.Object();
|
result.should.be.a.Object();
|
||||||
result.should.have.keys('foo', 'bar', 'foobar');
|
result.should.have.keys('foo', 'bar', 'foobar');
|
||||||
const fooValue = result.foo.val();
|
const fooValue = result.foo.val();
|
||||||
const barValue = result.bar.val();
|
const barValue = result.bar.val();
|
||||||
const foobarValue = result.foobar.val();
|
const foobarValue = result.foobar.val();
|
||||||
|
const numvalueValue = result.numvalue.val();
|
||||||
|
|
||||||
fooValue.should.be.equal(true);
|
fooValue.should.be.equal(true);
|
||||||
barValue.should.be.equal('baz');
|
barValue.should.be.equal('baz');
|
||||||
foobarValue.should.be.equal('barbaz');
|
foobarValue.should.be.equal('barbaz');
|
||||||
|
numvalueValue.should.be.equal(0);
|
||||||
|
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
});
|
});
|
||||||
|
@ -2,7 +2,7 @@ import firebase from '../../firebase';
|
|||||||
import TestSuite from '../../../lib/TestSuite';
|
import TestSuite from '../../../lib/TestSuite';
|
||||||
import configTests from './configTests';
|
import configTests from './configTests';
|
||||||
|
|
||||||
const suite = new TestSuite('Crash', 'firebase.config()', firebase);
|
const suite = new TestSuite('Remote Config', 'firebase.config()', firebase);
|
||||||
|
|
||||||
// bootstrap tests
|
// bootstrap tests
|
||||||
suite.addTests(configTests);
|
suite.addTests(configTests);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
function storageTests({ xdescribe, it, firebase, tryCatch }) {
|
function storageTests({ describe, it, firebase, tryCatch }) {
|
||||||
xdescribe('downloadFile()', () => {
|
describe('downloadFile()', () => {
|
||||||
it('it should error on download file if permission denied', () => {
|
it('it should error on download file if permission denied', () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const successCb = tryCatch(() => {
|
const successCb = tryCatch(() => {
|
||||||
@ -33,7 +33,7 @@ function storageTests({ xdescribe, it, firebase, tryCatch }) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
xdescribe('putFile()', () => {
|
describe('putFile()', () => {
|
||||||
it('it should error on upload if permission denied', () => {
|
it('it should error on upload if permission denied', () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const successCb = tryCatch(() => {
|
const successCb = tryCatch(() => {
|
||||||
@ -69,7 +69,7 @@ function storageTests({ xdescribe, it, firebase, tryCatch }) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
xdescribe('on()', () => {
|
describe('on()', () => {
|
||||||
it('should listen to upload state', () => {
|
it('should listen to upload state', () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const path = `${firebase.native.storage.Native.DOCUMENT_DIRECTORY_PATH}/ok.jpeg`;
|
const path = `${firebase.native.storage.Native.DOCUMENT_DIRECTORY_PATH}/ok.jpeg`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user