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